[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:25 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit af84fda010b339ec10705bd1c87911e6b7d81875
Author: tonikitoo at webkit.org <tonikitoo at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Dec 14 06:51:52 2010 +0000
2010-12-13 Antonio Gomes <agomes at rim.com>
Reviewed by Daniel Bates.
Spatial Navigation: code clean up (part IV)
https://bugs.webkit.org/show_bug.cgi?id=50666
Avoid calling canScrollInDirection more than necessary.
No new tests needed.
* page/FocusController.cpp:
(WebCore::FocusController::advanceFocusDirectionallyInContainer): Moved the call to canScrollInDirection()
to within the scrollInDirection().
* page/SpatialNavigation.cpp: Removed the assertion to canScrollingDirection function.
(WebCore::scrollInDirection):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74004 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ea07510..dbabf75 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,23 @@
Reviewed by Daniel Bates.
+ Spatial Navigation: code clean up (part IV)
+ https://bugs.webkit.org/show_bug.cgi?id=50666
+
+ Avoid calling canScrollInDirection more than necessary.
+
+ No new tests needed.
+
+ * page/FocusController.cpp:
+ (WebCore::FocusController::advanceFocusDirectionallyInContainer): Moved the call to canScrollInDirection()
+ to within the scrollInDirection().
+ * page/SpatialNavigation.cpp: Removed the assertion to canScrollingDirection function.
+ (WebCore::scrollInDirection):
+
+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
diff --git a/WebCore/page/FocusController.cpp b/WebCore/page/FocusController.cpp
index 620d98a..a6dc676 100644
--- a/WebCore/page/FocusController.cpp
+++ b/WebCore/page/FocusController.cpp
@@ -500,13 +500,10 @@ bool FocusController::advanceFocusDirectionallyInContainer(Node* container, cons
findFocusCandidateInContainer(container, newStartingRect, direction, event, focusCandidate);
if (focusCandidate.isNull()) {
- if (canScrollInDirection(direction, container)) {
- // Nothing to focus, scroll if possible.
- scrollInDirection(container, direction);
- return true;
- }
- // Return false will cause a re-try, skipping this container.
- return false;
+ // Nothing to focus, scroll if possible.
+ // NOTE: If no scrolling is performed (i.e. scrollInDirection returns false), the
+ // spatial navigation algorithm will skip this container.
+ return scrollInDirection(container, direction);
}
if (HTMLFrameOwnerElement* frameElement = frameOwnerElement(focusCandidate)) {
diff --git a/WebCore/page/SpatialNavigation.cpp b/WebCore/page/SpatialNavigation.cpp
index 0cd86e0..5d12f72 100644
--- a/WebCore/page/SpatialNavigation.cpp
+++ b/WebCore/page/SpatialNavigation.cpp
@@ -334,7 +334,7 @@ bool hasOffscreenRect(Node* node, FocusDirection direction)
bool scrollInDirection(Frame* frame, FocusDirection direction)
{
- ASSERT(frame && canScrollInDirection(direction, frame->document()));
+ ASSERT(frame);
if (frame && canScrollInDirection(direction, frame->document())) {
int dx = 0;
@@ -365,13 +365,14 @@ bool scrollInDirection(Frame* frame, FocusDirection direction)
bool scrollInDirection(Node* container, FocusDirection direction)
{
+ ASSERT(container);
if (container->isDocumentNode())
return scrollInDirection(static_cast<Document*>(container)->frame(), direction);
if (!container->renderBox())
return false;
- if (container && canScrollInDirection(direction, container)) {
+ if (canScrollInDirection(direction, container)) {
int dx = 0;
int dy = 0;
switch (direction) {
@@ -397,6 +398,7 @@ bool scrollInDirection(Node* container, FocusDirection direction)
container->renderBox()->enclosingLayer()->scrollByRecursively(dx, dy);
return true;
}
+
return false;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list