mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #7188 - servo:set_inline_style_property_priority, r=nox
Fix Element::set_inline_style_property_priority’s handling of priority Thanks to @michaelwu for pointing out a copy-paste error. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7188) <!-- Reviewable:end -->
This commit is contained in:
commit
31413f4313
3 changed files with 18 additions and 4 deletions
|
@ -713,7 +713,7 @@ impl<'a> ElementHelpers<'a> for &'a Element {
|
||||||
let (from, to) = if style_priority == StylePriority::Important {
|
let (from, to) = if style_priority == StylePriority::Important {
|
||||||
(&mut declarations.normal, &mut declarations.important)
|
(&mut declarations.normal, &mut declarations.important)
|
||||||
} else {
|
} 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
|
// Usually, the reference counts of `from` and `to` will be 1 here. But transitions
|
||||||
|
|
|
@ -1,9 +1,20 @@
|
||||||
<link rel=match href=setpropertypriority_ref.html>
|
<link rel=match href=setpropertypriority_ref.html>
|
||||||
<body>
|
<body>
|
||||||
<p id="hello" style="color: green">This text should be green.</p>
|
|
||||||
|
<p id="control_1" style="color: red">This text should be green.</p>
|
||||||
|
<p id="test_1" style="color: green">This text should be green.</p>
|
||||||
|
|
||||||
|
<p id="control_2" style="color: green !important">This text should be green.</p>
|
||||||
|
<p id="test_2" style="color: red !important">This text should be green.</p>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
#hello { color: red !important }
|
#control_1 { color: green !important }
|
||||||
|
#test_1 { color: red !important }
|
||||||
|
|
||||||
|
#control_2 { color: red !important }
|
||||||
|
#test_2 { color: green !important }
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
document.getElementById("hello").style.setPropertyPriority("color", "important");
|
document.getElementById("test_1").style.setPropertyPriority("color", "important");
|
||||||
|
document.getElementById("test_2").style.setPropertyPriority("color", "");
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1 +1,4 @@
|
||||||
<p style="color: green">This text should be green.
|
<p style="color: green">This text should be green.
|
||||||
|
<p style="color: green">This text should be green.
|
||||||
|
<p style="color: green">This text should be green.
|
||||||
|
<p style="color: green">This text should be green.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue