LibWeb: Unset stylesheet properties when removing from a StyleSheetList

Previously, the parent CSS stylesheet, owner node and owner CSS rule
properties were not unset when removing a sheet from a StyleSheetList.

This change moves the methods for adding and removing sheets to and
from a StyleSheetList, directly into the StyleSheetList class and
ensures they are called as required by the CSSOM specification.
This commit is contained in:
Tim Ledbetter 2024-04-15 21:42:46 +01:00 committed by Andreas Kling
commit d5cddd4696
Notes: sideshowbarker 2024-07-17 06:40:21 +09:00
7 changed files with 78 additions and 66 deletions

View file

@ -20,10 +20,6 @@ public:
CSS::CSSStyleSheet const* sheet() const { return m_associated_css_style_sheet; }
private:
void remove_a_css_style_sheet(CSS::StyleSheetList&, CSS::CSSStyleSheet& sheet);
void create_a_css_style_sheet(CSS::StyleSheetList&, String type, DOM::Element* owner_node, String media, String title, bool alternate, bool origin_clean, Optional<String> location, CSS::CSSStyleSheet* parent_style_sheet, CSS::CSSRule* owner_rule, CSS::CSSStyleSheet& sheet);
void add_a_css_style_sheet(CSS::StyleSheetList&, CSS::CSSStyleSheet& sheet);
// https://www.w3.org/TR/cssom/#associated-css-style-sheet
JS::GCPtr<CSS::CSSStyleSheet> m_associated_css_style_sheet;
};