Chromium Code Reviews| 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 requestAnimationFrame(() => { |
| 66 }; | 67 requestAnimationFrame(() => { iframe.contentWindow.postMessage("", "*") }) |
|
ojan
2016/03/08 01:37:11
Why do you need 2 rafs here?
Sami
2016/03/08 17:32:41
Right, this pattern seems to be repeated in a bunc
szager1
2016/03/08 18:51:32
In general, the double-RAF pattern is necessary be
Sami
2016/03/09 18:29:55
I thought IO runs after layout, so the notificatio
szager1
2016/03/09 20:45:25
Actually, my explanation was totally wrong. I add
| |
| 68 }); | |
| 69 } | |
| 67 </script> | 70 </script> |
| OLD | NEW |