Changeset 73885 in webkit
- Timestamp:
- Dec 12, 2010 9:52:40 PM (13 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r73872 r73885 1 2010-12-09 Antonio Gomes <agomes@rim.com> 2 3 Reviewed by Daniel Bates. 4 5 Spatial Navigation: code clean up (part II) 6 https://bugs.webkit.org/show_bug.cgi?id=50666 7 8 No new tests needed. 9 10 * page/FocusController.cpp: Removed static declaration of updateFocusCandidateIfNeeded() from 11 the top of FocusController.cpp, and added the 'static' keyword where the function is implemented; 12 * page/SpatialNavigation.cpp: In FocusCandidate constructor, renamed 'n' to 'node', and added an assert to it; 13 (WebCore::FocusCandidate::FocusCandidate): 14 (WebCore::virtualRectForAreaElementAndDirection): Added an assert to 'node'; 15 * page/SpatialNavigation.h:I reordered the declaration of some methods in order to group related ones; 16 Removed isScrollableContainerNode() function declaration since it is not used outside SpatialNavigation.cpp; 17 And removed the declaration of isNodeDeepDescendantOfDocument() since it does not exist anymore. 18 1 19 2010-12-12 Philippe Normand <pnormand@igalia.com> 2 20 -
trunk/WebCore/page/FocusController.cpp
r73634 r73885 62 62 using namespace std; 63 63 64 static void updateFocusCandidateIfNeeded(FocusDirection direction, const IntRect& startingRect, FocusCandidate& candidate, FocusCandidate& closest);65 64 static inline void dispatchEventsOnWindowAndFocusedNode(Document* document, bool focused) 66 65 { … … 415 414 } 416 415 417 void updateFocusCandidateIfNeeded(FocusDirection direction, const IntRect& startingRect, FocusCandidate& candidate, FocusCandidate& closest)416 static void updateFocusCandidateIfNeeded(FocusDirection direction, const IntRect& startingRect, FocusCandidate& candidate, FocusCandidate& closest) 418 417 { 419 418 if (!candidate.visibleNode->isElementNode() || !candidate.visibleNode->renderer()) -
trunk/WebCore/page/SpatialNavigation.cpp
r73627 r73885 52 52 static bool isRectInDirection(FocusDirection, const IntRect&, const IntRect&); 53 53 static void deflateIfOverlapped(IntRect&, IntRect&); 54 static IntRect rectToAbsoluteCoordinates(Frame* initialFrame, const IntRect& rect);54 static IntRect rectToAbsoluteCoordinates(Frame* initialFrame, const IntRect&); 55 55 static void entryAndExitPointsForDirection(FocusDirection direction, const IntRect& startingRect, const IntRect& potentialRect, IntPoint& exitPoint, IntPoint& entryPoint); 56 57 58 FocusCandidate::FocusCandidate(Node* n , FocusDirection direction)56 static bool isScrollableContainerNode(const Node*); 57 58 FocusCandidate::FocusCandidate(Node* node, FocusDirection direction) 59 59 : visibleNode(0) 60 60 , focusableNode(0) … … 67 67 , isOffscreenAfterScrolling(true) 68 68 { 69 if (n->hasTagName(HTMLNames::areaTag)) { 70 HTMLAreaElement* area = static_cast<HTMLAreaElement*>(n); 69 ASSERT(node); 70 if (node->hasTagName(HTMLNames::areaTag)) { 71 HTMLAreaElement* area = static_cast<HTMLAreaElement*>(node); 71 72 HTMLImageElement* image = area->imageElement(); 72 73 if (!image || !image->renderer()) … … 76 77 rect = virtualRectForAreaElementAndDirection(direction, area); 77 78 } else { 78 if (!n ->renderer())79 if (!node->renderer()) 79 80 return; 80 81 81 visibleNode = n ;82 rect = nodeRectInAbsoluteCoordinates(n , true /* ignore border */);83 } 84 85 focusableNode = n ;82 visibleNode = node; 83 rect = nodeRectInAbsoluteCoordinates(node, true /* ignore border */); 84 } 85 86 focusableNode = node; 86 87 isOffscreen = hasOffscreenRect(visibleNode); 87 88 isOffscreenAfterScrolling = hasOffscreenRect(visibleNode, direction); … … 694 695 IntRect virtualRectForAreaElementAndDirection(FocusDirection direction, HTMLAreaElement* area) 695 696 { 697 ASSERT(area); 698 ASSERT(area->imageElement()); 696 699 // Area elements tend to overlap more than other focusable elements. We flatten the rect of the area elements 697 700 // to minimize the effect of overlapping areas. -
trunk/WebCore/page/SpatialNavigation.h
r73452 r73885 134 134 }; 135 135 136 bool hasOffscreenRect(Node*, FocusDirection direction = FocusDirectionNone); 136 137 bool scrollInDirection(Frame*, FocusDirection); 137 138 bool scrollInDirection(Node* container, FocusDirection); 138 bool hasOffscreenRect(Node*, FocusDirection direction = FocusDirectionNone);139 bool isScrollableContainerNode(const Node*);140 bool isNodeDeepDescendantOfDocument(Node*, Document*);141 Node* scrollableEnclosingBoxOrParentFrameForNodeInDirection(FocusDirection, Node* node);142 139 bool canScrollInDirection(FocusDirection, const Node* container); 143 140 bool canScrollInDirection(FocusDirection, const Frame*); 141 bool canBeScrolledIntoView(FocusDirection, const FocusCandidate&); 142 void distanceDataForNode(FocusDirection, FocusCandidate& current, FocusCandidate& candidate); 143 Node* scrollableEnclosingBoxOrParentFrameForNodeInDirection(FocusDirection, Node*); 144 144 IntRect nodeRectInAbsoluteCoordinates(Node*, bool ignoreBorder = false); 145 145 IntRect frameRectInAbsoluteCoordinates(Frame*); 146 void distanceDataForNode(FocusDirection, FocusCandidate& current, FocusCandidate& candidate);147 bool canBeScrolledIntoView(FocusDirection, const FocusCandidate&);148 146 IntRect virtualRectForDirection(FocusDirection, const IntRect& startingRect, int width = 0); 149 147 IntRect virtualRectForAreaElementAndDirection(FocusDirection, HTMLAreaElement*);
Note: See TracChangeset
for help on using the changeset viewer.