[PATCH] Automatic assignment of accesskeys

Tobias Anton tobias.anton at esc-electronics.de
Fri Apr 8 15:47:24 BST 2005


Am Freitag, 8. April 2005 15:09 schrieb Lubos Lunak:

>  What do you think of it?

Great patch, i'd only change the following:

+            if( element->getAttribute( ATTR_ACCESSKEY ).length() == 1 )
+                continue; // has accesskey set, ignore

check for length() > 0 instead

+                    url = 
khtml::parseURL(element->getAttribute(ATTR_HREF)).string();
+                    if( url.isEmpty()) // doesn't have href [...]
+                        continue;

no need to parseURL, stripWhitespace().length() > 0 should suffice.

Otherwise, the function
	DOM::NodeImpl::isSelectable()
might be useful to determine - in a generic way - whether an accesskey makes 
sense. This way, you could cope with selectable elements whose ID you don't 
know (may happen e.g. when rendering XML or perhaps in case of advanced CSS 
usage).






More information about the kfm-devel mailing list