[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

tonikitoo at webkit.org tonikitoo at webkit.org
Wed Dec 22 18:29:50 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 237c1ea4ba15ce88800c2ad53678877c482714c8
Author: tonikitoo at webkit.org <tonikitoo at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 13 05:52:40 2010 +0000

    2010-12-09  Antonio Gomes  <agomes at rim.com>
    
            Reviewed by Daniel Bates.
    
            Spatial Navigation: code clean up (part II)
            https://bugs.webkit.org/show_bug.cgi?id=50666
    
            No new tests needed.
    
            * page/FocusController.cpp: Removed static declaration of updateFocusCandidateIfNeeded() from
            the top of FocusController.cpp, and added the 'static' keyword where the function is implemented;
            * page/SpatialNavigation.cpp: In FocusCandidate constructor, renamed 'n' to 'node', and added an assert to it;
            (WebCore::FocusCandidate::FocusCandidate):
            (WebCore::virtualRectForAreaElementAndDirection): Added an assert to 'node';
            * page/SpatialNavigation.h:I reordered the declaration of some methods in order to group related ones;
            Removed isScrollableContainerNode() function declaration since it is not used outside SpatialNavigation.cpp;
            And removed the declaration of isNodeDeepDescendantOfDocument() since it does not exist anymore.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73885 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 153d09b..1d6af42 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-12-09  Antonio Gomes  <agomes at rim.com>
+
+        Reviewed by Daniel Bates.
+
+        Spatial Navigation: code clean up (part II)
+        https://bugs.webkit.org/show_bug.cgi?id=50666
+
+        No new tests needed.
+
+        * page/FocusController.cpp: Removed static declaration of updateFocusCandidateIfNeeded() from
+        the top of FocusController.cpp, and added the 'static' keyword where the function is implemented;
+        * page/SpatialNavigation.cpp: In FocusCandidate constructor, renamed 'n' to 'node', and added an assert to it;
+        (WebCore::FocusCandidate::FocusCandidate):
+        (WebCore::virtualRectForAreaElementAndDirection): Added an assert to 'node';
+        * page/SpatialNavigation.h:I reordered the declaration of some methods in order to group related ones;
+        Removed isScrollableContainerNode() function declaration since it is not used outside SpatialNavigation.cpp;
+        And removed the declaration of isNodeDeepDescendantOfDocument() since it does not exist anymore.
+
 2010-12-12  Philippe Normand  <pnormand at igalia.com>
 
         Reviewed by Xan Lopez.
diff --git a/WebCore/page/FocusController.cpp b/WebCore/page/FocusController.cpp
index c0d2587..094acd6 100644
--- a/WebCore/page/FocusController.cpp
+++ b/WebCore/page/FocusController.cpp
@@ -61,7 +61,6 @@ namespace WebCore {
 using namespace HTMLNames;
 using namespace std;
 
-static void updateFocusCandidateIfNeeded(FocusDirection direction, const IntRect& startingRect, FocusCandidate& candidate, FocusCandidate& closest);
 static inline void dispatchEventsOnWindowAndFocusedNode(Document* document, bool focused)
 {
     // If we have a focused node we should dispatch blur on it before we blur the window.
@@ -414,7 +413,7 @@ void FocusController::setActive(bool active)
         dispatchEventsOnWindowAndFocusedNode(m_focusedFrame->document(), active);
 }
 
-void updateFocusCandidateIfNeeded(FocusDirection direction, const IntRect& startingRect, FocusCandidate& candidate, FocusCandidate& closest)
+static void updateFocusCandidateIfNeeded(FocusDirection direction, const IntRect& startingRect, FocusCandidate& candidate, FocusCandidate& closest)
 {
     if (!candidate.visibleNode->isElementNode() || !candidate.visibleNode->renderer())
         return;
diff --git a/WebCore/page/SpatialNavigation.cpp b/WebCore/page/SpatialNavigation.cpp
index f6ba009..5f270ba 100644
--- a/WebCore/page/SpatialNavigation.cpp
+++ b/WebCore/page/SpatialNavigation.cpp
@@ -51,11 +51,11 @@ static bool areRectsPartiallyAligned(FocusDirection, const IntRect&, const IntRe
 static bool areRectsMoreThanFullScreenApart(FocusDirection direction, const IntRect& curRect, const IntRect& targetRect, const IntSize& viewSize);
 static bool isRectInDirection(FocusDirection, const IntRect&, const IntRect&);
 static void deflateIfOverlapped(IntRect&, IntRect&);
-static IntRect rectToAbsoluteCoordinates(Frame* initialFrame, const IntRect& rect);
+static IntRect rectToAbsoluteCoordinates(Frame* initialFrame, const IntRect&);
 static void entryAndExitPointsForDirection(FocusDirection direction, const IntRect& startingRect, const IntRect& potentialRect, IntPoint& exitPoint, IntPoint& entryPoint);
+static bool isScrollableContainerNode(const Node*);
 
-
-FocusCandidate::FocusCandidate(Node* n, FocusDirection direction)
+FocusCandidate::FocusCandidate(Node* node, FocusDirection direction)
     : visibleNode(0)
     , focusableNode(0)
     , enclosingScrollableBox(0)
@@ -66,8 +66,9 @@ FocusCandidate::FocusCandidate(Node* n, FocusDirection direction)
     , isOffscreen(true)
     , isOffscreenAfterScrolling(true)
 {
-    if (n->hasTagName(HTMLNames::areaTag)) {
-        HTMLAreaElement* area = static_cast<HTMLAreaElement*>(n);
+    ASSERT(node);
+    if (node->hasTagName(HTMLNames::areaTag)) {
+        HTMLAreaElement* area = static_cast<HTMLAreaElement*>(node);
         HTMLImageElement* image = area->imageElement();
         if (!image || !image->renderer())
             return;
@@ -75,14 +76,14 @@ FocusCandidate::FocusCandidate(Node* n, FocusDirection direction)
         visibleNode = image;
         rect = virtualRectForAreaElementAndDirection(direction, area);
     } else {
-        if (!n->renderer())
+        if (!node->renderer())
             return;
 
-        visibleNode = n;
-        rect = nodeRectInAbsoluteCoordinates(n, true /* ignore border */);
+        visibleNode = node;
+        rect = nodeRectInAbsoluteCoordinates(node, true /* ignore border */);
     }
 
-    focusableNode = n;
+    focusableNode = node;
     isOffscreen = hasOffscreenRect(visibleNode);
     isOffscreenAfterScrolling = hasOffscreenRect(visibleNode, direction);
 }
@@ -693,6 +694,8 @@ IntRect virtualRectForDirection(FocusDirection direction, const IntRect& startin
 
 IntRect virtualRectForAreaElementAndDirection(FocusDirection direction, HTMLAreaElement* area)
 {
+    ASSERT(area);
+    ASSERT(area->imageElement());
     // Area elements tend to overlap more than other focusable elements. We flatten the rect of the area elements
     // to minimize the effect of overlapping areas.
     IntRect rect = virtualRectForDirection(direction, rectToAbsoluteCoordinates(area->document()->frame(), area->getRect(area->imageElement()->renderer())), 1);
diff --git a/WebCore/page/SpatialNavigation.h b/WebCore/page/SpatialNavigation.h
index c911376..6ef0058 100644
--- a/WebCore/page/SpatialNavigation.h
+++ b/WebCore/page/SpatialNavigation.h
@@ -133,18 +133,16 @@ 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, 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, int width = 0);
 IntRect virtualRectForAreaElementAndDirection(FocusDirection, HTMLAreaElement*);
 } // namspace WebCore

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list