LibWeb: Pass callback as lvalue ref in for_each_active_stylesheet
Taking the callback as an rvalue ref meant we couldn't use the same callback more than once
This commit is contained in:
parent
0002d1cfc3
commit
2cc3fbb017
6 changed files with 8 additions and 8 deletions
|
|
@ -461,12 +461,12 @@ RuleCache const& StyleScope::get_pseudo_class_rule_cache(PseudoClass pseudo_clas
|
|||
return *m_pseudo_class_rule_cache[to_underlying(pseudo_class)];
|
||||
}
|
||||
|
||||
void StyleScope::for_each_active_css_style_sheet(Function<void(CSS::CSSStyleSheet&)>&& callback) const
|
||||
void StyleScope::for_each_active_css_style_sheet(Function<void(CSS::CSSStyleSheet&)> const& callback) const
|
||||
{
|
||||
if (auto* shadow_root = as_if<DOM::ShadowRoot>(*m_node)) {
|
||||
shadow_root->for_each_active_css_style_sheet(move(callback));
|
||||
shadow_root->for_each_active_css_style_sheet(callback);
|
||||
} else {
|
||||
m_node->document().for_each_active_css_style_sheet(move(callback));
|
||||
m_node->document().for_each_active_css_style_sheet(callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ public:
|
|||
[[nodiscard]] bool may_have_has_selectors() const;
|
||||
[[nodiscard]] bool have_has_selectors() const;
|
||||
|
||||
void for_each_active_css_style_sheet(Function<void(CSS::CSSStyleSheet&)>&& callback) const;
|
||||
void for_each_active_css_style_sheet(Function<void(CSS::CSSStyleSheet&)> const& callback) const;
|
||||
|
||||
void invalidate_style_of_elements_affected_by_has();
|
||||
|
||||
|
|
|
|||
|
|
@ -6427,7 +6427,7 @@ WebIDL::ExceptionOr<void> Document::set_adopted_style_sheets(JS::Value new_value
|
|||
return {};
|
||||
}
|
||||
|
||||
void Document::for_each_active_css_style_sheet(Function<void(CSS::CSSStyleSheet&)>&& callback) const
|
||||
void Document::for_each_active_css_style_sheet(Function<void(CSS::CSSStyleSheet&)> const& callback) const
|
||||
{
|
||||
if (m_style_sheets) {
|
||||
for (auto& style_sheet : m_style_sheets->sheets()) {
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ public:
|
|||
CSS::StyleSheetList& style_sheets();
|
||||
CSS::StyleSheetList const& style_sheets() const;
|
||||
|
||||
void for_each_active_css_style_sheet(Function<void(CSS::CSSStyleSheet&)>&& callback) const;
|
||||
void for_each_active_css_style_sheet(Function<void(CSS::CSSStyleSheet&)> const& callback) const;
|
||||
|
||||
CSS::StyleSheetList* style_sheets_for_bindings() { return &style_sheets(); }
|
||||
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ void ShadowRoot::for_each_css_style_sheet(Function<void(CSS::CSSStyleSheet&)>&&
|
|||
}
|
||||
}
|
||||
|
||||
void ShadowRoot::for_each_active_css_style_sheet(Function<void(CSS::CSSStyleSheet&)>&& callback) const
|
||||
void ShadowRoot::for_each_active_css_style_sheet(Function<void(CSS::CSSStyleSheet&)> const& callback) const
|
||||
{
|
||||
for (auto& style_sheet : style_sheets().sheets()) {
|
||||
if (!style_sheet->disabled())
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public:
|
|||
WebIDL::ExceptionOr<void> set_adopted_style_sheets(JS::Value);
|
||||
|
||||
void for_each_css_style_sheet(Function<void(CSS::CSSStyleSheet&)>&& callback) const;
|
||||
void for_each_active_css_style_sheet(Function<void(CSS::CSSStyleSheet&)>&& callback) const;
|
||||
void for_each_active_css_style_sheet(Function<void(CSS::CSSStyleSheet&)> const& callback) const;
|
||||
|
||||
WebIDL::ExceptionOr<Vector<GC::Ref<Animations::Animation>>> get_animations();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue