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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/input/scroll-viewport-page-up-down.html

Issue 2709983005: Selection API: Do not change focus by Selection functions. (Closed)
Patch Set: . 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 <head> 1 <head>
2 <script src="../../resources/ahem.js"></script> 2 <script src="../../resources/ahem.js"></script>
3 <style type="text/css"> 3 <style type="text/css">
4 .ahem { font: 20px Ahem; } 4 .ahem { font: 20px Ahem; }
5 </style> 5 </style>
6 <script> 6 <script>
7 7
8 if (window.testRunner) 8 if (window.testRunner)
9 testRunner.dumpAsText(); 9 testRunner.dumpAsText();
10 10
(...skipping 10 matching lines...) Expand all
21 content += "<p>line " + i + "</p>\n"; 21 content += "<p>line " + i + "</p>\n";
22 return content; 22 return content;
23 } 23 }
24 24
25 function runFrameScrollTest() { 25 function runFrameScrollTest() {
26 var frame = frames[0]; 26 var frame = frames[0];
27 var doc = frame.document; 27 var doc = frame.document;
28 var body = doc.body; 28 var body = doc.body;
29 body.innerHTML = generateContent(); 29 body.innerHTML = generateContent();
30 frame.focus(); 30 frame.focus();
31 body.focus();
31 frame.getSelection().collapse(body.firstChild, 0); 32 frame.getSelection().collapse(body.firstChild, 0);
32 if (onMacPlatform) 33 if (onMacPlatform)
33 offsets = [ 55, 175 ]; 34 offsets = [ 55, 175 ];
34 else 35 else
35 offsets = [ 120, 240 ]; 36 offsets = [ 120, 240 ];
36 runScrollingTest("iframe", frame, offsets, function() { return frame.pageYOf fset; }); 37 runScrollingTest("iframe", frame, offsets, function() { return frame.pageYOf fset; });
37 } 38 }
38 39
39 function runDivScrollTest() { 40 function runDivScrollTest() {
40 var editable = document.getElementById('editable'); 41 var editable = document.getElementById('editable');
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 <div>Page up/down (option+page up/down on Mac) should move the move cursor and s croll the content 82 <div>Page up/down (option+page up/down on Mac) should move the move cursor and s croll the content
82 in contenteditable elements. This sample covers scroll position test of a) ifram e element containing 83 in contenteditable elements. This sample covers scroll position test of a) ifram e element containing
83 contenteditable body and b) content editable div element. Even though the cursor will move exactly to 84 contenteditable body and b) content editable div element. Even though the cursor will move exactly to
84 the same location on all platforms (covered by test option-page-up-down.html), p lease note that Mac will 85 the same location on all platforms (covered by test option-page-up-down.html), p lease note that Mac will
85 scroll the visible area by placing the cursor position in the middle. All other platforms will scroll by 86 scroll the visible area by placing the cursor position in the middle. All other platforms will scroll by
86 keeping the cursor aligned with the top edge of the visible area. </div> 87 keeping the cursor aligned with the top edge of the visible area. </div>
87 <iframe src="../resources/contenteditable-iframe-fixed-size-src.html" style="hei ght:150px; padding: 0px;"></iframe> 88 <iframe src="../resources/contenteditable-iframe-fixed-size-src.html" style="hei ght:150px; padding: 0px;"></iframe>
88 <div id="editable" contenteditable="true" class="ahem" style="height:150px; over flow:auto; padding: 0px; margin: 0px;"></div> 89 <div id="editable" contenteditable="true" class="ahem" style="height:150px; over flow:auto; padding: 0px; margin: 0px;"></div>
89 <div id="results"></div> 90 <div id="results"></div>
90 </body> 91 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698