diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-06-02 11:24:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-02 11:24:57 -0400 |
commit | 5683f09a0b4ed1ca6a5f2075060b36b3ccc0ca36 (patch) | |
tree | 75ad21a8c4d1232706e49feca909fbae470ebbac /components/script | |
parent | 2434c2bef1aa6f37cb95e19e2008e1240f37cd76 (diff) | |
parent | aea5e146fe8c6c948264bf381ef53a8ee5f2ed11 (diff) | |
download | servo-5683f09a0b4ed1ca6a5f2075060b36b3ccc0ca36.tar.gz servo-5683f09a0b4ed1ca6a5f2075060b36b3ccc0ca36.zip |
Auto merge of #20901 - emilio:rm-setpropertyvalue, r=jdm
dom: Remove CSSStyleDeclaration.setPropertyValue/setPropertyPriority.
They were removed from the spec, see https://github.com/w3c/csswg-drafts/issues/2680, and setPropertyValue was wrongly implemented anyway.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20901)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/cssstyledeclaration.rs | 41 | ||||
-rw-r--r-- | components/script/dom/webidls/CSSStyleDeclaration.webidl | 6 |
2 files changed, 6 insertions, 41 deletions
diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs index e63d5833909..43eac985c5e 100644 --- a/components/script/dom/cssstyledeclaration.rs +++ b/components/script/dom/cssstyledeclaration.rs @@ -350,39 +350,6 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration { self.set_property(id, value, priority) } - // https://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-setpropertypriority - fn SetPropertyPriority(&self, property: DOMString, priority: DOMString) -> ErrorResult { - // Step 1 - if self.readonly { - return Err(Error::NoModificationAllowed); - } - - // Step 2 & 3 - let id = match PropertyId::parse_enabled_for_all_content(&property) { - Ok(id) => id, - Err(..) => return Ok(()), // Unkwown property - }; - - // Step 4 - let importance = match &*priority { - "" => Importance::Normal, - p if p.eq_ignore_ascii_case("important") => Importance::Important, - _ => return Ok(()), - }; - - self.owner.mutate_associated_block(|pdb, changed| { - // Step 5 & 6 - *changed = pdb.set_importance(&id, importance); - }); - - Ok(()) - } - - // https://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-setpropertyvalue - fn SetPropertyValue(&self, property: DOMString, value: DOMString) -> ErrorResult { - self.SetProperty(property, value, DOMString::new()) - } - // https://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-removeproperty fn RemoveProperty(&self, property: DOMString) -> Fallible<DOMString> { // Step 1 @@ -407,12 +374,16 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration { // https://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-cssfloat fn CssFloat(&self) -> DOMString { - self.GetPropertyValue(DOMString::from("float")) + self.get_property_value(PropertyId::Longhand(LonghandId::Float)) } // https://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-cssfloat fn SetCssFloat(&self, value: DOMString) -> ErrorResult { - self.SetPropertyValue(DOMString::from("float"), value) + self.set_property( + PropertyId::Longhand(LonghandId::Float), + value, + DOMString::new(), + ) } // https://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface diff --git a/components/script/dom/webidls/CSSStyleDeclaration.webidl b/components/script/dom/webidls/CSSStyleDeclaration.webidl index 760f3461f0a..49377cd1044 100644 --- a/components/script/dom/webidls/CSSStyleDeclaration.webidl +++ b/components/script/dom/webidls/CSSStyleDeclaration.webidl @@ -20,12 +20,6 @@ interface CSSStyleDeclaration { void setProperty(DOMString property, [TreatNullAs=EmptyString] DOMString value, [TreatNullAs=EmptyString] optional DOMString priority = ""); [CEReactions, Throws] - void setPropertyValue(DOMString property, [TreatNullAs=EmptyString] DOMString value); - - [CEReactions, Throws] - void setPropertyPriority(DOMString property, [TreatNullAs=EmptyString] DOMString priority); - - [CEReactions, Throws] DOMString removeProperty(DOMString property); // readonly attribute CSSRule? parentRule; [CEReactions, SetterThrows] |