1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

LibWeb: Add current_property_id to CSS ParsingContext

After `parse_css_value(PropertyID, TokenStream)`, we only need to know
the current PropertyID when checking for property-specific quirks, which
will take place in only 2 places, which happen deep down. Making the
current PropertyID part of the context means that those places can check
it easily, without us having to pass it to every one of the parsing
functions, which otherwise do not care.
This commit is contained in:
Sam Atkins 2021-09-11 20:39:44 +01:00 committed by Andreas Kling
parent af58bddfc8
commit 3fa4f55f86
2 changed files with 5 additions and 0 deletions

View file

@ -2756,6 +2756,7 @@ RefPtr<StyleValue> Parser::parse_as_css_value(PropertyID property_id)
RefPtr<StyleValue> Parser::parse_css_value(PropertyID property_id, TokenStream<StyleComponentValueRule>& tokens)
{
m_context.set_current_property_id(property_id);
Vector<StyleComponentValueRule> component_values;
while (tokens.has_next_token()) {