OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <html contenteditable> |
| 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <html contenteditable> |
| 6 <body style="overflow:hidden;"> |
| 7 This test makes sure that we don't scroll unnecessarily to reveal an editable HT
ML Element. |
| 8 <br> If the document doesn't scroll, test passes.<br> |
| 9 <b>This demonstrates a bug: normally, focusing an element will select its conten
ts.</b> |
| 10 <div style="width:2000px;height:2000px;"></div> |
| 11 If the document scrolls here, test fails. |
| 12 <div id="log"></div> |
| 13 </body> |
| 14 </html> |
| 15 <script> |
| 16 var test = async_test('focus to editable should not scroll'); |
| 17 document.documentElement.addEventListener('focus', function() { |
| 18 assert_equals(document.body.scrollTop, 0); |
| 19 test.done(); |
| 20 }); |
| 21 test.step(function() { |
| 22 document.documentElement.focus(); |
| 23 }); |
| 24 </script> |
OLD | NEW |