Backport to qtwebkit-2.1 the fixes for #49442 and #49382
authorYael Aharon <yael.aharon@nokia.com>
Wed, 24 Nov 2010 01:55:31 +0000 (20:55 -0500)
committerAdemar de Souza Reis Jr <ademar.reis@openbossa.org>
Wed, 24 Nov 2010 19:38:10 +0000 (16:38 -0300)
commit0f2e0cc960f49a04e4bd86a7f36373697b660bda
tree77588e2b12f732d5bc842fa1670ea124de0de33e
parentdf0e5bce1826f5ac9b62fbf7aaa45ee045f3ae33
Backport to qtwebkit-2.1 the fixes for #49442 and #49382

Patch from Yael Aharon <yael.aharon@nokia.com>
http://gitorious.org/~yael/webkit/yaels-qtwebkit/commit/d7788b5e68b9a6909e4a6c545e4b233729921d38

Original changelogs:

    Spatial Navigation: Code cleanup
    https://bugs.webkit.org/show_bug.cgi?id=49442

    Remove code that is not used anymore after http://trac.webkit.org/changeset/72522.
    Added const to canBeScrolledIntoView.
    No new tests because this is only code cleanup.

and

    Spatial Navigation: issues with the node selection algorithm.
    https://bugs.webkit.org/show_bug.cgi?id=49382

    Modify the Spatial Navigation algorithm, to better handle initial focus and
    navigation between frames.
    The new algorithm takes the rect of the focused node as the startingRect,
    instead of the node itself. That allows us to construct a virtual rect if
    there is no focused node, or if it is off the screen.
    The virtual rect is the edge of the container in the direction of the navigation.

    With this patch, scrollable containers and frames will scroll regardless of weather
    they have focusable content. Users will be able to use arrow keys to view all the
    content of such a container. The only exception is if the container has style overflow:hidden.
    We will not scroll in that case.

    With this patch, we handle z-index and positioning so that if there are 2 overlapping focusable nodes,
    we do a hit test and only the node on top can get focus.

    hasOffScreenRect() was modified so that it can check if a node will be off-screen even after we scrolled
    its parent container. We do not add the scrolling conditions for containers that have overflow:hidden
    and cannot scroll.

    calculateScrollbarModesForLayout is used to decide if a frame can scroll or not. We cannot rely on
    the exsistance of the scrollbar, because it could be removed via the API, while the frame is still
    allowed to scroll.
18 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/events/spatial-navigation/snav-clipped-overflowed-content-expected.txt
LayoutTests/fast/events/spatial-navigation/snav-clipped-overflowed-content.html
LayoutTests/fast/events/spatial-navigation/snav-div-scrollable-but-without-focusable-content-expected.txt
LayoutTests/fast/events/spatial-navigation/snav-div-scrollable-but-without-focusable-content.html
LayoutTests/fast/events/spatial-navigation/snav-iframe-no-focusable-content-expected.txt
LayoutTests/fast/events/spatial-navigation/snav-iframe-no-focusable-content.html
LayoutTests/fast/events/spatial-navigation/snav-iframe-no-scrollable-content-expected.txt
LayoutTests/fast/events/spatial-navigation/snav-iframe-no-scrollable-content.html
LayoutTests/fast/events/spatial-navigation/snav-iframe-with-offscreen-focusable-element-expected.txt
LayoutTests/fast/events/spatial-navigation/snav-iframe-with-offscreen-focusable-element.html
WebCore/ChangeLog
WebCore/page/FocusController.cpp
WebCore/page/FocusController.h
WebCore/page/FrameView.cpp
WebCore/page/FrameView.h
WebCore/page/SpatialNavigation.cpp
WebCore/page/SpatialNavigation.h