LibWeb/CSS: Stop assuming CSSNestedDeclarations's parent is CSSStyleRule

This will no longer be true once we implement at-rules nested inside
style rules, for example:

```css
.foo {
  color: yellow;

  @media (min-width: 800px) {
    color: orange;
  }
}
```
This commit is contained in:
Sam Atkins 2024-11-06 17:43:30 +00:00 committed by Andreas Kling
commit ce947ff983
Notes: github-actions[bot] 2024-11-07 14:12:42 +00:00
3 changed files with 31 additions and 3 deletions

View file

@ -23,14 +23,18 @@ public:
CSSStyleDeclaration* style();
CSSStyleRule const& parent_style_rule() const;
private:
CSSNestedDeclarations(JS::Realm&, PropertyOwningCSSStyleDeclaration&);
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
virtual String serialized() const override;
virtual void clear_caches() override;
JS::NonnullGCPtr<PropertyOwningCSSStyleDeclaration> m_declaration;
JS::GCPtr<CSSStyleRule const> mutable m_parent_style_rule;
};
template<>