OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../../resources/testharness.js"></script> |
| 5 <script src="../../../resources/testharnessreport.js"></script> |
| 6 <link rel=import id=redImport href="./resources/style-red.html"> |
| 7 <link rel=import id=blueImport href="./resources/style-blue.html"> |
| 8 </head> |
| 9 <body> |
| 10 <h1 class="target">Should be red</h1> |
| 11 <script> |
| 12 var t = async_test('Styles are re-applied in correct ordder after removed import
s are re-added in new place'); |
| 13 window.onload = function() { |
| 14 t.step(function() { |
| 15 assert_equals(window.getComputedStyle(document.querySelector('.target'))
.color, 'rgb(0, 0, 255)'); |
| 16 var importLink = document.querySelector('#blueImport'); |
| 17 document.head.removeChild(importLink); |
| 18 document.head.insertBefore(importLink, document.head.lastElementChild); |
| 19 assert_equals(window.getComputedStyle(document.querySelector('.target'))
.color, 'rgb(255, 0, 0)'); |
| 20 Array.prototype.forEach.call(document.querySelectorAll("h1"), function(e
) { e.style.display = "none"; }); |
| 21 t.done(); |
| 22 }); |
| 23 } |
| 24 </script> |
| 25 </body> |
| 26 </html> |
OLD | NEW |