1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-17 09:17:35 +00:00

LibWeb: Remove for_first_not_loaded_import_rule() :^)

This was only used for making sure `@import` rules got loaded, and since
they handle that themselves now, we can get rid of all this code!
This commit is contained in:
Sam Atkins 2021-11-18 17:53:03 +00:00 committed by Andreas Kling
parent 9d72815deb
commit 6fc1810190
8 changed files with 0 additions and 45 deletions

View file

@ -23,12 +23,4 @@ void CSSConditionRule::for_each_effective_style_rule(Function<void(CSSStyleRule
CSSGroupingRule::for_each_effective_style_rule(callback);
}
bool CSSConditionRule::for_first_not_loaded_import_rule(Function<void(CSSImportRule&)> const& callback)
{
if (condition_matches())
return CSSGroupingRule::for_first_not_loaded_import_rule(callback);
return false;
}
}

View file

@ -24,7 +24,6 @@ public:
virtual bool condition_matches() const = 0;
virtual void for_each_effective_style_rule(Function<void(CSSStyleRule const&)> const& callback) const override;
virtual bool for_first_not_loaded_import_rule(Function<void(CSSImportRule&)> const& callback) override;
protected:
explicit CSSConditionRule(NonnullRefPtrVector<CSSRule>&&);

View file

@ -35,9 +35,4 @@ void CSSGroupingRule::for_each_effective_style_rule(Function<void(CSSStyleRule c
m_rules->for_each_effective_style_rule(callback);
}
bool CSSGroupingRule::for_first_not_loaded_import_rule(Function<void(CSSImportRule&)> const& callback)
{
return m_rules->for_first_not_loaded_import_rule(callback);
}
}

View file

@ -27,7 +27,6 @@ public:
void delete_rule(size_t index);
virtual void for_each_effective_style_rule(Function<void(CSSStyleRule const&)> const& callback) const;
virtual bool for_first_not_loaded_import_rule(Function<void(CSSImportRule&)> const& callback);
protected:
explicit CSSGroupingRule(NonnullRefPtrVector<CSSRule>&&);

View file

@ -103,29 +103,6 @@ void CSSRuleList::for_each_effective_style_rule(Function<void(CSSStyleRule const
}
}
bool CSSRuleList::for_first_not_loaded_import_rule(Function<void(CSSImportRule&)> const& callback)
{
for (auto& rule : m_rules) {
if (rule.type() == CSSRule::Type::Import) {
auto& import_rule = verify_cast<CSSImportRule>(rule);
if (!import_rule.has_import_result()) {
callback(import_rule);
return true;
}
if (import_rule.loaded_style_sheet()->for_first_not_loaded_import_rule(callback)) {
return true;
}
} else if (rule.type() == CSSRule::Type::Media) {
return verify_cast<CSSMediaRule>(rule).for_first_not_loaded_import_rule(callback);
} else if (rule.type() == CSSRule::Type::Supports) {
return verify_cast<CSSSupportsRule>(rule).for_first_not_loaded_import_rule(callback);
}
}
return false;
}
void CSSRuleList::evaluate_media_queries(DOM::Window const& window)
{
for (auto& rule : m_rules) {

View file

@ -52,7 +52,6 @@ public:
DOM::ExceptionOr<unsigned> insert_a_css_rule(NonnullRefPtr<CSSRule>, u32 index);
void for_each_effective_style_rule(Function<void(CSSStyleRule const&)> const& callback) const;
bool for_first_not_loaded_import_rule(Function<void(CSSImportRule&)> const& callback);
void evaluate_media_queries(DOM::Window const&);
private:

View file

@ -62,11 +62,6 @@ void CSSStyleSheet::for_each_effective_style_rule(Function<void(CSSStyleRule con
m_rules->for_each_effective_style_rule(callback);
}
bool CSSStyleSheet::for_first_not_loaded_import_rule(Function<void(CSSImportRule&)> const& callback)
{
return m_rules->for_first_not_loaded_import_rule(callback);
}
void CSSStyleSheet::evaluate_media_queries(DOM::Window const& window)
{
m_rules->evaluate_media_queries(window);

View file

@ -45,7 +45,6 @@ public:
DOM::ExceptionOr<void> delete_rule(unsigned index);
void for_each_effective_style_rule(Function<void(CSSStyleRule const&)> const& callback) const;
bool for_first_not_loaded_import_rule(Function<void(CSSImportRule&)> const& callback);
void evaluate_media_queries(DOM::Window const&);
private: