[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:18:30 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit a2bb1224ea3a6a428934344d619fa7236ca2c69d
Author: tonikitoo at webkit.org <tonikitoo at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Dec 9 18:53:47 2010 +0000
2010-12-07 Antonio Gomes <agomes at rim.com>
Reviewed by Daniel Bates.
Spatial Navigation: code clean up
https://bugs.webkit.org/show_bug.cgi?id=50666
Patch unifies two FocusCandidate constructors, making caller sites
simpler. Now the special handling HTMLAreaElement gets is done within
the non default constructor (i.e. FocusCanditate(Node*, FocusDirection)).
No new tests needed.
* page/FocusController.cpp:
(WebCore::FocusController::findFocusCandidateInContainer):
* page/SpatialNavigation.cpp:
(WebCore::FocusCandidate::FocusCandidate):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73627 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1d76905..c58544c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-12-07 Antonio Gomes <agomes at rim.com>
+
+ Reviewed by Daniel Bates.
+
+ Spatial Navigation: code clean up
+ https://bugs.webkit.org/show_bug.cgi?id=50666
+
+ Patch unifies two FocusCandidate constructors, making caller sites
+ simpler. Now the special handling HTMLAreaElement gets is done within
+ the non default constructor (i.e. FocusCanditate(Node*, FocusDirection)).
+
+ No new tests needed.
+
+ * page/FocusController.cpp:
+ (WebCore::FocusController::findFocusCandidateInContainer):
+ * page/SpatialNavigation.cpp:
+ (WebCore::FocusCandidate::FocusCandidate):
+
2010-12-09 Philippe Normand <pnormand at igalia.com>
Reviewed by Eric Carlson.
diff --git a/WebCore/page/FocusController.cpp b/WebCore/page/FocusController.cpp
index 55009a6..9cf48cf 100644
--- a/WebCore/page/FocusController.cpp
+++ b/WebCore/page/FocusController.cpp
@@ -478,21 +478,10 @@ void FocusController::findFocusCandidateInContainer(Node* container, const IntRe
if (!node->isKeyboardFocusable(event) && !node->isFrameOwnerElement() && !canScrollInDirection(direction, node))
continue;
- if (node->hasTagName(areaTag)) {
- HTMLAreaElement* area = static_cast<HTMLAreaElement*>(node);
- FocusCandidate candidate(area, direction);
- if (candidate.isNull())
- continue;
-
- candidate.enclosingScrollableBox = container;
- updateFocusCandidateIfNeeded(direction, startingRect, candidate, closest);
- continue;
- }
-
- if (!node->renderer())
+ FocusCandidate candidate = FocusCandidate(node, direction);
+ if (candidate.isNull())
continue;
- FocusCandidate candidate(node, direction);
candidate.enclosingScrollableBox = container;
updateFocusCandidateIfNeeded(direction, startingRect, candidate, closest);
}
diff --git a/WebCore/page/SpatialNavigation.cpp b/WebCore/page/SpatialNavigation.cpp
index 1750500..f6ba009 100644
--- a/WebCore/page/SpatialNavigation.cpp
+++ b/WebCore/page/SpatialNavigation.cpp
@@ -36,6 +36,7 @@
#include "HTMLFrameOwnerElement.h"
#include "HTMLImageElement.h"
#include "HTMLMapElement.h"
+#include "HTMLNames.h"
#include "IntRect.h"
#include "Node.h"
#include "Page.h"
@@ -55,20 +56,6 @@ static void entryAndExitPointsForDirection(FocusDirection direction, const IntRe
FocusCandidate::FocusCandidate(Node* n, FocusDirection direction)
- : visibleNode(n)
- , focusableNode(n)
- , enclosingScrollableBox(0)
- , distance(maxDistance())
- , parentDistance(maxDistance())
- , alignment(None)
- , parentAlignment(None)
- , rect(nodeRectInAbsoluteCoordinates(n, true /* ignore border */))
- , isOffscreen(hasOffscreenRect(n))
- , isOffscreenAfterScrolling(hasOffscreenRect(n, direction))
-{
-}
-
-FocusCandidate::FocusCandidate(HTMLAreaElement* area, FocusDirection direction)
: visibleNode(0)
, focusableNode(0)
, enclosingScrollableBox(0)
@@ -79,15 +66,25 @@ FocusCandidate::FocusCandidate(HTMLAreaElement* area, FocusDirection direction)
, isOffscreen(true)
, isOffscreenAfterScrolling(true)
{
- HTMLImageElement* image = area->imageElement();
- if (!image)
- return;
+ if (n->hasTagName(HTMLNames::areaTag)) {
+ HTMLAreaElement* area = static_cast<HTMLAreaElement*>(n);
+ HTMLImageElement* image = area->imageElement();
+ if (!image || !image->renderer())
+ return;
+
+ visibleNode = image;
+ rect = virtualRectForAreaElementAndDirection(direction, area);
+ } else {
+ if (!n->renderer())
+ return;
+
+ visibleNode = n;
+ rect = nodeRectInAbsoluteCoordinates(n, true /* ignore border */);
+ }
- focusableNode = area;
- visibleNode = image;
- rect = virtualRectForAreaElementAndDirection(direction, area);
- isOffscreen = hasOffscreenRect(image);
- isOffscreenAfterScrolling = hasOffscreenRect(image, direction);
+ focusableNode = n;
+ isOffscreen = hasOffscreenRect(visibleNode);
+ isOffscreenAfterScrolling = hasOffscreenRect(visibleNode, direction);
}
bool isSpatialNavigationEnabled(const Frame* frame)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list