mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-31 15:32:51 +00:00
LibWeb/CSS: Parse nested declarations in insert_a_css_rule()
The spec algorithm changed at some point to support nested declarations, but I only just noticed. The subtest regression is one we were passing incorrectly.
This commit is contained in:
parent
fa8bbfa6a5
commit
3d1665cc80
Notes:
github-actions[bot]
2025-04-23 10:40:15 +00:00
Author: https://github.com/AtkinsSJ
Commit: 3d1665cc80
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4354
4 changed files with 40 additions and 20 deletions
|
@ -41,10 +41,14 @@ void CSSGroupingRule::clear_caches()
|
|||
rule->clear_caches();
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#dom-cssgroupingrule-insertrule
|
||||
WebIDL::ExceptionOr<u32> CSSGroupingRule::insert_rule(StringView rule, u32 index)
|
||||
{
|
||||
TRY(m_rules->insert_a_css_rule(rule, index));
|
||||
// NOTE: The spec doesn't say where to set the parent rule, so we'll do it here.
|
||||
// The insertRule(rule, index) method must return the result of invoking insert a CSS rule rule into the child CSS
|
||||
// rules at index, with the nested flag set.
|
||||
TRY(m_rules->insert_a_css_rule(rule, index, CSSRuleList::Nested::Yes));
|
||||
|
||||
// AD-HOC: The spec doesn't say where to set the parent rule, so we'll do it here.
|
||||
m_rules->item(index)->set_parent_rule(this);
|
||||
return index;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue