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

Side by Side Diff: third_party/WebKit/LayoutTests/resize-observer/resources/iframe.html

Issue 2204503002: ResizeObserver pt6: integration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added test for moving dom inside eventloop Created 4 years, 4 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
OLDNEW
(Empty)
1 <!doctype html>
2 <head>
3 <script src="./resizeTestHelper.js"></script>
4 </head>
5 <p>iframe test</p>
6 <div id="itarget1" style="width:100px;height:100px;">t1</div>
7 <script>
8 'use strict';
9
10 let t1 = document.querySelector('#itarget1');
11
12 function test0() {
13
14 let timeoutId = window.setTimeout( () => {
15 window.parent.postMessage('fail', '*');
16 }, ResizeTestHelper.TIMEOUT);
17
18 let ro = new ResizeObserver(function(entries) {
19 window.clearTimeout(timeoutId);
20 window.parent.postMessage('success', '*');
21 });
22
23 ro.observe(t1);
24 }
25
26 let testStarted = false;
27
28 window.addEventListener('message', function(ev) {
29 switch(ev.data) {
30 case 'startTest':
31 testStarted = true;
32 test0();
33 break;
34 }
35 });
36
37 // How does parent know we've loaded problem is solved by
38 // broadcasting readyToTest message.
39 function broadcastReady() {
40 if (!testStarted) {
41 window.parent.postMessage('readyToTest', '*');
42 window.requestAnimationFrame(broadcastReady);
43 }
44 }
45
46 broadcastReady();
47 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698