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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/relayout-shifts-inner-editor.html

Issue 2293293003: Make CaretBase a DisplayItemClient. (Closed)
Patch Set: Update docs and sync to head. Created 4 years, 3 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/run-after-layout-and-paint.js"></script>
2 <script> 3 <script>
3 var i = 0; 4 var i = 0;
4 var refreshIntervalId; 5 var refreshIntervalId;
5 function repaintTest() 6 function repaintTest()
6 { 7 {
7 refreshIntervalId = setInterval(function(){moveInputElement();}, 10); 8 refreshIntervalId = setInterval(function(){moveInputElement();}, 10);
8 } 9 }
9 function moveInputElement() 10 function moveInputElement()
10 { 11 {
11 var input = document.getElementById('input');
12 i++; 12 i++;
13 input.style.left = i*10 + 'px'; 13 input.style.left = i*10 + 'px';
14 if (i >= 3) { 14 if (i >= 3) {
15 clearInterval(refreshIntervalId); 15 runAfterLayoutAndPaint(function() {
16 if (window.testRunner) 16 clearInterval(refreshIntervalId);
17 testRunner.notifyDone(); 17 }, true);
18 } 18 }
19 } 19 }
20 if (window.testRunner) 20 if (window.testRunner)
21 testRunner.waitUntilDone(); 21 testRunner.waitUntilDone();
22 window.onload = repaintTest(); 22 window.onload = repaintTest();
23 </script> 23 </script>
24 <style> 24 <style>
25 input { 25 input {
26 position: absolute; 26 position: absolute;
27 top: 0; 27 top: 0;
28 left: 0; 28 left: 0;
29 height: 50px; 29 height: 50px;
30 width: 200px; 30 width: 200px;
31 } 31 }
32 </style> 32 </style>
33 <div>This change checks that the caret in the &gt;input&lt; below doesn't shift out of it after several layouts.</div> 33 <div>This change checks that the caret in the &gt;input&lt; below doesn't shift out of it after several layouts.</div>
34 <div>This test has passed if the caret is centered <b>inside</b> the &gt;input&l t;</div> 34 <div>This test has passed if the caret is centered <b>inside</b> the &gt;input&l t;</div>
35 <input id="input" type="text" autofocus> 35 <input id="input" type="text" autofocus>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/LayoutTests/paint/invalidation/textarea-caret.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698