aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-09-17 06:50:57 -0600
committerbors-servo <metajack+bors@gmail.com>2015-09-17 06:50:57 -0600
commit1b6d4daf85d672265824a014dba99c94c8c08814 (patch)
tree6aa73602c3f5622f05db26273a1c1feec28d65e4 /components/script/dom
parent6cd098da302db85975d0967ddee836f04eae3bd5 (diff)
parentfeaf6f4c3fbee9cafb3fdf9981c3ab639a56195b (diff)
downloadservo-1b6d4daf85d672265824a014dba99c94c8c08814.tar.gz
servo-1b6d4daf85d672265824a014dba99c94c8c08814.zip
Auto merge of #7555 - SimonSapin:custom-properties++, r=mbrubeck
Custom properties, take 2 Support `var()` in shorthand properties, and fix various bugs. r? @pcwalton <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7555) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/element.rs7
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)