Skip to content

Commit

Permalink
Auto merge of #20901 - emilio:rm-setpropertyvalue, r=jdm
Browse files Browse the repository at this point in the history
dom: Remove CSSStyleDeclaration.setPropertyValue/setPropertyPriority.

They were removed from the spec, see w3c/csswg-drafts#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 -->
  • Loading branch information
bors-servo committed Jun 2, 2018
2 parents 2434c2b + aea5e14 commit 5683f09
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 97 deletions.
41 changes: 6 additions & 35 deletions components/script/dom/cssstyledeclaration.rs
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 0 additions & 6 deletions components/script/dom/webidls/CSSStyleDeclaration.webidl
Expand Up @@ -19,12 +19,6 @@ interface CSSStyleDeclaration {
[CEReactions, Throws]
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;
Expand Down
7 changes: 0 additions & 7 deletions tests/wpt/metadata/css/cssom/historical.html.ini

This file was deleted.

25 changes: 0 additions & 25 deletions tests/wpt/mozilla/meta/MANIFEST.json
Expand Up @@ -5501,18 +5501,6 @@
{}
]
],
"css/setpropertypriority.html": [
[
"/_mozilla/css/setpropertypriority.html",
[
[
"/_mozilla/css/setpropertypriority_ref.html",
"=="
]
],
{}
]
],
"css/simple_inline_absolute_containing_block_a.html": [
[
"/_mozilla/css/simple_inline_absolute_containing_block_a.html",
Expand Down Expand Up @@ -9651,11 +9639,6 @@
{}
]
],
"css/setpropertypriority_ref.html": [
[
{}
]
],
"css/simple_inline_absolute_containing_block_ref.html": [
[
{}
Expand Down Expand Up @@ -63756,14 +63739,6 @@
"3de96c5c95089cb3c931f0158613ed585438f9ec",
"support"
],
"css/setpropertypriority.html": [
"67d08c6e155403d6452a48ea57680fc242264d15",
"reftest"
],
"css/setpropertypriority_ref.html": [
"c869671f731182ae1e07b9e6e6fc9b76c20a6d31",
"support"
],
"css/simple_inline_absolute_containing_block_a.html": [
"b4343b0b1b4c78ff951156bcc67645cc253bf48c",
"reftest"
Expand Down
20 changes: 0 additions & 20 deletions tests/wpt/mozilla/tests/css/setpropertypriority.html

This file was deleted.

4 changes: 0 additions & 4 deletions tests/wpt/mozilla/tests/css/setpropertypriority_ref.html

This file was deleted.

0 comments on commit 5683f09

Please sign in to comment.