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

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

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 | « third_party/WebKit/LayoutTests/shadow-dom/focus-with-negative-index.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 366
367 #if ENABLE(ASSERT) 367 #if ENABLE(ASSERT)
368 inline bool isNonFocusableShadowHost(const Element& element) 368 inline bool isNonFocusableShadowHost(const Element& element)
369 { 369 {
370 return isShadowHostWithoutCustomFocusLogic(element) && !element.isFocusable( ); 370 return isShadowHostWithoutCustomFocusLogic(element) && !element.isFocusable( );
371 } 371 }
372 #endif 372 #endif
373 373
374 inline bool isNonKeyboardFocusableShadowHost(const Element& element) 374 inline bool isNonKeyboardFocusableShadowHost(const Element& element)
375 { 375 {
376 return isShadowHostWithoutCustomFocusLogic(element) && !element.isKeyboardFo cusable(); 376 return isShadowHostWithoutCustomFocusLogic(element) && !(element.shadowRootI fV1() ? element.isFocusable() : element.isKeyboardFocusable());
377 } 377 }
378 378
379 inline bool isKeyboardFocusableShadowHost(const Element& element) 379 inline bool isKeyboardFocusableShadowHost(const Element& element)
380 { 380 {
381 return isShadowHostWithoutCustomFocusLogic(element) && element.isKeyboardFoc usable(); 381 return isShadowHostWithoutCustomFocusLogic(element) && element.isKeyboardFoc usable();
382 } 382 }
383 383
384 inline bool isNonFocusableFocusScopeOwner(Element& element) 384 inline bool isNonFocusableFocusScopeOwner(Element& element)
385 { 385 {
386 return isNonKeyboardFocusableShadowHost(element) || isShadowInsertionPointFo cusScopeOwner(element) || isHTMLSlotElement(element); 386 return isNonKeyboardFocusableShadowHost(element) || isShadowInsertionPointFo cusScopeOwner(element) || isHTMLSlotElement(element);
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 return consumed; 1309 return consumed;
1310 } 1310 }
1311 1311
1312 DEFINE_TRACE(FocusController) 1312 DEFINE_TRACE(FocusController)
1313 { 1313 {
1314 visitor->trace(m_page); 1314 visitor->trace(m_page);
1315 visitor->trace(m_focusedFrame); 1315 visitor->trace(m_focusedFrame);
1316 } 1316 }
1317 1317
1318 } // namespace blink 1318 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/shadow-dom/focus-with-negative-index.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698