mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
LibWeb/CSS: Use CSSRule's context to parse new child rules
Keep track of which CSSRule owns a CSSRuleList, and then use that to produce a stack of RuleContexts for the CSS Parser to use. There are certainly other places we should do this!
This commit is contained in:
parent
763b1b0ee2
commit
658569b533
Notes:
github-actions[bot]
2025-04-23 10:39:55 +00:00
Author: https://github.com/AtkinsSJ
Commit: 658569b533
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4354
7 changed files with 32 additions and 15 deletions
|
@ -1216,6 +1216,8 @@ void CSSStyleProperties::set_declarations_from_text(StringView css_text)
|
|||
auto parsing_params = owner_node().has_value()
|
||||
? Parser::ParsingParams(owner_node()->element().document())
|
||||
: Parser::ParsingParams();
|
||||
parsing_params.rule_context.append(Parser::RuleContext::Style);
|
||||
|
||||
auto style = parse_css_property_declaration_block(parsing_params, css_text);
|
||||
set_the_declarations(style.properties, style.custom_properties);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue