11 background-color: yellow;
16 background-color: grey;
19 <script src=
"../../fast/repaint/resources/text-based-repaint.js"></script>
21 // This test makes sure that we repaint the right region of a flexbox when
22 // changing the flex values. Only the middle of the test page should be
23 // repainted. If the top of the test page (above the flexbox) is repainted,
26 function setFlex(id
, animationPercentage
, start
, end
) {
27 var flexValue
= start
+ ((end
- start
) * animationPercentage
);
28 document
.getElementById(id
).style
.flex
= flexValue
+ " 0 0px";
31 function step(count
) {
32 var animationPercentage
= count
? 1 : .9;
33 setFlex("content", animationPercentage
, 1, 5);
36 // FIXME: we need a better way of waiting for layout/repainting to happen
37 setTimeout(step
.bind(null, 1), 1);
38 } else if (window
.testRunner
) {
43 window
.testIsAsync
= true;
44 window
.onload
= runRepaintTest
;
46 function repaintTest() {
47 window
.startTime
= Date
.now();
48 // FIXME: we need a better way of waiting for layout/repainting to happen
49 setTimeout(step
.bind(null, 0), 1);
54 <br><br><br><br><br><br>
58 <p style=
"margin: 0">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean laoreet dolor id urna eleifend aliquet. Nulla vel dolor ipsum. Aliquam ut turpis nisl, in vulputate sapien. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed congue magna vitae dolor feugiat vehicula. Sed volutpat, tellus vel varius vestibulum, purus quam mollis sapien, in condimentum leo neque sed nulla. Nunc quis porta elit. Pellentesque erat lectus, ultricies a lobortis id, faucibus id quam.
</p>