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

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
OLDNEW
(Empty)
1 <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.
2 <script src="../../resources/testharness.js"></script>
3 <div contenteditable id="root" class="editing">
4 <span id="test"></span>
5 </div>
6 <pre id="output">
7 <pre>
8 <script>
9 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.
10 // The innerText must be set explicitly, and not with an editing command .
11 root.innerText = "1";
12 moveSelectionForwardByCharacterCommand();
yosin_UTC9 2016/04/29 15:03:12 window.getSelection().collapse(root.firstChild, 1)
chrishtr 2016/04/29 20:09:40 Done.
13
14 if (window.internals)
15 window.internals.startTrackingRepaints(document);
16
17 deleteCommand();
yosin_UTC9 2016/04/29 15:03:12 document.execCommand('delete');
chrishtr 2016/04/29 20:09:40 Done.
18
19 if (window.internals) {
20 var layers = JSON.parse(window.internals.layerTreeAsText(documen t, internals.LAYER_TREE_INCLUDES_PAINT_INVALIDATIONS));
21 assert_true(layers.children[0].paintInvalidations[2].reason == " invalidate paint rectangle");
22 // Check that thet x offset is 22. This for the caret rect befor e delete.
23 assert_true(layers.children[0].paintInvalidations[2].rect[3] == 22);
24 assert_true(layers.children[0].paintInvalidations[3].reason == " invalidate paint rectangle");
25 // Check that thet x offset is 22. This for the caret rect after delete.
26 assert_true(layers.children[0].paintInvalidations[3].rect[3] == 21);
27 }
28 }
29
30 if (window.testRunner)
31 window.testRunner.dumpAsText();
32
33 runEditingTest();
34 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698