mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Add a pref checking mechanism for alias properties
This commit is contained in:
parent
4d10d39e8f
commit
6893446b71
9 changed files with 161 additions and 44 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue