diff options
Diffstat (limited to 'components/script')
-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) |