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

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: Tests update Created 7 years, 7 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 ad2524376d2764a9725c70eb8a93436c08ffed24..f9b7a11f8cd07cc0dd859105c3131e42de754f6d 100644
--- a/Source/core/html/HTMLAnchorElement.cpp
+++ b/Source/core/html/HTMLAnchorElement.cpp
@@ -137,12 +137,13 @@ bool HTMLAnchorElement::isMouseFocusable() const
bool HTMLAnchorElement::isKeyboardFocusable(KeyboardEvent* event) const
{
- if (!isLink())
- return HTMLElement::isKeyboardFocusable(event);
-
if (!isFocusable())
return false;
-
+
+ // If tab index set explicitly, decide focus regardless of the tabsToLinks setting.
dmazzoni 2013/08/01 21:48:15 Well, technically you're also skipping the test th
rchl 2013/08/20 17:58:10 I can't say for sure but the first "!isLink()" con
+ if (Element::supportsFocus())
+ return HTMLElement::isKeyboardFocusable(event);
+
Page* page = document()->page();
if (!page)
return false;

Powered by Google App Engine
This is Rietveld 408576698