Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dom: Remove CSSStyleDeclaration.setPropertyValue/setPropertyPriority. #20901

Merged
merged 1 commit into from Jun 2, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

dom: Remove CSSStyleDeclaration.setPropertyValue/setPropertyPriority.

  • Loading branch information
emilio committed Jun 2, 2018
commit aea5e146fe8c6c948264bf381ef53a8ee5f2ed11
@@ -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
@@ -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;

This file was deleted.

@@ -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",
@@ -9651,11 +9639,6 @@
{}
]
],
"css/setpropertypriority_ref.html": [
[
{}
]
],
"css/simple_inline_absolute_containing_block_ref.html": [
[
{}
@@ -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"

This file was deleted.

This file was deleted.

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.