Spatial navigation not Working for Map and Area Tags
authoryael.aharon@nokia.com <yael.aharon@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Dec 2010 19:04:10 +0000 (19:04 +0000)
committeryael.aharon@nokia.com <yael.aharon@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Dec 2010 19:04:10 +0000 (19:04 +0000)
commit94bd8e7f3d231603805f2a64aa2b7a1183d8521a
tree112db748ef858afd75e62b8d4a1b415622b1572e
parentdcf271ff8e464984f9ce3e02751b1e755d364f0b
Spatial navigation not Working for Map and Area Tags
https://bugs.webkit.org/show_bug.cgi?id=47142

Reviewed by Antonio Gomes.

WebCore:

Give area elements special treatment in spatial navigation algorithm by getting the
rect of the area from the associated image. Since area elements are likely to overlap
if they are not rects, or if authors are not careful, we flatten the rect of area elements.

Tests: fast/spatial-navigation/snav-imagemap-area-not-focusable.html
       fast/spatial-navigation/snav-imagemap-area-without-image.html
       fast/spatial-navigation/snav-imagemap-overlapped-areas.html
       fast/spatial-navigation/snav-imagemap-simple.html

* page/FocusController.cpp:
(WebCore::FocusController::findFocusCandidateInContainer):
(WebCore::FocusController::advanceFocusDirectionallyInContainer):
(WebCore::FocusController::advanceFocusDirectionally):
* page/SpatialNavigation.cpp:
(WebCore::FocusCandidate::FocusCandidate):
(WebCore::virtualRectForDirection):
(WebCore::virtualRectForAreaElementAndDirection):
* page/SpatialNavigation.h:
(WebCore::FocusCandidate::FocusCandidate):

LayoutTests:

* fast/spatial-navigation/snav-imagemap-area-not-focusable-expected.txt: Added.
* fast/spatial-navigation/snav-imagemap-area-not-focusable.html: Added.
* fast/spatial-navigation/snav-imagemap-area-without-image-expected.txt: Added.
* fast/spatial-navigation/snav-imagemap-area-without-image.html: Added.
* fast/spatial-navigation/snav-imagemap-overlapped-areas-expected.txt: Added.
* fast/spatial-navigation/snav-imagemap-overlapped-areas.html: Added.
* fast/spatial-navigation/snav-imagemap-simple-expected.txt: Added.
* fast/spatial-navigation/snav-imagemap-simple.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73452 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/spatial-navigation/snav-imagemap-area-not-focusable-expected.txt [new file with mode: 0644]
LayoutTests/fast/spatial-navigation/snav-imagemap-area-not-focusable.html [new file with mode: 0644]
LayoutTests/fast/spatial-navigation/snav-imagemap-area-without-image-expected.txt [new file with mode: 0644]
LayoutTests/fast/spatial-navigation/snav-imagemap-area-without-image.html [new file with mode: 0644]
LayoutTests/fast/spatial-navigation/snav-imagemap-overlapped-areas-expected.txt [new file with mode: 0644]
LayoutTests/fast/spatial-navigation/snav-imagemap-overlapped-areas.html [new file with mode: 0644]
LayoutTests/fast/spatial-navigation/snav-imagemap-simple-expected.txt [new file with mode: 0644]
LayoutTests/fast/spatial-navigation/snav-imagemap-simple.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/page/FocusController.cpp
WebCore/page/SpatialNavigation.cpp
WebCore/page/SpatialNavigation.h