Format script component

This commit is contained in:
chansuke 2018-09-18 23:24:15 +09:00 committed by Josh Matthews
parent 2ca7a13473
commit c37a345dc9
357 changed files with 25485 additions and 18076 deletions

View file

@ -22,9 +22,11 @@ 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_,
@ -34,16 +36,20 @@ impl StyleSheet {
}
#[allow(unrooted_must_root)]
pub fn new(window: &Window, type_: DOMString,
href: Option<DOMString>,
title: Option<DOMString>) -> DomRoot<StyleSheet> {
reflect_dom_object(Box::new(StyleSheet::new_inherited(type_, href, title)),
window,
StyleSheetBinding::Wrap)
pub fn new(
window: &Window,
type_: DOMString,
href: Option<DOMString>,
title: Option<DOMString>,
) -> DomRoot<StyleSheet> {
reflect_dom_object(
Box::new(StyleSheet::new_inherited(type_, href, title)),
window,
StyleSheetBinding::Wrap,
)
}
}
impl StyleSheetMethods for StyleSheet {
// https://drafts.csswg.org/cssom/#dom-stylesheet-type
fn Type_(&self) -> DOMString {
@ -67,6 +73,8 @@ impl StyleSheetMethods for StyleSheet {
// https://drafts.csswg.org/cssom/#dom-stylesheet-disabled
fn SetDisabled(&self, disabled: bool) {
self.downcast::<CSSStyleSheet>().unwrap().set_disabled(disabled)
self.downcast::<CSSStyleSheet>()
.unwrap()
.set_disabled(disabled)
}
}