Bug 42474

Summary: Spatial navigation: do not consider outline for focusable element boundaries
Product: WebKit Reporter: Antonio Gomes <tonikitoo>
Component: AccessibilityAssignee: Antonio Gomes <tonikitoo>
Status: CLOSED FIXED    
Severity: Normal CC: hausmann, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Bug Depends on:    
Bug Blocks: 18662    
Attachments:
Description Flags
patch - use getRect instead of absoluteClippedOverflowRect
none
(r63572, r=smfr) patch v2 - right patch none

Description Antonio Gomes 2010-07-16 11:35:50 PDT
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.

// Returns the rect that should be repainted whenever this object changes.  The rect is in the view's
// coordinate space.  This method deals with outlines and overflow.
IntRect absoluteClippedOverflowRect()
{
  ...
}

It makes spatial navigation to fail on common sites like google.gom: "Web, Images, Map, etc" are inaccessible.

Patch with a test coming ...
Comment 1 Antonio Gomes 2010-07-16 11:45:33 PDT
Created attachment 61832 [details]
patch - use getRect instead of absoluteClippedOverflowRect

It fixes problem of zero-margin content (see layout test in the patch).
Comment 2 Antonio Gomes 2010-07-16 11:50:34 PDT
Created attachment 61834 [details]
(r63572, r=smfr) patch v2 - right patch

Right patch this time.

See comment #1 for description.
Comment 3 Simon Fraser (smfr) 2010-07-16 11:52:27 PDT
Comment on attachment 61834 [details]
(r63572, r=smfr) patch v2 - right patch

r=me, but note that getRect() respects CSS transforms now, where absoluteClippedOverflowRect() did not, iirc.
Comment 4 Antonio Gomes 2010-07-16 11:58:39 PDT
(In reply to comment #3)
> (From update of attachment 61834 [details])
> r=me, 

Thank you!

> but note that getRect() respects CSS transforms now, where absoluteClippedOverflowRect() did not, iirc.

getRect is not currently transform-aware, although it could be. It calls RenderObject::absoluteBoundingBoxRect (which is transform-aware), but look at the call site and method signature.

IntRect Node::getRect() const
{
    // FIXME: broken with transforms
    if (renderer())
        return renderer()->absoluteBoundingBoxRect();
..

// FIXME: useTransforms should go away eventually
IntRect absoluteBoundingBoxRect(bool useTransforms = false);

The caller 'd have to be absoluteBoundingBoxRect(true);

Should I fix that in another bug?
Comment 5 Simon Fraser (smfr) 2010-07-16 12:11:58 PDT
The patch in bug 41259 changes getRect().
Comment 6 Antonio Gomes 2010-07-16 12:50:09 PDT
Comment on attachment 61834 [details]
(r63572, r=smfr) patch v2 - right patch

Clearing flags on attachment: 61834

Committed r63572: <http://trac.webkit.org/changeset/63572>
Comment 7 Simon Hausmann 2010-07-26 04:15:16 PDT
Revision r63572 cherry-picked into qtwebkit-2.0 with commit e70ca4c61a9dfc24875482c3184faaa34c08fb96