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

Unified Diff: Source/core/page/SpatialNavigation.h

Issue 810493003: Introduce "navigation target classification" for spatial navigation Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 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/page/SpatialNavigation.h
diff --git a/Source/core/page/SpatialNavigation.h b/Source/core/page/SpatialNavigation.h
index c4a5cfb46bce776ced83383ade66fd175b5e0d86..779354d954b534d0f60f4fe545a25a38ac7ab078 100644
--- a/Source/core/page/SpatialNavigation.h
+++ b/Source/core/page/SpatialNavigation.h
@@ -94,6 +94,16 @@ enum RectsAlignment {
Full
};
+// Classification of a focus candidate, ie. why a candidate is considered
+// "interesting" as a navigation target.
+enum NavigationClass {
+ NavigationClassNone,
+ NavigationClassFocusable,
+ NavigationClassFrameOwner,
+ NavigationClassScrollable,
+ NavigationClassEventHandler,
+};
+
struct FocusCandidate {
STACK_ALLOCATED();
public:
@@ -105,11 +115,11 @@ public:
, alignment(None)
, isOffscreen(true)
, isOffscreenAfterScrolling(true)
+ , targetClass(NavigationClassNone)
{
}
- FocusCandidate(Node*, FocusType);
- explicit FocusCandidate(HTMLAreaElement*, FocusType);
+ FocusCandidate(Node*, FocusType, NavigationClass);
bool isNull() const { return !visibleNode; }
bool inScrollableContainer() const { return visibleNode && enclosingScrollableBox; }
bool isFrameOwnerElement() const { return visibleNode && visibleNode->isFrameOwnerElement(); }
@@ -126,6 +136,7 @@ public:
LayoutRect rect;
bool isOffscreen;
bool isOffscreenAfterScrolling;
+ NavigationClass targetClass;
};
bool hasOffscreenRect(Node*, FocusType = FocusTypeNone);

Powered by Google App Engine
This is Rietveld 408576698