mirror of
https://github.com/servo/servo
synced 2026-05-03 04:42:17 +02:00
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:
@@ -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::ToCssWithGuard;
|
||||
use style::stylesheets::{CssRuleType, NamespaceRule};
|
||||
@@ -12,11 +13,10 @@ use style::stylesheets::{CssRuleType, NamespaceRule};
|
||||
use super::cssrule::{CSSRule, SpecificCSSRule};
|
||||
use super::cssstylesheet::CSSStyleSheet;
|
||||
use crate::dom::bindings::codegen::Bindings::CSSNamespaceRuleBinding::CSSNamespaceRuleMethods;
|
||||
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 CSSNamespaceRule {
|
||||
@@ -38,18 +38,18 @@ impl CSSNamespaceRule {
|
||||
}
|
||||
|
||||
pub(crate) fn new(
|
||||
cx: &mut JSContext,
|
||||
window: &Window,
|
||||
parent_stylesheet: &CSSStyleSheet,
|
||||
namespacerule: Arc<NamespaceRule>,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<CSSNamespaceRule> {
|
||||
reflect_dom_object(
|
||||
reflect_dom_object_with_cx(
|
||||
Box::new(CSSNamespaceRule::new_inherited(
|
||||
parent_stylesheet,
|
||||
namespacerule,
|
||||
)),
|
||||
window,
|
||||
can_gc,
|
||||
cx,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user