mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibWeb: Remove unecessary dependence on Window from CSS classes
These classes only needed Window to get at its realm. Pass a realm directly to construct CSS classes.
This commit is contained in:
parent
8de7e49a56
commit
a2ccb00e1d
Notes:
sideshowbarker
2024-07-17 21:11:12 +09:00
Author: https://github.com/ADKaster
Commit: a2ccb00e1d
Pull-request: https://github.com/SerenityOS/serenity/pull/15349
Reviewed-by: https://github.com/linusg ✅
37 changed files with 159 additions and 146 deletions
|
@ -5,6 +5,8 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Bindings/CSSGroupingRulePrototype.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Bindings/MainThreadVM.h>
|
||||
#include <LibWeb/CSS/CSSGroupingRule.h>
|
||||
#include <LibWeb/CSS/CSSRuleList.h>
|
||||
|
@ -12,11 +14,11 @@
|
|||
|
||||
namespace Web::CSS {
|
||||
|
||||
CSSGroupingRule::CSSGroupingRule(HTML::Window& window_object, CSSRuleList& rules)
|
||||
: CSSRule(window_object)
|
||||
CSSGroupingRule::CSSGroupingRule(JS::Realm& realm, CSSRuleList& rules)
|
||||
: CSSRule(realm)
|
||||
, m_rules(rules)
|
||||
{
|
||||
set_prototype(&window_object.cached_web_prototype("CSSGroupingRule"));
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CSSGroupingRulePrototype>(realm, "CSSGroupingRule"));
|
||||
for (auto& rule : m_rules)
|
||||
rule.set_parent_rule(this);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue