1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:47:44 +00:00

LibWeb: Use SVGPresentationAttribute mode for SVG attributes

This replaces the previous TemporarilyEnableQuirksMode hack, which has
now been removed. :^)
This commit is contained in:
Sam Atkins 2023-09-25 15:28:05 +01:00 committed by Andreas Kling
parent 79a30c209d
commit 28dbe8eb10
3 changed files with 2 additions and 29 deletions

View file

@ -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 <!DOCTYPE html>
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 == "") {