Struct script::dom::cssrulelist::CSSRuleList
source · #[repr(C)]pub struct CSSRuleList {
reflector_: Reflector,
parent_stylesheet: Dom<CSSStyleSheet>,
rules: RulesSource,
dom_rules: DomRefCell<Vec<MutNullableDom<CSSRule>>>,
}
Fields
reflector_: Reflector
parent_stylesheet: Dom<CSSStyleSheet>
rules: RulesSource
dom_rules: DomRefCell<Vec<MutNullableDom<CSSRule>>>
Implementations
sourceimpl CSSRuleList
impl CSSRuleList
pub fn new_inherited(
parent_stylesheet: &CSSStyleSheet,
rules: RulesSource
) -> CSSRuleList
pub fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,
rules: RulesSource
) -> Root<Dom<CSSRuleList>>
sourcepub fn insert_rule(&self, rule: &str, idx: u32, nested: bool) -> Result<u32, Error>
pub fn insert_rule(&self, rule: &str, idx: u32, nested: bool) -> Result<u32, Error>
Should only be called for CssRules-backed rules. Use append_lazy_rule for keyframes-backed rules.
pub fn remove_rule(&self, index: u32) -> Result<(), Error>
pub fn deparent_all(&self)
pub fn item(&self, idx: u32) -> Option<Root<Dom<CSSRule>>>
sourcepub fn append_lazy_dom_rule(&self)
pub fn append_lazy_dom_rule(&self)
Add a rule to the list of DOM rules. This list is lazy, so we just append a placeholder.
Should only be called for keyframes-backed rules, use insert_rule for CssRules-backed rules
Trait Implementations
sourceimpl CSSRuleListMethods for CSSRuleList
impl CSSRuleListMethods for CSSRuleList
sourceimpl DomObject for CSSRuleList
impl DomObject for CSSRuleList
sourceimpl DomObjectWrap for CSSRuleList
impl DomObjectWrap for CSSRuleList
sourceconst WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::CSSRuleListBinding::CSSRuleListBinding::Wrap as for<'a> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::boxed::Box<dom::cssrulelist::CSSRuleList>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::cssrulelist::CSSRuleList>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::CSSRuleListBinding::CSSRuleListBinding::Wrap as for<'a> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::boxed::Box<dom::cssrulelist::CSSRuleList>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::cssrulelist::CSSRuleList>>}
Function pointer to the general wrap function type
sourceimpl HasParent for CSSRuleList
impl HasParent for CSSRuleList
sourceimpl IDLInterface for CSSRuleList
impl IDLInterface for CSSRuleList
sourceimpl JSTraceable for CSSRuleList
impl JSTraceable for CSSRuleList
sourceimpl MallocSizeOf for CSSRuleList
impl MallocSizeOf for CSSRuleList
sourcefn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself. Read more
sourceimpl MutDomObject for CSSRuleList
impl MutDomObject for CSSRuleList
sourceunsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
Initializes the Reflector
sourceimpl PartialEq<CSSRuleList> for CSSRuleList
impl PartialEq<CSSRuleList> for CSSRuleList
sourcefn eq(&self, other: &CSSRuleList) -> bool
fn eq(&self, other: &CSSRuleList) -> bool
sourceimpl ToJSValConvertible for CSSRuleList
impl ToJSValConvertible for CSSRuleList
sourceunsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)
unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)
Convert
self
to a JSVal
. JSAPI failure causes a panic.Auto Trait Implementations
impl !RefUnwindSafe for CSSRuleList
impl !Send for CSSRuleList
impl !Sync for CSSRuleList
impl Unpin for CSSRuleList
impl !UnwindSafe for CSSRuleList
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> MaybeBoxed<Box<T, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
sourcefn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
Convert
sourceimpl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
sourcefn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert