Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: third_party/WebKit/LayoutTests/paint/invalidation/invalidate-caret-before-text-node-update.html

Issue 1931513003: Invalidate the previous caret location when editing text nodes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..4a0a6a54f6c835aaecda5321aa1c0f3171b9f1c6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/invalidate-caret-before-text-node-update.html
@@ -0,0 +1,34 @@
+<script src="../../editing/editing.js"></script>
yosin_UTC9 2016/04/29 15:03:12 Could you avoid to use "editing/editing.js"? Becau
chrishtr 2016/04/29 20:09:40 Done.
+<script src="../../resources/testharness.js"></script>
+<div contenteditable id="root" class="editing">
+<span id="test"></span>
+</div>
+<pre id="output">
+<pre>
+<script>
+function editingTest() {
yosin_UTC9 2016/04/29 15:03:12 Let's use w3c test harness directly: test(functio
chrishtr 2016/04/29 20:09:40 Done.
+ // The innerText must be set explicitly, and not with an editing command.
+ root.innerText = "1";
+ moveSelectionForwardByCharacterCommand();
yosin_UTC9 2016/04/29 15:03:12 window.getSelection().collapse(root.firstChild, 1)
chrishtr 2016/04/29 20:09:40 Done.
+
+ if (window.internals)
+ window.internals.startTrackingRepaints(document);
+
+ deleteCommand();
yosin_UTC9 2016/04/29 15:03:12 document.execCommand('delete');
chrishtr 2016/04/29 20:09:40 Done.
+
+ 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");
+ // Check that thet x offset is 22. This for the caret rect before delete.
+ assert_true(layers.children[0].paintInvalidations[2].rect[3] == 22);
+ assert_true(layers.children[0].paintInvalidations[3].reason == "invalidate paint rectangle");
+ // Check that thet x offset is 22. This for the caret rect after delete.
+ assert_true(layers.children[0].paintInvalidations[3].rect[3] == 21);
+ }
+}
+
+if (window.testRunner)
+ window.testRunner.dumpAsText();
+
+runEditingTest();
+</script>

Powered by Google App Engine
This is Rietveld 408576698