summaryrefslogtreecommitdiffstats
path: root/WebCore/page/SpatialNavigation.h
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-05 14:36:32 +0100
committerBen Murdoch <benm@google.com>2011-05-10 15:38:30 +0100
commitf05b935882198ccf7d81675736e3aeb089c5113a (patch)
tree4ea0ca838d9ef1b15cf17ddb3928efb427c7e5a1 /WebCore/page/SpatialNavigation.h
parent60fbdcc62bced8db2cb1fd233cc4d1e4ea17db1b (diff)
downloadexternal_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.zip
external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.gz
external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.bz2
Merge WebKit at r74534: Initial merge by git.
Change-Id: I6ccd1154fa1b19c2ec2a66878eb675738735f1eb
Diffstat (limited to 'WebCore/page/SpatialNavigation.h')
-rw-r--r--WebCore/page/SpatialNavigation.h34
1 files changed, 22 insertions, 12 deletions
diff --git a/WebCore/page/SpatialNavigation.h b/WebCore/page/SpatialNavigation.h
index 153d0ac..a6dcf24 100644
--- a/WebCore/page/SpatialNavigation.h
+++ b/WebCore/page/SpatialNavigation.h
@@ -22,6 +22,7 @@
#define SpatialNavigation_h
#include "FocusDirection.h"
+#include "HTMLFrameOwnerElement.h"
#include "IntRect.h"
#include "Node.h"
@@ -31,6 +32,7 @@ namespace WebCore {
class Element;
class Frame;
+class HTMLAreaElement;
class IntRect;
class RenderObject;
@@ -99,7 +101,8 @@ enum RectsAlignment {
struct FocusCandidate {
FocusCandidate()
- : node(0)
+ : visibleNode(0)
+ , focusableNode(0)
, enclosingScrollableBox(0)
, distance(maxDistance())
, parentDistance(maxDistance())
@@ -111,11 +114,17 @@ struct FocusCandidate {
}
FocusCandidate(Node* n, FocusDirection);
- bool isNull() const { return !node; }
- bool inScrollableContainer() const { return node && enclosingScrollableBox; }
- Document* document() const { return node ? node->document() : 0; }
+ explicit FocusCandidate(HTMLAreaElement* area, FocusDirection);
+ bool isNull() const { return !visibleNode; }
+ bool inScrollableContainer() const { return visibleNode && enclosingScrollableBox; }
+ bool isFrameOwnerElement() const { return visibleNode && visibleNode->isFrameOwnerElement(); }
+ Document* document() const { return visibleNode ? visibleNode->document() : 0; }
- Node* node;
+ // We handle differently visibleNode and FocusableNode to properly handle the areas of imagemaps,
+ // where visibleNode would represent the image element and focusableNode would represent the area element.
+ // In all other cases, visibleNode and focusableNode are one and the same.
+ Node* visibleNode;
+ Node* focusableNode;
Node* enclosingScrollableBox;
long long distance;
long long parentDistance;
@@ -126,19 +135,20 @@ struct FocusCandidate {
bool isOffscreenAfterScrolling;
};
+bool hasOffscreenRect(Node*, FocusDirection direction = FocusDirectionNone);
bool scrollInDirection(Frame*, FocusDirection);
bool scrollInDirection(Node* container, FocusDirection);
-bool hasOffscreenRect(Node*, FocusDirection direction = FocusDirectionNone);
-bool isScrollableContainerNode(const Node*);
-bool isNodeDeepDescendantOfDocument(Node*, Document*);
-Node* scrollableEnclosingBoxOrParentFrameForNodeInDirection(FocusDirection, Node* node);
bool canScrollInDirection(FocusDirection, const Node* container);
bool canScrollInDirection(FocusDirection, const Frame*);
+bool canBeScrolledIntoView(FocusDirection, const FocusCandidate&);
+void distanceDataForNode(FocusDirection, const FocusCandidate& current, FocusCandidate& candidate);
+Node* scrollableEnclosingBoxOrParentFrameForNodeInDirection(FocusDirection, Node*);
IntRect nodeRectInAbsoluteCoordinates(Node*, bool ignoreBorder = false);
IntRect frameRectInAbsoluteCoordinates(Frame*);
-void distanceDataForNode(FocusDirection, FocusCandidate& current, FocusCandidate& candidate);
-bool canBeScrolledIntoView(FocusDirection, const FocusCandidate&);
-IntRect virtualRectForDirection(FocusDirection, const IntRect& startingRect);
+IntRect virtualRectForDirection(FocusDirection, const IntRect& startingRect, int width = 0);
+IntRect virtualRectForAreaElementAndDirection(FocusDirection, HTMLAreaElement*);
+HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate&);
+
} // namspace WebCore
#endif // SpatialNavigation_h