Browse Source

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
Dominique Liberda 2 years ago
parent
commit
d6ddc25975
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp

+ 2 - 1
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)
         if (name == HTML::AttributeNames::disabled && m_loaded_style_sheet)
             document().style_sheets().remove_sheet(*m_loaded_style_sheet);
             document().style_sheets().remove_sheet(*m_loaded_style_sheet);