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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/shadow/resources/shadow-dom.js

Issue 1862563002: Skip shadow hosts with negative tabindex in focus navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactor Created 4 years, 8 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/LayoutTests/shadow-dom/focus-navigation-with-delegatesFocus.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // TODO(yuzus): These two functions below need cleaning up. They are currently 1 // TODO(yuzus): These two functions below need cleaning up. They are currently
2 // from js-test.js. 2 // from js-test.js.
3 function getOrCreateTestElement(id, tagName) 3 function getOrCreateTestElement(id, tagName)
4 { 4 {
5 var element = document.getElementById(id); 5 var element = document.getElementById(id);
6 if (element) 6 if (element)
7 return element; 7 return element;
8 8
9 element = document.createElement(tagName); 9 element = document.createElement(tagName);
10 element.id = id; 10 element.id = id;
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 shadowRoot = window.internals.youngerShadowRoot(shadowRoot); 183 shadowRoot = window.internals.youngerShadowRoot(shadowRoot);
184 } 184 }
185 } 185 }
186 return element; 186 return element;
187 } 187 }
188 188
189 function isInnermostActiveElement(id) 189 function isInnermostActiveElement(id)
190 { 190 {
191 var element = getNodeInComposedTree(id); 191 var element = getNodeInComposedTree(id);
192 if (!element) { 192 if (!element) {
193 debug('FAIL: There is no such element with id: '+ from); 193 debug('FAIL: There is no such element with id: '+ id);
194 return false; 194 return false;
195 } 195 }
196 if (element == innermostActiveElement()) 196 if (element == innermostActiveElement())
197 return true; 197 return true;
198 debug('Expected innermost activeElement is ' + id + ', but actual innermost activeElement is ' + dumpNode(innermostActiveElement())); 198 debug('Expected innermost activeElement is ' + id + ', but actual innermost activeElement is ' + dumpNode(innermostActiveElement()));
199 return false; 199 return false;
200 } 200 }
201 201
202 function shouldNavigateFocus(from, to, direction) 202 function shouldNavigateFocus(from, to, direction)
203 { 203 {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 return node; 348 return node;
349 } 349 }
350 350
351 return null; 351 return null;
352 }; 352 };
353 353
354 if (!window.internals) 354 if (!window.internals)
355 return null; 355 return null;
356 return iter(root, id); 356 return iter(root, id);
357 } 357 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/shadow-dom/focus-navigation-with-delegatesFocus.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698