From 39ce15f20d33cc6c931dadc863fc955f8cb05c36 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Thu, 13 Aug 2015 10:21:28 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20Element::set=5Finline=5Fstyle=5Fproperty?= =?UTF-8?q?=5Fpriority=E2=80=99s=20handling=20of=20priority?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to mwu for pointing out a copy-paste error. --- components/script/dom/element.rs | 2 +- .../mozilla/tests/css/setpropertypriority.html | 17 ++++++++++++++--- .../tests/css/setpropertypriority_ref.html | 3 +++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 4db26945f2e..62ec970c1e2 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -712,7 +712,7 @@ impl<'a> ElementHelpers<'a> for &'a Element { let (from, to) = if style_priority == StylePriority::Important { (&mut declarations.normal, &mut declarations.important) } else { - (&mut declarations.normal, &mut declarations.important) + (&mut declarations.important, &mut declarations.normal) }; // Usually, the reference counts of `from` and `to` will be 1 here. But transitions diff --git a/tests/wpt/mozilla/tests/css/setpropertypriority.html b/tests/wpt/mozilla/tests/css/setpropertypriority.html index 5cbceacef35..50fe54005bd 100644 --- a/tests/wpt/mozilla/tests/css/setpropertypriority.html +++ b/tests/wpt/mozilla/tests/css/setpropertypriority.html @@ -1,9 +1,20 @@ -

This text should be green.

+ +

This text should be green.

+

This text should be green.

+ +

This text should be green.

+

This text should be green.

+ diff --git a/tests/wpt/mozilla/tests/css/setpropertypriority_ref.html b/tests/wpt/mozilla/tests/css/setpropertypriority_ref.html index 97cd81b31bf..c526c2f371b 100644 --- a/tests/wpt/mozilla/tests/css/setpropertypriority_ref.html +++ b/tests/wpt/mozilla/tests/css/setpropertypriority_ref.html @@ -1 +1,4 @@

This text should be green. +

This text should be green. +

This text should be green. +

This text should be green.