OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="/js-test-resources/js-test.js"></script> | 2 <script src="/js-test-resources/js-test.js"></script> |
3 <div style="width:100%; height:700px;"></div> | 3 <div style="width:100%; height:700px;"></div> |
4 <iframe id="target-iframe" src="http://localhost:8080/intersection-observer/reso
urces/cross-origin-subframe.html" style="height: 100px; overflow-y: scroll"></if
rame> | 4 <iframe id="target-iframe" src="http://localhost:8080/intersection-observer/reso
urces/cross-origin-subframe.html" style="height: 100px; overflow-y: scroll"></if
rame> |
5 <div style="width:100%; height:700px;"></div> | 5 <div style="width:100%; height:700px;"></div> |
6 | 6 |
7 <script> | 7 <script> |
8 setPrintTestResultsLazily(); | 8 setPrintTestResultsLazily(); |
9 self.jsTestIsAsync = true; | 9 self.jsTestIsAsync = true; |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 checkData(event.data.actual, event.data.expected); | 54 checkData(event.data.actual, event.data.expected); |
55 } else if (event.data.hasOwnProperty('DONE')) { | 55 } else if (event.data.hasOwnProperty('DONE')) { |
56 finishJSTest(); | 56 finishJSTest(); |
57 document.scrollingElement.scrollTop = 0; | 57 document.scrollingElement.scrollTop = 0; |
58 } else { | 58 } else { |
59 requestAnimationFrame(function () { iframe.contentWindow.postMessage("", "*"
) }); | 59 requestAnimationFrame(function () { iframe.contentWindow.postMessage("", "*"
) }); |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 window.addEventListener("message", handleMessage); | 63 window.addEventListener("message", handleMessage); |
| 64 |
64 iframe.onload = function() { | 65 iframe.onload = function() { |
65 iframe.contentWindow.postMessage("", "*") | 66 // See LayoutTests/intersection-observer/README for explanation of double RAF. |
66 }; | 67 requestAnimationFrame(() => { |
| 68 requestAnimationFrame(() => { iframe.contentWindow.postMessage("", "*") }) |
| 69 }); |
| 70 } |
67 </script> | 71 </script> |
OLD | NEW |