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

Side by Side Diff: LayoutTests/fast/html/imports/import-element-removed-flag.html

Issue 279463002: HTML Imports: Fix yet another FOUC (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <script src="../../../resources/js-test.js"></script> 3 <script src="../../../resources/js-test.js"></script>
4 <head> 4 <head>
5 <link id="staticImportLink" rel="import" href="resources/hello.html"> 5 <link id="staticImportLink" rel="import" href="resources/hello.html">
6 </head> 6 </head>
7 <body> 7 <body>
8 <script> 8 <script>
9 description("This tests 'element removed flag' behavior defined in https://dvcs. w3.org/hg/webcomponents/raw-file/tip/spec/imports/index.html#dfn-element-removed -flag."); 9 description("This tests 'element removed flag' behavior defined in https://dvcs. w3.org/hg/webcomponents/raw-file/tip/spec/imports/index.html#dfn-element-removed -flag.");
10 window.jsTestIsAsync = true; 10 window.jsTestIsAsync = true;
(...skipping 22 matching lines...) Expand all
33 shouldBeNull("dynamicImport.import"); 33 shouldBeNull("dynamicImport.import");
34 document.head.appendChild(dynamicImport); 34 document.head.appendChild(dynamicImport);
35 shouldBeNonNull("dynamicImport.import"); 35 shouldBeNonNull("dynamicImport.import");
36 36
37 testDynamicImportRemovingEagerly(); 37 testDynamicImportRemovingEagerly();
38 }; 38 };
39 39
40 dynamicImport = document.createElement("link"); 40 dynamicImport = document.createElement("link");
41 dynamicImport.setAttribute("rel", "import"); 41 dynamicImport.setAttribute("rel", "import");
42 dynamicImport.setAttribute("href", "resources/bye.html"); 42 dynamicImport.setAttribute("href", "resources/bye.html");
43 dynamicImport.addEventListener("load", check);
44 document.head.appendChild(dynamicImport); 43 document.head.appendChild(dynamicImport);
45 } 44 }
46 45
47 function testDynamicImportRemovingEagerly() 46 function testDynamicImportRemovingEagerly()
48 { 47 {
49 dynamicImportEager = document.createElement("link"); 48 dynamicImportEager = document.createElement("link");
50 dynamicImportEager.setAttribute("rel", "import"); 49 dynamicImportEager.setAttribute("rel", "import");
51 dynamicImportEager.setAttribute("href", "resources/setting-greet-var.html"); 50 dynamicImportEager.setAttribute("href", "resources/setting-greet-var.html");
52 dynamicImportEager.addEventListener("load", check);
53 document.head.appendChild(dynamicImportEager); 51 document.head.appendChild(dynamicImportEager);
54 52
55 // Reoving <link> just after appending it. 53 // Reoving <link> just after appending it.
56 // This should start import loading, but shouldn't make .import visible. 54 // This should start import loading, but shouldn't make .import visible.
57 dynamicImportEager.remove(); 55 dynamicImportEager.remove();
58 56
59 function check() 57 function check()
60 { 58 {
61 if (window.greet != "Hello") { 59 if (window.greet != "Hello") {
62 window.setTimeout(check, 0); 60 window.setTimeout(check, 0);
63 return; 61 return;
64 } 62 }
65 63
66 shouldBeNull("dynamicImportEager.import"); 64 shouldBeNull("dynamicImportEager.import");
67 document.head.appendChild(dynamicImportEager); 65 document.head.appendChild(dynamicImportEager);
68 shouldBeNonNull("dynamicImportEager.import"); 66 shouldBeNonNull("dynamicImportEager.import");
69 67
70 window.requestAnimationFrame(function() { finishJSTest(); }, 0); 68 window.requestAnimationFrame(function() { finishJSTest(); }, 0);
71 } 69 }
72 70
73 window.setTimeout(check, 0); 71 window.setTimeout(check, 0);
74 } 72 }
75 73
76 testStaticImport(); 74 testStaticImport();
77 testDynamicImport(); 75 testDynamicImport();
78 76
79 </script> 77 </script>
80 </body> 78 </body>
81 </html> 79 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698