OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../resources/run-after-display.js"></script> |
| 3 <script src="../../fast/repaint/resources/text-based-repaint.js"></script> |
2 <style> | 4 <style> |
3 #flexbox { | 5 #flexbox { |
4 display: -webkit-flex; | 6 display: -webkit-flex; |
5 -webkit-flex-flow: column-reverse; | 7 -webkit-flex-flow: column-reverse; |
6 width: 200px; | 8 width: 200px; |
7 } | 9 } |
8 .flex-item { | 10 .flex-item { |
9 height: 30px; | 11 height: 30px; |
10 } | 12 } |
11 </style> | 13 </style> |
12 <script> | 14 <script> |
| 15 function repaintTest() |
| 16 { |
| 17 document.getElementById("blue").style.margin = "1px"; |
| 18 } |
| 19 |
13 function changeChildMargin() | 20 function changeChildMargin() |
14 { | 21 { |
15 document.getElementById("blue").style.margin = "1px"; | 22 runRepaintTest(); |
16 if (window.testRunner) | 23 finishRepaintTest(); |
17 testRunner.notifyDone(); | |
18 } | 24 } |
19 | 25 |
20 window.onload = function() { | 26 window.onload = function() { |
21 if (window.testRunner) { | 27 if (window.testRunner) { |
22 testRunner.dumpAsTextWithPixelResults(); | |
23 testRunner.waitUntilDone(); | 28 testRunner.waitUntilDone(); |
24 testRunner.display(); | |
25 } else { | 29 } else { |
26 document.body.appendChild(document.createTextNode( | 30 document.body.appendChild(document.createTextNode( |
27 "This test checks that for flex items that are moved multiple times
during the layout " | 31 "This test checks that for flex items that are moved multiple times
during the layout " |
28 + "only the initial and final positions are repainted. Only the blue
flex item should be repainted " | 32 + "only the initial and final positions are repainted. Only the blue
flex item should be repainted " |
29 + "after changing its position. If the other flex items are repainte
d, this test fails.")); | 33 + "after changing its position. If the other flex items are repainte
d, this test fails.")); |
30 } | 34 } |
31 setTimeout(changeChildMargin, 0); | 35 window.enablePixelTesting = true; |
| 36 window.testIsAsync = true; |
| 37 runAfterDisplay(changeChildMargin) |
32 }; | 38 }; |
33 </script> | 39 </script> |
34 <div id="flexbox"> | 40 <div id="flexbox"> |
35 <div id="blue" class="flex-item" style="background-color: blue;"></div> | 41 <div id="blue" class="flex-item" style="background-color: blue;"></div> |
36 <div id="green" class="flex-item" style="background-color: green;"></div> | 42 <div id="green" class="flex-item" style="background-color: green;"></div> |
37 <div id="yellow" class="flex-item" style="background-color: yellow;"></div> | 43 <div id="yellow" class="flex-item" style="background-color: yellow;"></div> |
38 </div> | 44 </div> |
OLD | NEW |