Suppress CSS parser errors for vendor-prefixed properties.

This commit is contained in:
Josh Matthews 2017-07-14 22:02:34 -04:00
parent 8e14d93602
commit 94d631c1f4
9 changed files with 84 additions and 31 deletions

View file

@ -296,7 +296,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
// https://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-getpropertyvalue
fn GetPropertyValue(&self, property: DOMString) -> DOMString {
let id = if let Ok(id) = PropertyId::parse(property.into()) {
let id = if let Ok(id) = PropertyId::parse(&property) {
id
} else {
// Unkwown property
@ -307,7 +307,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
// https://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-getpropertypriority
fn GetPropertyPriority(&self, property: DOMString) -> DOMString {
let id = if let Ok(id) = PropertyId::parse(property.into()) {
let id = if let Ok(id) = PropertyId::parse(&property) {
id
} else {
// Unkwown property
@ -331,7 +331,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
priority: DOMString)
-> ErrorResult {
// Step 3
let id = if let Ok(id) = PropertyId::parse(property.into()) {
let id = if let Ok(id) = PropertyId::parse(&property) {
id
} else {
// Unknown property
@ -348,7 +348,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
}
// Step 2 & 3
let id = match PropertyId::parse(property.into()) {
let id = match PropertyId::parse(&property) {
Ok(id) => id,
Err(..) => return Ok(()), // Unkwown property
};
@ -380,7 +380,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
return Err(Error::NoModificationAllowed);
}
let id = if let Ok(id) = PropertyId::parse(property.into()) {
let id = if let Ok(id) = PropertyId::parse(&property) {
id
} else {
// Unkwown property, cannot be there to remove.