[webkit-dev] image maps to be focused via tab

Darin Adler darin at apple.com
Sun Nov 9 08:15:10 PST 2008


On Nov 6, 2008, at 5:28 PM, browser webkit wrote:

> In msie/firefox, image map can be TAB focused with outline rendered,  
> but not under webkit based browser.
>
> So, i start to modify code for test. I found have a mapMouseEvent()  
> function in HTMLMapElement.cpp, then if i want to implement the TAB  
> focus in image map, is it necessary to implement a  
> defaultkeyboardevent() function and other things ?

No, you would not add a new function to handle the keyboard event. The  
tab key is implemented for the entire document, not in each node that  
participates in tab navigation.

The code that handles navigation with the tab key is in the  
FocusController class.

     FocusController::advanceFocus

There are also the following key related functions in the Document  
class.

     Document::nextFocusableNode
     Document::previousFocusableNode
     Document::setFocusedNode

However, to make image map focusing these functions would have to be  
changed. To identify an image map element you need to have both the  
image node and the area node inside the map. Because the same image  
map can be used with multiple image nodes.

So we'd have to change things so we can track a particular img/area  
pair, and then also update the code to understand where these fit in  
to the "next focused node" loop and to draw the focus properly.

It's a moderately difficult project.

     -- Darin



More information about the webkit-dev mailing list