mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implement StyleSheet.disabled.
This commit is contained in:
parent
4529435f96
commit
64ff6dc103
10 changed files with 62 additions and 16 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue