diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-08-23 17:39:12 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-08-23 17:39:12 -0600 |
commit | f63d35662e03ce6fe9097833fa90d0e97aec16ec (patch) | |
tree | 04c1b3a7e49f057cdbcc042c89585c10e85e4a51 | |
parent | 46069561208f96e7be1fc55c4256863b853c843b (diff) | |
parent | 1829c72061999b4b7373298526e9080d35030059 (diff) | |
download | servo-f63d35662e03ce6fe9097833fa90d0e97aec16ec.tar.gz servo-f63d35662e03ce6fe9097833fa90d0e97aec16ec.zip |
Auto merge of #7330 - jxs:master, r=nox
remove PrivateCSSStyleDeclarationHelpers trait from Element,
call get_inline_style_declaration and
get_important_inline_style_declaration inline
closes #7319
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7330)
<!-- Reviewable:end -->
-rw-r--r-- | components/script/dom/cssstyledeclaration.rs | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs index cb59a097b85..5e2b82c186d 100644 --- a/components/script/dom/cssstyledeclaration.rs +++ b/components/script/dom/cssstyledeclaration.rs @@ -78,23 +78,6 @@ impl CSSStyleDeclaration { } } -trait PrivateCSSStyleDeclarationHelpers { - fn get_declaration(&self, property: &Atom) -> Option<Ref<PropertyDeclaration>>; - fn get_important_declaration(&self, property: &Atom) -> Option<Ref<PropertyDeclaration>>; -} - -impl PrivateCSSStyleDeclarationHelpers for Element { - fn get_declaration(&self, property: &Atom) -> Option<Ref<PropertyDeclaration>> { - let element = ElementCast::from_ref(self); - element.get_inline_style_declaration(property) - } - - fn get_important_declaration(&self, property: &Atom) -> Option<Ref<PropertyDeclaration>> { - let element = ElementCast::from_ref(self); - element.get_important_inline_style_declaration(property) - } -} - impl CSSStyleDeclaration { fn get_computed_style(&self, property: &Atom) -> Option<DOMString> { let owner = self.owner.root(); @@ -163,7 +146,7 @@ impl<'a> CSSStyleDeclarationMethods for &'a CSSStyleDeclaration { // Step 2.2 for longhand in &*longhand_properties { // Step 2.2.1 - let declaration = owner.get_declaration(&Atom::from_slice(&longhand)); + let declaration = owner.get_inline_style_declaration(&Atom::from_slice(&longhand)); // Step 2.2.2 & 2.2.3 match declaration { @@ -178,7 +161,7 @@ impl<'a> CSSStyleDeclarationMethods for &'a CSSStyleDeclaration { // Step 3 & 4 // FIXME: redundant let binding https://github.com/rust-lang/rust/issues/22252 - let result = match owner.get_declaration(&property) { + let result = match owner.get_inline_style_declaration(&property) { Some(declaration) => declaration.value(), None => "".to_owned(), }; @@ -204,7 +187,7 @@ impl<'a> CSSStyleDeclarationMethods for &'a CSSStyleDeclaration { } else { // FIXME: extra let binding https://github.com/rust-lang/rust/issues/22323 let owner = self.owner.root(); - if owner.get_important_declaration(&property).is_some() { + if owner.get_important_inline_style_declaration(&property).is_some() { return "important".to_owned(); } } |