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

Side by Side 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, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/CharacterData.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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>
OLDNEW
« 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