diff --git a/Userland/Libraries/LibWeb/SVG/SVGElement.h b/Userland/Libraries/LibWeb/SVG/SVGElement.h index 5dbe24b9ec..a31e7732a6 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGElement.h @@ -11,27 +11,6 @@ namespace Web::SVG { -namespace FIXME { -class TemporarilyEnableQuirksMode { -public: - TemporarilyEnableQuirksMode(DOM::Document const& document) - : m_document(const_cast(document)) - , m_previous_quirks_mode(document.mode()) - { - m_document.set_quirks_mode(DOM::QuirksMode::Yes); - } - - ~TemporarilyEnableQuirksMode() - { - m_document.set_quirks_mode(m_previous_quirks_mode); - } - -private: - DOM::Document& m_document; - DOM::QuirksMode m_previous_quirks_mode {}; -}; -} - class SVGElement : public DOM::Element { WEB_PLATFORM_OBJECT(SVGElement, DOM::Element); diff --git a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp index 14d111124c..bc34f26b04 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp @@ -118,10 +118,7 @@ Gfx::AffineTransform SVGGraphicsElement::get_transform() const void SVGGraphicsElement::apply_presentational_hints(CSS::StyleProperties& style) const { - // FIXME: Hack to ensure unitless SVG properties (such as font-size) are parsed. - FIXME::TemporarilyEnableQuirksMode enable_quirks(document()); - - CSS::Parser::ParsingContext parsing_context { document() }; + CSS::Parser::ParsingContext parsing_context { document(), CSS::Parser::ParsingContext::Mode::SVGPresentationAttribute }; for_each_attribute([&](auto& name, auto& value) { if (name.equals_ignoring_ascii_case("fill"sv)) { // FIXME: The `fill` attribute and CSS `fill` property are not the same! But our support is limited enough that they are equivalent for now. diff --git a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp index 95514af599..722bf51e72 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp @@ -38,11 +38,8 @@ void SVGSVGElement::apply_presentational_hints(CSS::StyleProperties& style) cons { Base::apply_presentational_hints(style); - // NOTE: Hack to ensure SVG unitless widths/heights are parsed even with - FIXME::TemporarilyEnableQuirksMode enable_quirks(document()); - auto width_attribute = deprecated_attribute(SVG::AttributeNames::width); - auto parsing_context = CSS::Parser::ParsingContext { document() }; + auto parsing_context = CSS::Parser::ParsingContext { document(), CSS::Parser::ParsingContext::Mode::SVGPresentationAttribute }; if (auto width_value = parse_css_value(parsing_context, deprecated_attribute(Web::HTML::AttributeNames::width), CSS::PropertyID::Width)) { style.set_property(CSS::PropertyID::Width, width_value.release_nonnull()); } else if (width_attribute == "") {