[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:35:23 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 36a7cfb9b28bbe4d92101aef9e640e475858caf4
Author: tonikitoo at webkit.org <tonikitoo at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 14 06:51:41 2010 +0000

    2010-12-13  Antonio Gomes  <agomes at rim.com>
    
            Reviewed by Daniel Bates.
    
            Spatial Navigation: code clean up (part III)
            https://bugs.webkit.org/show_bug.cgi?id=50666
    
            No new tests needed.
    
            * page/SpatialNavigation.h: Added FocusCandidate::isFrameOwnerElement and
            WebCore::frameOwnerElement helper functions.
            (WebCore::FocusCandidate::isFrameOwnerElement): Returns true if the Node pointer
            wrapped by FocusCandidate is an instance of HTMLFrameOwnerElement. Returns false
            otherwise.
            * page/SpatialNavigation.cpp:
            (WebCore::frameOwnerElement): Returns the HTMLFrameOwnerElement associated with
            the FocusCandidate if appropriate.
            * page/FocusController.cpp:
            (WebCore::updateFocusCandidateIfNeeded): Make use of newly added frameOwnerElement() helper.
            (WebCore::FocusController::adva
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74003 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3818e2b..ea07510 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2010-12-13  Antonio Gomes  <agomes at rim.com>
+
+        Reviewed by Daniel Bates.
+
+        Spatial Navigation: code clean up (part III)
+        https://bugs.webkit.org/show_bug.cgi?id=50666
+
+        No new tests needed.
+
+        * page/SpatialNavigation.h: Added FocusCandidate::isFrameOwnerElement and
+        WebCore::frameOwnerElement helper functions.
+        (WebCore::FocusCandidate::isFrameOwnerElement): Returns true if the Node pointer
+        wrapped by FocusCandidate is an instance of HTMLFrameOwnerElement. Returns false
+        otherwise.
+        * page/SpatialNavigation.cpp:
+        (WebCore::frameOwnerElement): Returns the HTMLFrameOwnerElement associated with
+        the FocusCandidate if appropriate.
+        * page/FocusController.cpp:
+        (WebCore::updateFocusCandidateIfNeeded): Make use of newly added frameOwnerElement() helper.
+        (WebCore::FocusController::advanceFocusDirectionallyInContainer): Ditto.
+
 2010-12-13  Mike Lawther  <mikelawther at chromium.org>
 
         Reviewed by Daniel Bates.
diff --git a/WebCore/page/FocusController.cpp b/WebCore/page/FocusController.cpp
index 094acd6..620d98a 100644
--- a/WebCore/page/FocusController.cpp
+++ b/WebCore/page/FocusController.cpp
@@ -41,7 +41,6 @@
 #include "FrameTree.h"
 #include "FrameView.h"
 #include "HTMLAreaElement.h"
-#include "HTMLFrameOwnerElement.h"
 #include "HTMLImageElement.h"
 #include "HTMLNames.h"
 #include "HitTestResult.h"
@@ -419,7 +418,7 @@ static void updateFocusCandidateIfNeeded(FocusDirection direction, const IntRect
         return;
 
     // Ignore iframes that don't have a src attribute
-    if (candidate.visibleNode->isFrameOwnerElement() && (!static_cast<HTMLFrameOwnerElement*>(candidate.visibleNode)->contentFrame() || candidate.rect.isEmpty()))
+    if (frameOwnerElement(candidate) && (!frameOwnerElement(candidate)->contentFrame() || candidate.rect.isEmpty()))
         return;
 
     // Ignore off screen child nodes of containers that do not scroll (overflow:hidden)
@@ -509,8 +508,8 @@ bool FocusController::advanceFocusDirectionallyInContainer(Node* container, cons
         // Return false will cause a re-try, skipping this container.
         return false;
     }
-    if (focusCandidate.visibleNode->isFrameOwnerElement()) {
-        HTMLFrameOwnerElement* frameElement = static_cast<HTMLFrameOwnerElement*>(focusCandidate.visibleNode);
+
+    if (HTMLFrameOwnerElement* frameElement = frameOwnerElement(focusCandidate)) {
         // If we have an iframe without the src attribute, it will not have a contentFrame().
         // We ASSERT here to make sure that
         // updateFocusCandidateIfNeeded() will never consider such an iframe as a candidate.
diff --git a/WebCore/page/SpatialNavigation.cpp b/WebCore/page/SpatialNavigation.cpp
index 5f270ba..0cd86e0 100644
--- a/WebCore/page/SpatialNavigation.cpp
+++ b/WebCore/page/SpatialNavigation.cpp
@@ -33,7 +33,6 @@
 #include "FrameTree.h"
 #include "FrameView.h"
 #include "HTMLAreaElement.h"
-#include "HTMLFrameOwnerElement.h"
 #include "HTMLImageElement.h"
 #include "HTMLMapElement.h"
 #include "HTMLNames.h"
@@ -702,5 +701,9 @@ IntRect virtualRectForAreaElementAndDirection(FocusDirection direction, HTMLArea
     return rect;
 }
 
+HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate& candidate)
+{
+    return candidate.isFrameOwnerElement() ? static_cast<HTMLFrameOwnerElement*>(candidate.visibleNode) : 0;
+};
 
 } // namespace WebCore
diff --git a/WebCore/page/SpatialNavigation.h b/WebCore/page/SpatialNavigation.h
index 6ef0058..c051441 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"
 
@@ -116,6 +117,7 @@ struct FocusCandidate {
     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; }
 
     // We handle differently visibleNode and FocusableNode to properly handle the areas of imagemaps,
@@ -145,6 +147,8 @@ IntRect nodeRectInAbsoluteCoordinates(Node*, bool ignoreBorder = false);
 IntRect frameRectInAbsoluteCoordinates(Frame*);
 IntRect virtualRectForDirection(FocusDirection, const IntRect& startingRect, int width = 0);
 IntRect virtualRectForAreaElementAndDirection(FocusDirection, HTMLAreaElement*);
+HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate&);
+
 } // namspace WebCore
 
 #endif // SpatialNavigation_h

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list