LibWeb: Stop passing Realm unnecessarily to parse CSS properties

Also use the parse_css_value() helper in cases where we previously
constructed a Parser manually.
This commit is contained in:
Sam Atkins 2024-12-05 11:52:43 +00:00 committed by Alexander Kalenik
commit bc77f84359
Notes: github-actions[bot] 2024-12-05 19:00:42 +00:00
11 changed files with 20 additions and 46 deletions

View file

@ -43,8 +43,7 @@ public:
// and with system fonts being computed to explicit values.
// FIXME: with the 'line-height' component forced to 'normal'
// FIXME: with the 'font-size' component converted to CSS pixels
auto parsing_context = CSS::Parser::ParsingContext { reinterpret_cast<IncludingClass&>(*this).realm() };
auto font_style_value_result = parse_css_value(parsing_context, font, CSS::PropertyID::Font);
auto font_style_value_result = parse_css_value(CSS::Parser::ParsingContext {}, font, CSS::PropertyID::Font);
// If the new value is syntactically incorrect (including using property-independent style sheet syntax like 'inherit' or 'initial'), then it must be ignored, without assigning a new font value.
// NOTE: ShorthandStyleValue should be the only valid option here. We implicitly VERIFY this below.