OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) | 2 * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) |
3 * Copyright (C) 2009 Antonio Gomes <tonikitoo@webkit.org> | 3 * Copyright (C) 2009 Antonio Gomes <tonikitoo@webkit.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "platform/geometry/LayoutRect.h" | 26 #include "platform/geometry/LayoutRect.h" |
27 | 27 |
28 #include <limits> | 28 #include <limits> |
29 | 29 |
30 namespace blink { | 30 namespace blink { |
31 | 31 |
32 class LocalFrame; | 32 class LocalFrame; |
33 class HTMLAreaElement; | 33 class HTMLAreaElement; |
34 class HTMLFrameOwnerElement; | 34 class HTMLFrameOwnerElement; |
35 | 35 |
36 inline long long maxDistance() | 36 inline double maxDistance() |
37 { | 37 { |
38 return std::numeric_limits<long long>::max(); | 38 return std::numeric_limits<double>::max(); |
39 } | 39 } |
40 | 40 |
41 inline int fudgeFactor() | 41 inline int fudgeFactor() |
42 { | 42 { |
43 return 2; | 43 return 2; |
44 } | 44 } |
45 | 45 |
46 bool isSpatialNavigationEnabled(const LocalFrame*); | 46 bool isSpatialNavigationEnabled(const LocalFrame*); |
47 | 47 |
48 // Spatially speaking, two given elements in a web page can be: | 48 // Spatially speaking, two given elements in a web page can be: |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 bool inScrollableContainer() const { return visibleNode && enclosingScrollab
leBox; } | 114 bool inScrollableContainer() const { return visibleNode && enclosingScrollab
leBox; } |
115 bool isFrameOwnerElement() const { return visibleNode && visibleNode->isFram
eOwnerElement(); } | 115 bool isFrameOwnerElement() const { return visibleNode && visibleNode->isFram
eOwnerElement(); } |
116 Document* document() const { return visibleNode ? &visibleNode->document() :
nullptr; } | 116 Document* document() const { return visibleNode ? &visibleNode->document() :
nullptr; } |
117 | 117 |
118 // We handle differently visibleNode and FocusableNode to properly handle th
e areas of imagemaps, | 118 // We handle differently visibleNode and FocusableNode to properly handle th
e areas of imagemaps, |
119 // where visibleNode would represent the image element and focusableNode wou
ld represent the area element. | 119 // where visibleNode would represent the image element and focusableNode wou
ld represent the area element. |
120 // In all other cases, visibleNode and focusableNode are one and the same. | 120 // In all other cases, visibleNode and focusableNode are one and the same. |
121 RawPtrWillBeMember<Node> visibleNode; | 121 RawPtrWillBeMember<Node> visibleNode; |
122 RawPtrWillBeMember<Node> focusableNode; | 122 RawPtrWillBeMember<Node> focusableNode; |
123 RawPtrWillBeMember<Node> enclosingScrollableBox; | 123 RawPtrWillBeMember<Node> enclosingScrollableBox; |
124 long long distance; | 124 double distance; |
125 RectsAlignment alignment; | 125 RectsAlignment alignment; |
126 LayoutRect rect; | 126 LayoutRect rect; |
127 bool isOffscreen; | 127 bool isOffscreen; |
128 bool isOffscreenAfterScrolling; | 128 bool isOffscreenAfterScrolling; |
129 }; | 129 }; |
130 | 130 |
131 bool hasOffscreenRect(Node*, FocusType = FocusTypeNone); | 131 bool hasOffscreenRect(Node*, FocusType = FocusTypeNone); |
132 bool scrollInDirection(LocalFrame*, FocusType); | 132 bool scrollInDirection(LocalFrame*, FocusType); |
133 bool scrollInDirection(Node* container, FocusType); | 133 bool scrollInDirection(Node* container, FocusType); |
134 bool canScrollInDirection(const Node* container, FocusType); | 134 bool canScrollInDirection(const Node* container, FocusType); |
135 bool canScrollInDirection(const LocalFrame*, FocusType); | 135 bool canScrollInDirection(const LocalFrame*, FocusType); |
136 bool canBeScrolledIntoView(FocusType, const FocusCandidate&); | 136 bool canBeScrolledIntoView(FocusType, const FocusCandidate&); |
137 bool areElementsOnSameLine(const FocusCandidate& firstCandidate, const FocusCand
idate& secondCandidate); | 137 bool areElementsOnSameLine(const FocusCandidate& firstCandidate, const FocusCand
idate& secondCandidate); |
138 void distanceDataForNode(FocusType, const FocusCandidate& current, FocusCandidat
e&); | 138 void distanceDataForNode(FocusType, const FocusCandidate& current, FocusCandidat
e&); |
139 Node* scrollableEnclosingBoxOrParentFrameForNodeInDirection(FocusType, Node*); | 139 Node* scrollableEnclosingBoxOrParentFrameForNodeInDirection(FocusType, Node*); |
140 LayoutRect nodeRectInAbsoluteCoordinates(Node*, bool ignoreBorder = false); | 140 LayoutRect nodeRectInAbsoluteCoordinates(Node*, bool ignoreBorder = false); |
141 LayoutRect frameRectInAbsoluteCoordinates(LocalFrame*); | 141 LayoutRect frameRectInAbsoluteCoordinates(LocalFrame*); |
142 LayoutRect virtualRectForDirection(FocusType, const LayoutRect& startingRect, La
youtUnit width = 0); | 142 LayoutRect virtualRectForDirection(FocusType, const LayoutRect& startingRect, La
youtUnit width = 0); |
143 LayoutRect virtualRectForAreaElementAndDirection(HTMLAreaElement&, FocusType); | 143 LayoutRect virtualRectForAreaElementAndDirection(HTMLAreaElement&, FocusType); |
144 HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate&); | 144 HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate&); |
145 | 145 |
146 } // namespace blink | 146 } // namespace blink |
147 | 147 |
148 #endif // SpatialNavigation_h | 148 #endif // SpatialNavigation_h |
OLD | NEW |