Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
|
dominicc (has gone to gerrit)
2016/12/05 03:30:55
Let's use testharness.js for new layout tests!
engedy
2016/12/06 15:27:57
Done.
| |
| 2 <iframe src="about:blank" id="nested"></iframe> | |
| 3 <script type="text/javascript"> | |
| 4 if (window.testRunner) | |
| 5 testRunner.waitUntilDone(); | |
| 6 | |
| 7 // Fallback content is implemented by means of shadow DOM, with a dumbed-down | |
|
dominicc (has gone to gerrit)
2016/12/05 03:30:55
Nice comment explaining the intent of the test and
engedy
2016/12/06 15:27:57
Thanks!
By the way, are tests in these folder Bli
| |
| 8 // HTMLImageElement instance used to render the broken image icon inside. | |
| 9 // | |
| 10 // When such an <img> element is moved to a new document after the shadow tree | |
| 11 // is created, care must be taken that there is no attempt to reload the broken | |
| 12 // image icon inside, fail, and end up with infinitely nested fallback content. | |
|
dominicc (has gone to gerrit)
2016/12/05 03:30:55
I'm curious--how would loading the broken image ic
engedy
2016/12/06 15:27:57
Done, I have extended the explanation.
| |
| 13 let nestedDocument = document.getElementById("nested").contentDocument; | |
| 14 let i = nestedDocument.createElement("img"); | |
| 15 i.onerror = function() { | |
| 16 i.onerror = function() { | |
| 17 if (window.testRunner) | |
| 18 testRunner.notifyDone(); | |
| 19 }; | |
| 20 document.body.appendChild(nestedDocument.body.removeChild(i)); | |
|
dominicc (has gone to gerrit)
2016/12/05 03:30:55
Removes happen implicitly as part of apppend, appe
engedy
2016/12/06 15:27:57
Done.
| |
| 21 }; | |
| 22 i.src = "non-existent.png"; | |
| 23 nestedDocument.body.appendChild(i); | |
| 24 </script> | |
| OLD | NEW |