mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
dom: don't parse internal properties in CSSStyleDeclaration.
This commit is contained in:
parent
9bb72139e4
commit
274bc4df3e
1 changed files with 13 additions and 21 deletions
|
@ -312,22 +312,18 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
|
||||||
|
|
||||||
// https://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-getpropertyvalue
|
// https://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-getpropertyvalue
|
||||||
fn GetPropertyValue(&self, property: DOMString) -> DOMString {
|
fn GetPropertyValue(&self, property: DOMString) -> DOMString {
|
||||||
let id = if let Ok(id) = PropertyId::parse(&property) {
|
let id = match PropertyId::parse_enabled_for_all_content(&property) {
|
||||||
id
|
Ok(id) => id,
|
||||||
} else {
|
Err(..) => return DOMString::new(),
|
||||||
// Unkwown property
|
|
||||||
return DOMString::new()
|
|
||||||
};
|
};
|
||||||
self.get_property_value(id)
|
self.get_property_value(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-getpropertypriority
|
// https://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-getpropertypriority
|
||||||
fn GetPropertyPriority(&self, property: DOMString) -> DOMString {
|
fn GetPropertyPriority(&self, property: DOMString) -> DOMString {
|
||||||
let id = if let Ok(id) = PropertyId::parse(&property) {
|
let id = match PropertyId::parse_enabled_for_all_content(&property) {
|
||||||
id
|
Ok(id) => id,
|
||||||
} else {
|
Err(..) => return DOMString::new(),
|
||||||
// Unkwown property
|
|
||||||
return DOMString::new()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
self.owner.with_block(|pdb| {
|
self.owner.with_block(|pdb| {
|
||||||
|
@ -347,11 +343,9 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
|
||||||
priority: DOMString)
|
priority: DOMString)
|
||||||
-> ErrorResult {
|
-> ErrorResult {
|
||||||
// Step 3
|
// Step 3
|
||||||
let id = if let Ok(id) = PropertyId::parse(&property) {
|
let id = match PropertyId::parse_enabled_for_all_content(&property) {
|
||||||
id
|
Ok(id) => id,
|
||||||
} else {
|
Err(..) => return Ok(()),
|
||||||
// Unknown property
|
|
||||||
return Ok(())
|
|
||||||
};
|
};
|
||||||
self.set_property(id, value, priority)
|
self.set_property(id, value, priority)
|
||||||
}
|
}
|
||||||
|
@ -364,7 +358,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 2 & 3
|
// Step 2 & 3
|
||||||
let id = match PropertyId::parse(&property) {
|
let id = match PropertyId::parse_enabled_for_all_content(&property) {
|
||||||
Ok(id) => id,
|
Ok(id) => id,
|
||||||
Err(..) => return Ok(()), // Unkwown property
|
Err(..) => return Ok(()), // Unkwown property
|
||||||
};
|
};
|
||||||
|
@ -396,11 +390,9 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
|
||||||
return Err(Error::NoModificationAllowed);
|
return Err(Error::NoModificationAllowed);
|
||||||
}
|
}
|
||||||
|
|
||||||
let id = if let Ok(id) = PropertyId::parse(&property) {
|
let id = match PropertyId::parse_enabled_for_all_content(&property) {
|
||||||
id
|
Ok(id) => id,
|
||||||
} else {
|
Err(..) => return Ok(DOMString::new()),
|
||||||
// Unkwown property, cannot be there to remove.
|
|
||||||
return Ok(DOMString::new())
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut string = String::new();
|
let mut string = String::new();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue