Add a pref checking mechanism for alias properties

This commit is contained in:
Nazım Can Altınova 2017-08-16 12:58:40 -07:00
parent 4d10d39e8f
commit 6893446b71
9 changed files with 161 additions and 44 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) {
let id = if let Ok(id) = PropertyId::parse(&property, None) {
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) {
let id = if let Ok(id) = PropertyId::parse(&property, None) {
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) {
let id = if let Ok(id) = PropertyId::parse(&property, None) {
id
} else {
// Unknown property
@ -348,7 +348,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
}
// Step 2 & 3
let id = match PropertyId::parse(&property) {
let id = match PropertyId::parse(&property, None) {
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) {
let id = if let Ok(id) = PropertyId::parse(&property, None) {
id
} else {
// Unkwown property, cannot be there to remove.