OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <style> | 2 <style> |
3 #flexbox { | 3 #flexbox { |
4 display: -webkit-flex; | 4 display: -webkit-flex; |
5 -webkit-flex-flow: column; | 5 -webkit-flex-flow: column; |
6 height: 300px; | 6 height: 300px; |
7 width: 200px; | 7 width: 200px; |
8 } | 8 } |
9 #left { | 9 #left { |
10 -webkit-flex: 1; | 10 -webkit-flex: 1; |
11 background-color: yellow; | 11 background-color: yellow; |
12 min-height: 0; | 12 min-height: 0; |
13 } | 13 } |
14 #content { | 14 #content { |
15 -webkit-flex: 1; | 15 -webkit-flex: 1; |
16 border: 5px solid blue; | 16 border: 5px solid blue; |
17 min-height: 0; | 17 min-height: 0; |
18 } | 18 } |
19 #content > div { | 19 #content > div { |
20 height: 350px; | 20 height: 350px; |
21 background-color: orange; | 21 background-color: orange; |
22 } | 22 } |
23 </style> | 23 </style> |
24 <script src="../../fast/repaint/resources/text-based-repaint.js"></script> | |
25 <script> | 24 <script> |
26 window.onload = runRepaintTest; | |
27 window.testIsAsync = true; | |
28 | |
29 // This test makes sure that we repaint the right region of a flexbox when | 25 // This test makes sure that we repaint the right region of a flexbox when |
30 // changing the flex values. Only the middle of the test page should be | 26 // changing the flex values. Only the middle of the test page should be |
31 // repainted. If the top of the test page (above the flexbox) is repainted, | 27 // repainted. If the top of the test page (above the flexbox) is repainted, |
32 // this test fails. | 28 // this test fails. |
33 function setFlex(value) | 29 function setFlex(value) |
34 { | 30 { |
35 document.getElementById("content").style.webkitFlex = value; | 31 document.getElementById("content").style.webkitFlex = value; |
36 } | 32 } |
37 | 33 |
38 function repaintTest() { | 34 window.onload = function() { |
| 35 if (window.testRunner) { |
| 36 testRunner.dumpAsText(); |
| 37 document.body.offsetTop; |
| 38 window.internals.startTrackingRepaints(document); |
| 39 testRunner.waitUntilDone(); |
| 40 } |
39 setTimeout(function() { | 41 setTimeout(function() { |
40 setFlex(4.6); | 42 setFlex(4.6); |
41 setTimeout(function() { | 43 setTimeout(function() { |
42 setFlex(5); | 44 setFlex(5); |
43 finishRepaintTest(); | 45 if (window.testRunner) { |
44 }, 0); | 46 document.body.offsetTop; |
45 }, 0); | 47 var repaintRects = window.internals.repaintRectsAsText(document)
; |
46 } | 48 window.internals.stopTrackingRepaints(document); |
| 49 var pre = document.createElement('pre'); |
| 50 document.body.appendChild(pre); |
| 51 pre.textContent += repaintRects; |
| 52 |
| 53 testRunner.notifyDone(); |
| 54 } |
| 55 }) |
| 56 }) |
| 57 }; |
47 </script> | 58 </script> |
48 <div style="height: 60px"></div> | 59 <div style="height: 60px"></div> |
49 <div id="flexbox" dir="rtl"> | 60 <div id="flexbox" dir="rtl"> |
50 <div id="left"></div> | 61 <div id="left"></div> |
51 <div id="content"><div></div></div> | 62 <div id="content"><div></div></div> |
OLD | NEW |