| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <style> | 2 <style> |
| 3 body { | 3 body { |
| 4 margin: 0; | 4 margin: 0; |
| 5 padding: 0; | 5 padding: 0; |
| 6 } | 6 } |
| 7 | 7 |
| 8 #nonFastRegion { | 8 #nonFastRegion { |
| 9 height: 222px; | 9 height: 222px; |
| 10 width: 222px; | 10 width: 222px; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 runAfterLayoutAndPaint(runTests); | 40 runAfterLayoutAndPaint(runTests); |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 function runTests() { | 43 function runTests() { |
| 44 nonFastScrollableRects = internals.nonFastScrollableRects(document); | 44 nonFastScrollableRects = internals.nonFastScrollableRects(document); |
| 45 shouldBe('nonFastScrollableRects.length', '1'); | 45 shouldBe('nonFastScrollableRects.length', '1'); |
| 46 shouldBeEqualToString('rectToString(nonFastScrollableRects[0])', '[0, 0, 222
, 222]'); | 46 shouldBeEqualToString('rectToString(nonFastScrollableRects[0])', '[0, 0, 222
, 222]'); |
| 47 | 47 |
| 48 document.body.style.padding = "10px"; | 48 document.body.style.padding = "10px"; |
| 49 debug("Trigger style update"); | 49 debug("Trigger style update"); |
| 50 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); | 50 shouldBe("internals.updateStyleAndLayoutAndReturnAffectedElementCount()", "2
"); |
| 51 debug("Verifying layout hasn't been triggered"); | 51 debug("Verifying layout hasn't been triggered"); |
| 52 shouldBe("internals.needsLayoutCount()", "3"); | 52 shouldBe("internals.needsLayoutCount()", "3"); |
| 53 | 53 |
| 54 // Updating transforms hits an optimized layout path which is root cause of | 54 // Updating transforms hits an optimized layout path which is root cause of |
| 55 // http://crbug.com/417345 | 55 // http://crbug.com/417345 |
| 56 debug("Update non-fast element's transform"); | 56 debug("Update non-fast element's transform"); |
| 57 document.getElementById('nonFastRegion').style.webkitTransform = 'translateX
(100px)'; | 57 document.getElementById('nonFastRegion').style.webkitTransform = 'translateX
(100px)'; |
| 58 | 58 |
| 59 debug("Trigger style update"); | 59 debug("Trigger style update"); |
| 60 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); | 60 shouldBe("internals.updateStyleAndLayoutAndReturnAffectedElementCount()", "1
"); |
| 61 debug("Verifying layout still hasn't been triggered"); | 61 debug("Verifying layout still hasn't been triggered"); |
| 62 shouldBe("internals.needsLayoutCount()", "3"); | 62 shouldBe("internals.needsLayoutCount()", "3"); |
| 63 debug("Verifying non-fast regions have been updated"); | 63 debug("Verifying non-fast regions have been updated"); |
| 64 nonFastScrollableRects = internals.nonFastScrollableRects(document); | 64 nonFastScrollableRects = internals.nonFastScrollableRects(document); |
| 65 shouldBe('nonFastScrollableRects.length', '1'); | 65 shouldBe('nonFastScrollableRects.length', '1'); |
| 66 shouldBeEqualToString('rectToString(nonFastScrollableRects[0])', '[100, 0, 2
22, 222]'); | 66 shouldBeEqualToString('rectToString(nonFastScrollableRects[0])', '[100, 0, 2
22, 222]'); |
| 67 | 67 |
| 68 setTimeout(function() { | 68 setTimeout(function() { |
| 69 // Add green overlays to help visualize the test | 69 // Add green overlays to help visualize the test |
| 70 drawNonFastScrollableRegionOverlays(); | 70 drawNonFastScrollableRegionOverlays(); |
| 71 finishJSTest(); | 71 finishJSTest(); |
| 72 }, 0); | 72 }, 0); |
| 73 } | 73 } |
| 74 </script> | 74 </script> |
| OLD | NEW |