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

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

Issue 2665823002: Invalidate caret during paint invalidation (Closed)
Patch Set: Rebaseline Created 3 years, 10 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
1 <!doctype HTML> 1 <!doctype HTML>
2 <script src="../../resources/testharness.js"></script> 2 <script src="resources/text-based-repaint.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <div contenteditable id="root" class="editing"></div> 3 <div contenteditable id="root" class="editing"></div>
5 <style> 4 <style>
6 * { 5 * {
7 » font-family: Courier New; 6 font-family: Courier New;
8 } 7 }
9 </style> 8 </style>
10 <script> 9 <script>
11 test(function() { 10 onload = function() {
12 » // The innerText must be set explicitly, and not with an editing command . 11 // The innerText must be set explicitly, and not with an editing command.
13 » root.innerText = "1"; 12 root.innerText = "1";
14 » window.getSelection().collapse(root.firstChild, 1); 13 window.getSelection().collapse(root.firstChild, 1);
14
15 runRepaintAndPixelTest();
16 };
15 17
16 » if (window.internals) 18 function repaintTest() {
17 » window.internals.startTrackingRepaints(document); 19 document.execCommand('delete');
18 20 }
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))["layers"]
24 » assert_equals(layers[0].paintInvalidations[2].reason, "invalidate pa int rectangle");
25 » » var previousOffset = layers[0].paintInvalidations[2].rect[0];
26 » » assert_equals(layers[0].paintInvalidations[2].rect[3], 20, "Old caret rect location");
27
28 » assert_equals(layers[0].paintInvalidations[3].reason, "invalidate pa int rectangle");
29 » // Check that thet x offset is previousOffset - 1. This for the care t rect after delete.
30 » » assert_not_equals(layers[0].paintInvalidations[3].rect[0], previ ousOffset, "New caret rect location");
31 » }
32 });
Xianzhu 2017/01/31 18:39:52 This test is changed to a normal repaint test beca
33 </script> 21 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698