diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2015-09-11 17:44:53 +0200 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2015-09-17 14:48:56 +0200 |
commit | feaf6f4c3fbee9cafb3fdf9981c3ab639a56195b (patch) | |
tree | 6aa73602c3f5622f05db26273a1c1feec28d65e4 /components/script/dom/element.rs | |
parent | d56ea10770f853fcb610e2ccc1f65049a3015f93 (diff) | |
download | servo-feaf6f4c3fbee9cafb3fdf9981c3ab639a56195b.tar.gz servo-feaf6f4c3fbee9cafb3fdf9981c3ab639a56195b.zip |
Initial support for custom properties in CSSStyleDeclaration
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r-- | components/script/dom/element.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 337f7799138..2cd65557bee 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -650,7 +650,7 @@ impl Element { if let &mut Some(ref mut declarations) = &mut *inline_declarations { let index = declarations.normal .iter() - .position(|decl| decl.name() == property); + .position(|decl| decl.matches(property)); if let Some(index) = index { Arc::make_mut(&mut declarations.normal).remove(index); return; @@ -658,7 +658,7 @@ impl Element { let index = declarations.important .iter() - .position(|decl| decl.name() == property); + .position(|decl| decl.matches(property)); if let Some(index) = index { Arc::make_mut(&mut declarations.important).remove(index); return; @@ -715,7 +715,8 @@ impl Element { let to = Arc::make_mut(to); let mut new_from = Vec::new(); for declaration in from.drain(..) { - if properties.contains(&declaration.name()) { + let name = declaration.name(); + if properties.iter().any(|p| name == **p) { to.push(declaration) } else { new_from.push(declaration) |