diff --git a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp index 4b72ae58a1..abfab45dbf 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp @@ -37,6 +37,13 @@ JS::GCPtr SVGSVGElement::create_layout_node(NonnullRefPtr + auto previous_quirks_mode = document().mode(); + const_cast(document()).set_quirks_mode(DOM::QuirksMode::Yes); + ScopeGuard reset_quirks_mode = [&] { + const_cast(document()).set_quirks_mode(previous_quirks_mode); + }; + auto width_attribute = attribute(SVG::AttributeNames::width); auto parsing_context = CSS::Parser::ParsingContext { document() }; if (auto width_value = parse_css_value(parsing_context, attribute(Web::HTML::AttributeNames::width), CSS::PropertyID::Width)) {