mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWeb/CSS: Process style properties from CSSNestedDeclarations rules
These are created when a style rule has properties listed after another rule. For example: ```css .test { --a: 1; --b: 1; --c: 1; .thing { /* ... */ } /* These are after a rule (.thing) so they're wrapped in a CSSNestedDeclarations: */ --d: 1; --e: 1; --f: 1; } ``` They're treated like a nested style rule with the exact same selectors as their containing style rule.
This commit is contained in:
parent
53f99e51f8
commit
e4245dc39e
Notes:
github-actions[bot]
2024-10-17 18:57:04 +00:00
Author: https://github.com/AtkinsSJ
Commit: e4245dc39e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1842
Reviewed-by: https://github.com/awesomekling
6 changed files with 78 additions and 17 deletions
|
@ -82,7 +82,7 @@ enum class CascadeOrigin : u8 {
|
|||
|
||||
struct MatchingRule {
|
||||
JS::GCPtr<DOM::ShadowRoot const> shadow_root;
|
||||
JS::GCPtr<CSSStyleRule const> rule;
|
||||
JS::GCPtr<CSSRule const> rule; // Either CSSStyleRule or CSSNestedDeclarations
|
||||
JS::GCPtr<CSSStyleSheet const> sheet;
|
||||
size_t style_sheet_index { 0 };
|
||||
size_t rule_index { 0 };
|
||||
|
@ -94,6 +94,11 @@ struct MatchingRule {
|
|||
bool can_use_fast_matches { false };
|
||||
bool must_be_hovered { false };
|
||||
bool skip { false };
|
||||
|
||||
// Helpers to deal with the fact that `rule` might be a CSSStyleRule or a CSSNestedDeclarations
|
||||
PropertyOwningCSSStyleDeclaration const& declaration() const;
|
||||
SelectorList const& absolutized_selectors() const;
|
||||
FlyString const& qualified_layer_name() const;
|
||||
};
|
||||
|
||||
struct FontFaceKey {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue