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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/sequential-focus-navigation-starting-point.html

Issue 1810293002: Set sequential focus navigation starting point on scrollIntoView() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use testRunner.findString() for testing findText. Created 4 years, 9 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/Element.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <body> 2 <body>
3 <script src="../../resources/testharness.js"></script> 3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script> 4 <script src="../../resources/testharnessreport.js"></script>
5 <script src="../forms/resources/common.js"></script> 5 <script src="../forms/resources/common.js"></script>
6 <div id="log"></div> 6 <div id="log"></div>
7 <div id="container"></div> 7 <div id="container"></div>
8 <script> 8 <script>
9 if (!window.eventSender) 9 if (!window.eventSender)
10 document.body.textContent = 'This test requires window.eventSender.'; 10 document.body.textContent = 'This test requires window.eventSender.';
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 container.querySelector('#start').remove(); 62 container.querySelector('#start').remove();
63 eventSender.keyDown('\t'); 63 eventSender.keyDown('\t');
64 assert_equals(document.activeElement.id, 'next'); 64 assert_equals(document.activeElement.id, 'next');
65 65
66 container.innerHTML = '<input id=prev><input id=start><input id=next>'; 66 container.innerHTML = '<input id=prev><input id=start><input id=next>';
67 container.querySelector('#start').focus(); 67 container.querySelector('#start').focus();
68 container.querySelector('#start').remove(); 68 container.querySelector('#start').remove();
69 eventSender.keyDown('\t', ['shiftKey']); 69 eventSender.keyDown('\t', ['shiftKey']);
70 assert_equals(document.activeElement.id, 'prev'); 70 assert_equals(document.activeElement.id, 'prev');
71 }, 'After removing a focused element from the documen tree, sequential focus nav igation should start at a place where the focused element was.'); 71 }, 'After removing a focused element from the documen tree, sequential focus nav igation should start at a place where the focused element was.');
72
73 test(function() {
74 var container = document.querySelector('#container');
75 container.innerHTML = '<input id="i1"><input id="i2"><input id="i3">';
76 container.querySelector('#i3').click();
77 container.querySelector('#i1').scrollIntoView();
78 eventSender.keyDown('\t');
79 assert_equals(document.activeElement.id, 'i2');
80 }, 'Element.scrollIntoView() should update sequential focus navigation starting point.');
81
82 test(function() {
83 var container = document.querySelector('#container');
84 container.innerHTML = '<span>Lorem</span><span tabindex="0" id="ipsum">ipsum </span><span>dolor</span><span tabindex="0" id="sit">sit</span><span>amet</span> ';
85 testRunner.findString("dolor", []);
86 eventSender.keyDown('\t');
87 assert_equals(document.activeElement.id, 'sit');
88 testRunner.findString("Lorem", []);
89 eventSender.keyDown('\t');
90 assert_equals(document.activeElement.id, 'ipsum');
91 testRunner.findString("amet", []);
92 eventSender.keyDown('\t', ['shiftKey']);
93 assert_equals(document.activeElement.id, 'sit');
94 }, 'Find text should update sequential focus navigation starting point.');
72 </script> 95 </script>
73 </body> 96 </body>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698