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

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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/CharacterData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3c90206400baca23e094cce33d908904dd3da87d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/invalidate-caret-before-text-node-update.html
@@ -0,0 +1,33 @@
+<!doctype HTML>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<div contenteditable id="root" class="editing"></div>
+<style>
+* {
+ font-family: Courier New;
+}
+</style>
+<script>
+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);
+
+ debugger;
+ document.execCommand('delete');
+
+ if (window.internals) {
+ var layers = JSON.parse(window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_PAINT_INVALIDATIONS));
+ assert_equals(layers.children[0].paintInvalidations[2].reason, "invalidate paint rectangle");
+ var previousOffset = layers.children[0].paintInvalidations[2].rect[0];
+ assert_equals(layers.children[0].paintInvalidations[2].rect[3], 20, "Old caret rect location");
+
+ assert_equals(layers.children[0].paintInvalidations[3].reason, "invalidate paint rectangle");
+ // Check that thet x offset is previousOffset - 1. This for the caret rect after delete.
+ assert_not_equals(layers.children[0].paintInvalidations[3].rect[0], previousOffset, "New caret rect location");
+ }
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/CharacterData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698