From d6ddc2597598dd22acbf21c8d858fe1fcc4b243e Mon Sep 17 00:00:00 2001 From: Dominique Liberda Date: Sun, 23 Jul 2023 21:37:41 +0200 Subject: [PATCH] LibWeb: Skip alternate stylesheets in HTMLLinkElement::attribute_changed This mirrors the existing FIXME in HTMLLinkElement::inserted. A good test case is the following page, which loads several alternate stylesheets: https://www.w3.org/Style/Examples/007/center.en.html --- Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp index be46859861..d00cb2865e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp @@ -107,7 +107,8 @@ void HTMLLinkElement::attribute_changed(DeprecatedFlyString const& name, Depreca } } - if (m_relationship & Relationship::Stylesheet) { + // FIXME: Handle alternate stylesheets properly + if (m_relationship & Relationship::Stylesheet && !(m_relationship & Relationship::Alternate)) { if (name == HTML::AttributeNames::disabled && m_loaded_style_sheet) document().style_sheets().remove_sheet(*m_loaded_style_sheet);