diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2021-11-18 17:53:03 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-18 21:11:19 +0100 |
commit | 6fc1810190f05fddc296a5b56e15ee7cf0a2863c (patch) | |
tree | be6633c05afd06f5d2a766b254b1b28f2c9d00e8 | |
parent | 9d72815deba7ad31c4261889b77f0643680e32c2 (diff) | |
download | serenity-6fc1810190f05fddc296a5b56e15ee7cf0a2863c.zip |
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!
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/CSSConditionRule.h | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/CSSGroupingRule.cpp | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/CSSGroupingRule.h | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp | 23 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/CSSRuleList.h | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h | 1 |
8 files changed, 0 insertions, 45 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp index 35b16b5dd7..018315bd21 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp @@ -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; -} - } diff --git a/Userland/Libraries/LibWeb/CSS/CSSConditionRule.h b/Userland/Libraries/LibWeb/CSS/CSSConditionRule.h index adca7a46cb..9c41847a2b 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSConditionRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSConditionRule.h @@ -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>&&); diff --git a/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.cpp index c9e1a2ae58..60584d02c5 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.cpp @@ -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); -} - } diff --git a/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.h b/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.h index af12208697..20859e98cd 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.h @@ -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>&&); diff --git a/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp b/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp index 497fce9154..b580b0e7fe 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp @@ -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) { diff --git a/Userland/Libraries/LibWeb/CSS/CSSRuleList.h b/Userland/Libraries/LibWeb/CSS/CSSRuleList.h index 293a5b8780..a8a76cbb4f 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSRuleList.h +++ b/Userland/Libraries/LibWeb/CSS/CSSRuleList.h @@ -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: diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp index 3766dae026..783a84ae31 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp @@ -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); diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h index 6ff2c2fc05..9d08ef21ed 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h @@ -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: |