aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/stylesheet.rs
diff options
context:
space:
mode:
authorchansuke <chansuke@georepublic.de>2018-09-18 23:24:15 +0900
committerJosh Matthews <josh@joshmatthews.net>2018-09-19 17:40:47 -0400
commitc37a345dc9f4dda6ea29c42f96f6c7201c42cbac (patch)
tree1f05b49bac02318455a59d5b143c186fd872bdb9 /components/script/dom/stylesheet.rs
parent2ca7a134736bb4759ff209c1bc0b6dc3cc1984c9 (diff)
downloadservo-c37a345dc9f4dda6ea29c42f96f6c7201c42cbac.tar.gz
servo-c37a345dc9f4dda6ea29c42f96f6c7201c42cbac.zip
Format script component
Diffstat (limited to 'components/script/dom/stylesheet.rs')
-rw-r--r--components/script/dom/stylesheet.rs30
1 files changed, 19 insertions, 11 deletions
diff --git a/components/script/dom/stylesheet.rs b/components/script/dom/stylesheet.rs
index d53971cf927..94a26755699 100644
--- a/components/script/dom/stylesheet.rs
+++ b/components/script/dom/stylesheet.rs
@@ -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)
}
}