1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:17:35 +00:00

LibWeb: Enable quirks when parsing SVGGraphicsElement CSS attributes

This allows valid SVG attributes such as `font-size` with a unitless
value to be parsed successfully (in an admittedly hacky way).
This commit is contained in:
MacDue 2023-07-20 20:58:13 +01:00 committed by Andreas Kling
parent 48d03a68e9
commit 4cdb4de049
3 changed files with 26 additions and 5 deletions

View file

@ -117,6 +117,9 @@ 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() };
for_each_attribute([&](auto& name, auto& value) {
if (name.equals_ignoring_ascii_case("fill"sv)) {