OLD | NEW |
(Empty) | |
| 1 <!doctype HTML> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <div contenteditable id="root" class="editing"></div> |
| 5 <style> |
| 6 * { |
| 7 font-family: Courier New; |
| 8 } |
| 9 </style> |
| 10 <script> |
| 11 test(function() { |
| 12 // The innerText must be set explicitly, and not with an editing command
. |
| 13 root.innerText = "1"; |
| 14 window.getSelection().collapse(root.firstChild, 1); |
| 15 |
| 16 if (window.internals) |
| 17 window.internals.startTrackingRepaints(document); |
| 18 |
| 19 debugger; |
| 20 document.execCommand('delete'); |
| 21 |
| 22 if (window.internals) { |
| 23 var layers = JSON.parse(window.internals.layerTreeAsText(documen
t, internals.LAYER_TREE_INCLUDES_PAINT_INVALIDATIONS)); |
| 24 assert_equals(layers.children[0].paintInvalidations[2].reason, "inva
lidate paint rectangle"); |
| 25 var previousOffset = layers.children[0].paintInvalidations[2].re
ct[0]; |
| 26 assert_equals(layers.children[0].paintInvalidations[2].rect[3],
20, "Old caret rect location"); |
| 27 |
| 28 assert_equals(layers.children[0].paintInvalidations[3].reason, "inva
lidate paint rectangle"); |
| 29 // Check that thet x offset is previousOffset - 1. This for the care
t rect after delete. |
| 30 assert_not_equals(layers.children[0].paintInvalidations[3].rect[
0], previousOffset, "New caret rect location"); |
| 31 } |
| 32 }); |
| 33 </script> |
OLD | NEW |