script: JSContextify dom/css partially (#44406)

This JSContextifies parts of dom/css directory.

Testing: Compilation is the test.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
Narfinger
2026-04-22 01:46:06 +09:00
committed by GitHub
parent 99899612cb
commit 617c9c0162
20 changed files with 132 additions and 139 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, CssRules, LayerBlockRule};
@@ -14,11 +15,10 @@ use super::cssgroupingrule::CSSGroupingRule;
use super::cssrule::SpecificCSSRule;
use super::cssstylesheet::CSSStyleSheet;
use crate::dom::bindings::codegen::Bindings::CSSLayerBlockRuleBinding::CSSLayerBlockRuleMethods;
use crate::dom::bindings::reflector::reflect_dom_object;
use crate::dom::bindings::reflector::reflect_dom_object_with_cx;
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString;
use crate::dom::window::Window;
use crate::script_runtime::CanGc;
#[dom_struct]
pub(crate) struct CSSLayerBlockRule {
@@ -40,18 +40,18 @@ impl CSSLayerBlockRule {
}
pub(crate) fn new(
cx: &mut JSContext,
window: &Window,
parent_stylesheet: &CSSStyleSheet,
layerblockrule: Arc<LayerBlockRule>,
can_gc: CanGc,
) -> DomRoot<CSSLayerBlockRule> {
reflect_dom_object(
reflect_dom_object_with_cx(
Box::new(CSSLayerBlockRule::new_inherited(
parent_stylesheet,
layerblockrule,
)),
window,
can_gc,
cx,
)
}