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

Unified Diff: Source/core/dom/Element.cpp

Issue 382043002: Devirtualize supportsSpatialNavigationFocus (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make more readable Created 6 years, 5 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
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/svg/SVGElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 7b03118ae897022f701741706f20b8edaf64215f..05df7d08097388a1ebc724ae38c9d0ef55d400be 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -2179,10 +2179,17 @@ bool Element::supportsSpatialNavigationFocus() const
if (!document().settings() || !document().settings()->spatialNavigationEnabled())
return false;
- return hasEventListeners(EventTypeNames::click)
+ if (hasEventListeners(EventTypeNames::click)
|| hasEventListeners(EventTypeNames::keydown)
|| hasEventListeners(EventTypeNames::keypress)
- || hasEventListeners(EventTypeNames::keyup);
+ || hasEventListeners(EventTypeNames::keyup))
+ return true;
+ if (!isSVGElement())
+ return false;
+ return (hasEventListeners(EventTypeNames::focus)
+ || hasEventListeners(EventTypeNames::blur)
+ || hasEventListeners(EventTypeNames::focusin)
+ || hasEventListeners(EventTypeNames::focusout));
}
bool Element::isFocusable() const
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/svg/SVGElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698