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