| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <style> | 2 <style> |
| 3 #box { | 3 #box { |
| 4 position: absolute; | 4 position: absolute; |
| 5 } | 5 } |
| 6 </style> | 6 </style> |
| 7 <div id=box></div> | 7 <div id=box></div> |
| 8 <script src="../../../resources/js-test.js"></script> | 8 <script src="../../../resources/js-test.js"></script> |
| 9 <script> | 9 <script> |
| 10 description("Check which type of events trigger layout when it's dirty. Events
that do a hit-test must update layout, but all other events shouldn't need to.")
; | 10 description("Check which type of events trigger layout when it's dirty. Events
that do a hit-test must update layout, but all other events shouldn't need to.")
; |
| 11 | 11 |
| 12 var counter = 10; | 12 var counter = 10; |
| 13 function triggersLayout(action) { | 13 function triggersLayout(action) { |
| 14 // Dirty layout | 14 // Dirty layout |
| 15 box.style.height = counter + 'px'; | 15 box.style.height = counter + 'px'; |
| 16 counter++; | 16 counter++; |
| 17 window.internals.updateStyleAndReturnAffectedElementCount(); | 17 window.internals.updateStyleAndLayoutAndReturnAffectedElementCount(); |
| 18 shouldNotBe('internals.needsLayoutCount()', '0', true); | 18 shouldNotBe('internals.needsLayoutCount()', '0', true); |
| 19 | 19 |
| 20 // Run the action under test | 20 // Run the action under test |
| 21 action(); | 21 action(); |
| 22 | 22 |
| 23 return (internals.needsLayoutCount() == 0); | 23 return (internals.needsLayoutCount() == 0); |
| 24 } | 24 } |
| 25 | 25 |
| 26 var triggeredLayout; | 26 var triggeredLayout; |
| 27 var jsTestIsAsync = true; | 27 var jsTestIsAsync = true; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 debug('Sending GestureScrollEnd'); | 85 debug('Sending GestureScrollEnd'); |
| 86 triggeredLayout = triggersLayout(function() { | 86 triggeredLayout = triggersLayout(function() { |
| 87 eventSender.gestureScrollEnd(0, 5); | 87 eventSender.gestureScrollEnd(0, 5); |
| 88 }); | 88 }); |
| 89 shouldBeFalse('triggeredLayout'); | 89 shouldBeFalse('triggeredLayout'); |
| 90 | 90 |
| 91 finishJSTest(); | 91 finishJSTest(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 </script> | 94 </script> |
| OLD | NEW |