script: Pass &mut JSContext to CSSKeyframeRule::Style (#43549)

Move `CSSKeyframeRule::Style` from `CanGc` to `&mut JSContext`.

Testing: Just a refactor, Existing tests suffice.
Fixes: Part of #42638

Signed-off-by: arabson99 <arabiusman99@gmail.com>
This commit is contained in:
Abubakar Abdulazeez Usman
2026-03-23 03:54:31 +01:00
committed by GitHub
parent d44f2da4e2
commit 6c7fcd41bd
2 changed files with 4 additions and 3 deletions

View File

@@ -5,6 +5,7 @@
use std::cell::RefCell;
use dom_struct::dom_struct;
use js::context::JSContext;
use servo_arc::Arc;
use style::shared_lock::{Locked, SharedRwLockReadGuard, ToCssWithGuard};
use style::stylesheets::CssRuleType;
@@ -72,7 +73,7 @@ impl CSSKeyframeRule {
impl CSSKeyframeRuleMethods<crate::DomTypeHolder> for CSSKeyframeRule {
/// <https://drafts.csswg.org/css-animations/#dom-csskeyframerule-style>
fn Style(&self, can_gc: CanGc) -> DomRoot<CSSStyleDeclaration> {
fn Style(&self, cx: &mut JSContext) -> DomRoot<CSSStyleDeclaration> {
self.style_declaration.or_init(|| {
let guard = self.css_rule.shared_lock().read();
CSSStyleDeclaration::new(
@@ -83,7 +84,7 @@ impl CSSKeyframeRuleMethods<crate::DomTypeHolder> for CSSKeyframeRule {
),
None,
CSSModificationAccess::ReadWrite,
can_gc,
CanGc::from_cx(cx),
)
})
}