| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../resources/run-after-layout-and-paint.js"></script> | 2 <script src="../../resources/run-after-layout-and-paint.js"></script> |
| 3 <script> | |
| 4 var i = 0; | |
| 5 var refreshIntervalId; | |
| 6 function repaintTest() | |
| 7 { | |
| 8 refreshIntervalId = setInterval(function(){moveInputElement();}, 10); | |
| 9 } | |
| 10 function moveInputElement() | |
| 11 { | |
| 12 i++; | |
| 13 input.style.left = i*10 + 'px'; | |
| 14 if (i >= 3) { | |
| 15 runAfterLayoutAndPaint(function() { | |
| 16 clearInterval(refreshIntervalId); | |
| 17 }, true); | |
| 18 } | |
| 19 } | |
| 20 if (window.testRunner) | |
| 21 testRunner.waitUntilDone(); | |
| 22 window.onload = repaintTest(); | |
| 23 </script> | |
| 24 <style> | 3 <style> |
| 25 input { | 4 input { |
| 26 position: absolute; | 5 position: absolute; |
| 27 top: 0; | 6 top: 0; |
| 28 left: 0; | 7 left: 0; |
| 29 height: 50px; | 8 height: 50px; |
| 30 width: 200px; | 9 width: 200px; |
| 31 } | 10 } |
| 32 </style> | 11 </style> |
| 33 <div>This change checks that the caret in the >input< below doesn't shift
out of it after several layouts.</div> | 12 <div>This change checks that the caret in the >input< below doesn't shift
out of it after several layouts.</div> |
| 34 <div>This test has passed if the caret is centered <b>inside</b> the >input&l
t;</div> | 13 <div>This test has passed if the caret is centered <b>inside</b> the >input&l
t;</div> |
| 35 <input id="input" type="text" autofocus> | 14 <input id="input" type="text" autofocus> |
| 15 <script> |
| 16 if (window.testRunner) |
| 17 testRunner.waitUntilDone(); |
| 18 runAfterLayoutAndPaint(function() { |
| 19 input.style.left = '10px'; |
| 20 runAfterLayoutAndPaint(function() { |
| 21 input.style.left = '20px'; |
| 22 runAfterLayoutAndPaint(function() { |
| 23 input.style.left = '30px'; |
| 24 }, true); |
| 25 }); |
| 26 }); |
| 27 </script> |
| OLD | NEW |