| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <link rel="stylesheet" href="resources/flexbox.css"> | 4 <link rel="stylesheet" href="resources/flexbox.css"> |
| 5 <script src="../../resources/run-after-display.js"></script> |
| 6 <script src="../../fast/repaint/resources/text-based-repaint.js"></script> |
| 5 <style> | 7 <style> |
| 6 body { | 8 body { |
| 7 margin: 0; | 9 margin: 0; |
| 8 } | 10 } |
| 9 .flexbox { | 11 .flexbox { |
| 10 background: #333; | 12 background: #333; |
| 11 } | 13 } |
| 12 .flex-item { | 14 .flex-item { |
| 13 height: 50px; | 15 height: 50px; |
| 14 margin: 20px; | 16 margin: 20px; |
| 15 background: #eee; | 17 background: #eee; |
| 16 width: 10px; | 18 width: 10px; |
| 17 } | 19 } |
| 18 | 20 |
| 19 .width { | 21 .width { |
| 20 width:50px; | 22 width:50px; |
| 21 } | 23 } |
| 22 </style> | 24 </style> |
| 23 </head> | 25 </head> |
| 24 <body> | 26 <body> |
| 25 <div class="flexbox"> | 27 <div class="flexbox"> |
| 26 <div id="flex-item-1" class="flex-item"></div> | 28 <div id="flex-item-1" class="flex-item"></div> |
| 27 <div class="flex-item"></div> | 29 <div class="flex-item"></div> |
| 28 <div class="flex-item"></div> | 30 <div class="flex-item"></div> |
| 29 </div> | 31 </div> |
| 30 <script> | 32 <script> |
| 31 function resizeFlexItem() { | 33 function repaintTest() { |
| 32 var div = document.getElementById("flex-item-1"); | 34 var div = document.getElementById("flex-item-1"); |
| 33 div.classList.add("width"); | 35 div.classList.add("width"); |
| 34 if (window.testRunner) | 36 } |
| 35 testRunner.notifyDone(); | 37 function resizeFlexItem() { |
| 38 runRepaintTest(); |
| 39 finishRepaintTest(); |
| 36 }; | 40 }; |
| 37 window.onload = function() { | 41 window.onload = function() { |
| 38 if (window.testRunner) { | 42 if (window.testRunner) { |
| 39 testRunner.waitUntilDone(); | 43 testRunner.waitUntilDone(); |
| 40 testRunner.display(); | |
| 41 } else { | 44 } else { |
| 42 document.body.appendChild(document.createTextNode( | 45 document.body.appendChild(document.createTextNode( |
| 43 "Tests to make sure that when changing the size of one flex item cha
nges the " | 46 "Tests to make sure that when changing the size of one flex item cha
nges the " |
| 44 + "location of another flex item, we properly repaint. The repaint r
ect should " | 47 + "location of another flex item, we properly repaint. The repaint r
ect should " |
| 45 + "include the three flex items.")); | 48 + "include the three flex items.")); |
| 46 } | 49 } |
| 47 setTimeout(resizeFlexItem, 0); | 50 window.enablePixelTesting = true; |
| 51 window.testIsAsync = true; |
| 52 runAfterDisplay(resizeFlexItem) |
| 48 }; | 53 }; |
| 49 </script> | 54 </script> |
| 50 </body></html> | 55 </body></html> |
| OLD | NEW |