Navigating downwards / upwards does not focus on the links spread across more than... qtwebkit-2.1-week08
authorAdemar de Souza Reis Jr <ademar.reis@openbossa.org>
Fri, 25 Feb 2011 19:16:03 +0000 (16:16 -0300)
committerAdemar de Souza Reis Jr <ademar.reis@openbossa.org>
Fri, 25 Feb 2011 19:16:03 +0000 (16:16 -0300)
commit3721aa13a701117c3f2c7990dc0c2beed99c5b97
treea193cede9c1e5c91dc13ec27833bb59128ab2e25
parent45527cd4cb9e2d7c00da2c72ae9f04172e36a4b3
Navigating downwards / upwards does not focus on the links spread across more than one line.
https://bugs.webkit.org/show_bug.cgi?id=54639

Reviewed by Antonio Gomes.

Source/WebCore:

When 2 anchor elements span more than one line each, and one ends on the same line that the
second starts on, the rects reported by their renderers are overlapping. When handling
2 overlapping nodes, check for this case, and don't assume that one of the nodes is on a higher layer.

Test: fast/spatial-navigation/snav-two-elements-one-line.html

* page/FocusController.cpp:
(WebCore::updateFocusCandidateIfNeeded):
(WebCore::FocusController::findFocusCandidateInContainer):
* page/SpatialNavigation.cpp:
(WebCore::areElementsOnSameLine):
(WebCore::distanceDataForNode):
* page/SpatialNavigation.h:

LayoutTests:

* fast/spatial-navigation/snav-two-elements-one-line-expected.txt: Added.
* fast/spatial-navigation/snav-two-elements-one-line.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@79021 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Conflicts:

Source/WebCore/ChangeLog
Source/WebCore/page/FocusController.cpp
Source/WebCore/page/SpatialNavigation.cpp
Source/WebCore/page/SpatialNavigation.h
LayoutTests/ChangeLog
LayoutTests/fast/spatial-navigation/snav-two-elements-one-line-expected.txt [new file with mode: 0644]
LayoutTests/fast/spatial-navigation/snav-two-elements-one-line.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/page/FocusController.cpp
WebCore/page/SpatialNavigation.cpp
WebCore/page/SpatialNavigation.h