1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:18:11 +00:00

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
This commit is contained in:
Dominique Liberda 2023-07-23 21:37:41 +02:00 committed by Linus Groh
parent 4dc98af419
commit d6ddc25975

View file

@ -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);