mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWeb: Make CSSKeyframeRule.parentRule actually point to parent rule
This commit is contained in:
parent
7f2c833a39
commit
19fa630fa7
Notes:
sideshowbarker
2024-07-17 11:29:41 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/19fa630fa7 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/168
4 changed files with 14 additions and 7 deletions
|
@ -1,5 +1,7 @@
|
|||
fooRule: [object CSSKeyframesRule] ~ @keyframes "foo" { 0% { color: rgb(0, 0, 0); } 100% { color: rgb(255, 255, 255); } }
|
||||
fooRule.cssRules: [object CSSRuleList]
|
||||
fooRule.cssRules[0]: [object CSSKeyframeRule] ~ 0% { color: rgb(0, 0, 0); }
|
||||
fooRule.cssRules[0].parentRule: [object CSSKeyframesRule]
|
||||
fooRule.cssRules[0].parentRule: [object CSSKeyframesRule] ~ @keyframes "foo" { 0% { color: rgb(0, 0, 0); } 100% { color: rgb(255, 255, 255); } }
|
||||
fooRule.cssRules[0].style.parentRule: [object CSSKeyframeRule] ~ 0% { color: rgb(0, 0, 0); }
|
||||
fooRule.cssRules[0].style.parentRule === fooRule.cssRules[0]: true
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
println("fooRule: " + fooRule + " ~ " + fooRule.cssText);
|
||||
println("fooRule.cssRules: " + fooRule.cssRules);
|
||||
println("fooRule.cssRules[0]: " + fooRule.cssRules[0] + " ~ " + fooRule.cssRules[0].cssText);
|
||||
println("fooRule.cssRules[0].parentRule: " + fooRule.cssRules[0].parentRule);
|
||||
println("fooRule.cssRules[0].parentRule: " + fooRule.cssRules[0].parentRule + " ~ " + fooRule.cssRules[0].parentRule.cssText);
|
||||
println("fooRule.cssRules[0].style.parentRule: " + fooRule.cssRules[0].style.parentRule + " ~ " + fooRule.cssRules[0].style.parentRule.cssText);
|
||||
println("fooRule.cssRules[0].style.parentRule === fooRule.cssRules[0]: " + (fooRule.cssRules[0].style.parentRule === fooRule.cssRules[0]));
|
||||
});
|
||||
|
|
|
@ -19,6 +19,15 @@ JS::NonnullGCPtr<CSSKeyframesRule> CSSKeyframesRule::create(JS::Realm& realm, Fl
|
|||
return realm.heap().allocate<CSSKeyframesRule>(realm, realm, move(name), move(css_rules));
|
||||
}
|
||||
|
||||
CSSKeyframesRule::CSSKeyframesRule(JS::Realm& realm, FlyString name, JS::NonnullGCPtr<CSSRuleList> keyframes)
|
||||
: CSSRule(realm)
|
||||
, m_name(move(name))
|
||||
, m_rules(move(keyframes))
|
||||
{
|
||||
for (auto& rule : *m_rules)
|
||||
rule->set_parent_rule(this);
|
||||
}
|
||||
|
||||
void CSSKeyframesRule::visit_edges(Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
|
|
|
@ -37,13 +37,7 @@ public:
|
|||
void set_name(String const& name) { m_name = name; }
|
||||
|
||||
private:
|
||||
CSSKeyframesRule(JS::Realm& realm, FlyString name, JS::NonnullGCPtr<CSSRuleList> keyframes)
|
||||
: CSSRule(realm)
|
||||
, m_name(move(name))
|
||||
, m_rules(move(keyframes))
|
||||
{
|
||||
}
|
||||
|
||||
CSSKeyframesRule(JS::Realm&, FlyString name, JS::NonnullGCPtr<CSSRuleList> keyframes);
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
|
Loading…
Reference in a new issue