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

Unified Diff: Source/core/html/HTMLAnchorElement.cpp

Issue 15238002: Disallow tabsToLinks setting to prevent tabbing to anchor with tabIndex. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Actually add new test Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/html/HTMLAnchorElement.cpp
diff --git a/Source/core/html/HTMLAnchorElement.cpp b/Source/core/html/HTMLAnchorElement.cpp
index 6e688ce98c887adc5fcced2ccfed385ffbc58a0f..200abfe38f5f357c8797b014c1058256a813d7f5 100644
--- a/Source/core/html/HTMLAnchorElement.cpp
+++ b/Source/core/html/HTMLAnchorElement.cpp
@@ -163,12 +163,14 @@ bool HTMLAnchorElement::isMouseFocusable() const
bool HTMLAnchorElement::isKeyboardFocusable() const
{
- if (!isLink())
- return HTMLElement::isKeyboardFocusable();
-
if (!isFocusable())
return false;
+ // If the tab index is set explicitly, ignore the tabsToLinks
+ // setting and empty bounding box check.
+ if (Element::supportsFocus())
+ return HTMLElement::isKeyboardFocusable();
+
Page* page = document().page();
if (!page)
return false;

Powered by Google App Engine
This is Rietveld 408576698