OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <style> | 2 <style> |
3 #flexbox { | 3 #flexbox { |
4 display: flex; | 4 display: flex; |
5 flex-flow: column; | 5 flex-flow: column; |
6 height: 300px; | 6 height: 300px; |
7 width: 200px; | 7 width: 200px; |
8 } | 8 } |
9 #left { | 9 #left { |
10 flex: 1; | 10 flex: 1; |
(...skipping 15 matching lines...) Expand all Loading... |
26 // This test makes sure that we repaint the right region of a flexbox when | 26 // This test makes sure that we repaint the right region of a flexbox when |
27 // changing the flex values. Only the middle of the test page should be | 27 // changing the flex values. Only the middle of the test page should be |
28 // repainted. If the top of the test page (above the flexbox) is repainted, | 28 // repainted. If the top of the test page (above the flexbox) is repainted, |
29 // this test fails. | 29 // this test fails. |
30 function setFlex(value) | 30 function setFlex(value) |
31 { | 31 { |
32 document.getElementById("content").style.flex = value; | 32 document.getElementById("content").style.flex = value; |
33 } | 33 } |
34 | 34 |
35 window.testIsAsync = true; | 35 window.testIsAsync = true; |
36 window.onload = runRepaintTest; | 36 window.onload = runRepaintAndPixelTest; |
37 | 37 |
38 function repaintTest() { | 38 function repaintTest() { |
39 requestAnimationFrame(function() { | 39 requestAnimationFrame(function() { |
40 setFlex(4.6); | 40 setFlex(4.6); |
41 document.getElementById("content").offsetTop; | 41 document.getElementById("content").offsetTop; |
42 requestAnimationFrame(function() { | 42 requestAnimationFrame(function() { |
43 setFlex(5); | 43 setFlex(5); |
44 finishRepaintTest(); | 44 finishRepaintTest(); |
45 }, 1) | 45 }, 1) |
46 }, 1) | 46 }, 1) |
47 }; | 47 }; |
48 </script> | 48 </script> |
49 <div style="height: 60px"></div> | 49 <div style="height: 60px"></div> |
50 <div id="flexbox" dir="rtl"> | 50 <div id="flexbox" dir="rtl"> |
51 <div id="left"></div> | 51 <div id="left"></div> |
52 <div id="content"><div></div></div> | 52 <div id="content"><div></div></div> |
OLD | NEW |