[Webkit-unassigned] [Bug 47142] Spatial navigation not Working for Map and Area Tags

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Dec 5 07:01:52 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=47142





--- Comment #15 from Yael <yael.aharon at nokia.com>  2010-12-05 07:01:52 PST ---
(In reply to comment #14)
Thanks for he review, Antonio.

> I do not like the special case you gave for area elements. Maybe we should have a FocusCandidate.isAreaElement() method instead and handling the changes accordingly. It is very implicit for who read the code what or when use 'node' instead of 'actualNode' , and vice-versa.
> 
> Could we try something to improve this?
I agree that node and actualNode are poor choice for names. How about if we turn FocusCandidate into a class with 2 accessor functions: visibleNode() and focusableNode() ? If we add FocusCandidate.isAreaElement(), the logic of handling HTMLAreaElements would be spread through the spatial navigation code instead of being encapsulated in FocusCandidate, which is what I was trying to do.


> > WebCore/page/SpatialNavigation.cpp:701
> > +    IntRect rect = virtualRectForDirection(direction, rectToAbsoluteCoordinates(area->document()->frame(), area->getRect(area->imageElement()->renderer())), 1);
> 
> Could you please explain the '1' with other words here. I did not follow it :(

I was hoping that comment #13 would explain that :-)
HTMLAreaElements are not necessarily rects, and if we use the bounding rects for the spatial navigation algorithm, we might skip some overlapping nodes. Just look at http://www.mozilla.org/access/qa/tiny/map_area.html for an example of a "busy" image map.
In order to make that page work, I needed a way to "shrink" the bounding rects of HTMLAreaElements. The way I did it is by constructing a rect that starts at the same position as HTMLAreaElement::getRect(), but it has a 1 pixel width or height, depending on the direction of navigation.
This avoids the overlap, and now I can reach all the areas in that imagemap.
This works well also with the imagemap at the top of www.ebay.com, which is not using rects either.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list