mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibWeb: Add StyleElementUtils::visit_edges()
Let's do this instead of making embedders visit every field of this helper class.
This commit is contained in:
parent
9075f64cac
commit
2064be708f
Notes:
github-actions[bot]
2024-09-21 06:56:58 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/2064be708f7 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1467
3 changed files with 7 additions and 2 deletions
|
@ -19,6 +19,11 @@ public:
|
|||
CSS::CSSStyleSheet* sheet() { return m_associated_css_style_sheet; }
|
||||
CSS::CSSStyleSheet const* sheet() const { return m_associated_css_style_sheet; }
|
||||
|
||||
void visit_edges(JS::Cell::Visitor& visitor)
|
||||
{
|
||||
visitor.visit(m_associated_css_style_sheet);
|
||||
}
|
||||
|
||||
private:
|
||||
// https://www.w3.org/TR/cssom/#associated-css-style-sheet
|
||||
JS::GCPtr<CSS::CSSStyleSheet> m_associated_css_style_sheet;
|
||||
|
|
|
@ -29,7 +29,7 @@ void HTMLStyleElement::initialize(JS::Realm& realm)
|
|||
void HTMLStyleElement::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_style_element_utils.sheet());
|
||||
m_style_element_utils.visit_edges(visitor);
|
||||
}
|
||||
|
||||
void HTMLStyleElement::children_changed()
|
||||
|
|
|
@ -27,7 +27,7 @@ void SVGStyleElement::initialize(JS::Realm& realm)
|
|||
void SVGStyleElement::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_style_element_utils.sheet());
|
||||
m_style_element_utils.visit_edges(visitor);
|
||||
}
|
||||
|
||||
void SVGStyleElement::children_changed()
|
||||
|
|
Loading…
Reference in a new issue