Index: third_party/WebKit/LayoutTests/paint/invalidation/invalidate-caret-before-text-node-update.html |
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/invalidate-caret-before-text-node-update.html b/third_party/WebKit/LayoutTests/paint/invalidation/invalidate-caret-before-text-node-update.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..52a3da4d1b56e98e1cc822be8e8c84f48c0c0081 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/invalidate-caret-before-text-node-update.html |
@@ -0,0 +1,33 @@ |
+<script src="../../resources/testharness.js"></script> |
+<div contenteditable id="root" class="editing"> |
+<span id="test"></span> |
+</div> |
+<pre id="output"> |
yosin_UTC9
2016/04/30 03:16:17
nit: Pleas use <div id="log"></div>, if so you don
chrishtr
2016/04/30 21:56:30
Done.
|
+<pre> |
+<script> |
+if (window.testRunner) |
yosin_UTC9
2016/04/30 03:16:16
You don't need to have this if-statement, w3c test
chrishtr
2016/04/30 21:56:30
Done.
|
+ window.testRunner.dumpAsText(); |
+ |
+test(function editingTest() { |
yosin_UTC9
2016/04/30 03:16:17
s/test(function editingTest() {/test(function() {/
|
+ // The innerText must be set explicitly, and not with an editing command. |
+ root.innerText = "1"; |
+ window.getSelection().collapse(root.firstChild, 1); |
+ |
+ if (window.internals) |
+ window.internals.startTrackingRepaints(document); |
+ |
+ document.execCommand('delete'); |
+ |
+ if (window.internals) { |
+ var layers = JSON.parse(window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_PAINT_INVALIDATIONS)); |
+ assert_true(layers.children[0].paintInvalidations[2].reason == "invalidate paint rectangle"); |
yosin_UTC9
2016/04/30 03:16:17
Please use assert_equal(actual, expected, [descrip
|
+ // Check that thet x offset is 22. This for the caret rect before delete. |
+ assert_true(layers.children[0].paintInvalidations[2].rect[3] == 22); |
yosin_UTC9
2016/04/30 03:16:16
Please use assert_equal(actual, expected)
chrishtr
2016/04/30 21:56:30
Done.
|
+ assert_true(layers.children[0].paintInvalidations[3].reason == "invalidate paint rectangle"); |
yosin_UTC9
2016/04/30 03:16:17
Please use assert_equal(actual, expected)
chrishtr
2016/04/30 21:56:30
Done.
|
+ // Check that thet x offset is 22. This for the caret rect after delete. |
+ assert_true(layers.children[0].paintInvalidations[3].rect[3] == 21); |
yosin_UTC9
2016/04/30 03:16:17
Please use assert_equal(actual, expected)
chrishtr
2016/04/30 21:56:30
Done.
|
+ } |
+}); |
+ |
yosin_UTC9
2016/04/30 03:16:16
nit: No need to have extra blank lines.
|
+ |
+</script> |