diff options
Diffstat (limited to 'components/script/dom/stylesheet.rs')
-rw-r--r-- | components/script/dom/stylesheet.rs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/components/script/dom/stylesheet.rs b/components/script/dom/stylesheet.rs index 7def8f1ba6c..91a6b186f27 100644 --- a/components/script/dom/stylesheet.rs +++ b/components/script/dom/stylesheet.rs @@ -4,12 +4,13 @@ use dom::bindings::codegen::Bindings::StyleSheetBinding; use dom::bindings::codegen::Bindings::StyleSheetBinding::StyleSheetMethods; +use dom::bindings::inheritance::Castable; use dom::bindings::js::Root; use dom::bindings::reflector::{Reflector, reflect_dom_object}; use dom::bindings::str::DOMString; +use dom::cssstylesheet::CSSStyleSheet; use dom::window::Window; - #[dom_struct] pub struct StyleSheet { reflector_: Reflector, @@ -20,12 +21,14 @@ pub struct StyleSheet { impl StyleSheet { #[allow(unrooted_must_root)] - pub fn new_inherited(type_: DOMString, href: Option<DOMString>, title: Option<DOMString>) -> StyleSheet { + pub fn new_inherited(type_: DOMString, + href: Option<DOMString>, + title: Option<DOMString>) -> StyleSheet { StyleSheet { reflector_: Reflector::new(), type_: type_, href: href, - title: title + title: title, } } @@ -55,5 +58,14 @@ impl StyleSheetMethods for StyleSheet { fn GetTitle(&self) -> Option<DOMString> { self.title.clone() } -} + // https://drafts.csswg.org/cssom/#dom-stylesheet-disabled + fn Disabled(&self) -> bool { + self.downcast::<CSSStyleSheet>().unwrap().disabled() + } + + // https://drafts.csswg.org/cssom/#dom-stylesheet-disabled + fn SetDisabled(&self, disabled: bool) { + self.downcast::<CSSStyleSheet>().unwrap().set_disabled(disabled) + } +} |