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

Side by Side Diff: third_party/WebKit/Source/core/page/FocusController.cpp

Issue 1848753002: Consider slots' 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nuanti Ltd. 3 * Copyright (C) 2008 Nuanti Ltd.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 return isNonKeyboardFocusableShadowHost(element) || isShadowInsertionPointFo cusScopeOwner(element) || isHTMLSlotElement(element); 330 return isNonKeyboardFocusableShadowHost(element) || isShadowInsertionPointFo cusScopeOwner(element) || isHTMLSlotElement(element);
331 } 331 }
332 332
333 inline bool isShadowHostDelegatesFocus(const Element& element) 333 inline bool isShadowHostDelegatesFocus(const Element& element)
334 { 334 {
335 return element.authorShadowRoot() && element.authorShadowRoot()->delegatesFo cus(); 335 return element.authorShadowRoot() && element.authorShadowRoot()->delegatesFo cus();
336 } 336 }
337 337
338 inline int adjustedTabIndex(Element& element) 338 inline int adjustedTabIndex(Element& element)
339 { 339 {
340 return isNonFocusableFocusScopeOwner(element) ? 0 : element.tabIndex(); 340 return (isNonKeyboardFocusableShadowHost(element) || isShadowInsertionPointF ocusScopeOwner(element)) ? 0 : element.tabIndex();
341 } 341 }
342 342
343 inline bool shouldVisit(Element& element) 343 inline bool shouldVisit(Element& element)
344 { 344 {
345 return element.isKeyboardFocusable() || isNonFocusableFocusScopeOwner(elemen t); 345 return element.isKeyboardFocusable() || isNonFocusableFocusScopeOwner(elemen t);
346 } 346 }
347 347
348 Element* findElementWithExactTabIndex(ScopedFocusNavigation& scope, int tabIndex , WebFocusType type) 348 Element* findElementWithExactTabIndex(ScopedFocusNavigation& scope, int tabIndex , WebFocusType type)
349 { 349 {
350 // Search is inclusive of start 350 // Search is inclusive of start
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
1254 return consumed; 1254 return consumed;
1255 } 1255 }
1256 1256
1257 DEFINE_TRACE(FocusController) 1257 DEFINE_TRACE(FocusController)
1258 { 1258 {
1259 visitor->trace(m_page); 1259 visitor->trace(m_page);
1260 visitor->trace(m_focusedFrame); 1260 visitor->trace(m_focusedFrame);
1261 } 1261 }
1262 1262
1263 } // namespace blink 1263 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698