Changeset 63572 in webkit


Ignore:
Timestamp:
Jul 16, 2010 12:45:50 PM (14 years ago)
Author:
tonikitoo@webkit.org
Message:

Spatial navigation: do not consider outline for focusable element boundaries
https://bugs.webkit.org/show_bug.cgi?id=42474

Reviewed by Simon Fraser.
Patch by Antonio Gomes <tonikitoo@webkit.org>

WebCore:

Test: fast/events/spatial-navigation/snav-zero-margin-content.html

Currently in WebCore::renderRectRelativeToRootDocument function, we are calling
RenderObject::absoluteClippedOverflowRect to obtain the rect boundary of a given
renderer/element. This method deals with outline, which is out of elements boundary.
It makes spatial navigation to fail on common sites like google.gom: "Web, Images, Map, etc"
are inaccessible.

Patch replaces RenderObject::absoluteClippedOverflowRect by Node::getRect,
which returns only the absolute bounding box rect of the Element.

  • page/SpatialNavigation.cpp:

(WebCore::renderRectRelativeToRootDocument):
(WebCore::checkNegativeCoordsForNode):

LayoutTests:

  • fast/events/spatial-navigation/snav-zero-margin-content-expected.txt: Added.
  • fast/events/spatial-navigation/snav-zero-margin-content.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r63568 r63572  
     12010-07-16  Antonio Gomes  <tonikitoo@webkit.org>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Spatial navigation: do not consider outline for focusable element boundaries
     6        https://bugs.webkit.org/show_bug.cgi?id=42474
     7
     8        * fast/events/spatial-navigation/snav-zero-margin-content-expected.txt: Added.
     9        * fast/events/spatial-navigation/snav-zero-margin-content.html: Added.
     10
    1112010-07-16  Ojan Vafai  <ojan@chromium.org>
    212
  • trunk/WebCore/ChangeLog

    r63571 r63572  
     12010-07-16  Antonio Gomes  <tonikitoo@webkit.org>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Spatial navigation: do not consider outline for focusable element boundaries
     6        https://bugs.webkit.org/show_bug.cgi?id=42474
     7
     8        Test: fast/events/spatial-navigation/snav-zero-margin-content.html
     9
     10        Currently in WebCore::renderRectRelativeToRootDocument function, we are calling
     11        RenderObject::absoluteClippedOverflowRect to obtain the rect boundary of a given
     12        renderer/element. This method deals with outline, which is out of elements boundary.
     13        It makes spatial navigation to fail on common sites like google.gom: "Web, Images, Map, etc"
     14        are inaccessible.
     15
     16        Patch replaces RenderObject::absoluteClippedOverflowRect by Node::getRect,
     17        which returns only the absolute bounding box rect of the Element.
     18
     19        * page/SpatialNavigation.cpp:
     20        (WebCore::renderRectRelativeToRootDocument):
     21        (WebCore::checkNegativeCoordsForNode):
     22
    1232010-07-15  Antonio Gomes  <tonikitoo@webkit.org>
    224
  • trunk/WebCore/page/SpatialNavigation.cpp

    r62179 r63572  
    104104static IntRect renderRectRelativeToRootDocument(RenderObject* render)
    105105{
    106     ASSERT(render);
    107 
    108     IntRect rect(render->absoluteClippedOverflowRect());
    109 
    110     if (rect.isEmpty()) {
    111         Element* e = static_cast<Element*>(render->node());
    112         rect = e->getRect();
    113     }
     106    ASSERT(render && render->node());
     107
     108    IntRect rect = render->node()->getRect();
    114109
    115110    // In cases when the |render|'s associated node is in a scrollable inner
     
    518513    ASSERT(node || node->renderer());
    519514
    520     if (curRect.x() > 0 && curRect.y() > 0)
     515    if (curRect.x() >= 0 && curRect.y() >= 0)
    521516        return true;
    522517
Note: See TracChangeset for help on using the changeset viewer.