Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: LayoutTests/fast/html/imports/import-readd-dup-order.html

Issue 331763002: HTML Imports: styles in removed imports should be applied when it comes back (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 <link rel=import id=redImportDup href="./resources/style-red.html">
9 </head>
10 <body>
11 <h1 class="target">Should be red</h1>
12 <h1 class="another-red-target">Should be red</h1>
13 <script>
14 var t = async_test('Styles are re-applied in correct ordder after removed import s are re-added in new place');
15 window.onload = function() {
16 t.step(function() {
17 var firstLink = document.querySelector('#redImport')
18 var dupLink = document.querySelector('#redImportDup');
19 document.head.removeChild(dupLink);
20 assert_equals(window.getComputedStyle(document.querySelector('.target')) .color, 'rgb(0, 0, 255)', 'Removal reveals shadowed style.');
21 assert_equals(window.getComputedStyle(document.querySelector('.another-r ed-target')).color, 'rgb(255, 0, 0)', 'But sheet is still there.');
22
23 document.head.removeChild(firstLink);
24 document.head.appendChild(dupLink);
25 assert_equals(window.getComputedStyle(document.querySelector('.target')) .color, 'rgb(255, 0, 0)', 'Used-to-be-a-dup sheet is applied now.');
26 assert_equals(window.getComputedStyle(document.querySelector('.another-r ed-target')).color, 'rgb(255, 0, 0)', 'That means this should be applied as well .');
27
28 Array.prototype.forEach.call(document.querySelectorAll("h1"), function(e ) { e.style.display = "none"; });
29 t.done();
30 });
31 }
32 </script>
33 </body>
34 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698