OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script src="../../resources/js-test.js"></script> | |
5 <script src="resources/autosizingTest.js"></script> | |
6 <style> | |
7 #autosize { | |
8 font-size: 10px; | |
9 } | |
10 </style> | |
11 </head> | |
12 <body> | |
13 <div id="autosize"> | |
14 This test verifies that a style recalc on a block with an autosizing multipl
ier does not | |
15 cause an unnecessary relayout. | |
16 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tem
por incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis n
ostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Dui
s aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fug
iat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culp
a qui officia deserunt mollit anim id est laborum. | |
17 </div> | |
18 <script> | |
19 // Force style recalc and layout. | |
20 document.body.offsetTop; | |
21 | |
22 if (window.internals) | |
23 shouldBe("window.internals.needsLayoutCount()", "0", true); | |
24 | |
25 // Should cause a repaint but no layout. | |
26 document.querySelector('#autosize').style.color = 'green'; | |
27 | |
28 if (window.internals) { | |
29 shouldBe("window.internals.updateStyleAndReturnAffectedElementCount()",
"1", true); | |
30 shouldBe("window.internals.needsLayoutCount()", "0", true); | |
31 } | |
32 </script> | |
33 </body> | |
34 </html> | |
OLD | NEW |