[webkit-reviews] review denied: [Bug 97825] AX: labelForElement is slow when there are a lot of DOM elements : [Attachment 166411] Fix compile

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 1 14:11:49 PDT 2012


Ryosuke Niwa <rniwa at webkit.org> has denied  review:
Bug 97825: AX: labelForElement is slow when there are a lot of DOM elements
https://bugs.webkit.org/show_bug.cgi?id=97825

Attachment 166411: Fix compile
https://bugs.webkit.org/attachment.cgi?id=166411&action=review

------- Additional Comments from Ryosuke Niwa <rniwa at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=166411&action=review


Sorry, I don't want to be a pain but I don't think we should land the patch as
is.

> Source/WebCore/ChangeLog:12
> +	   Adds a new accessibility cache that maps ids to label elements
> +	   that label that id. The cache is built the first time it's
> +	   queried (per document), and then updated every time a label
> +	   element on the page is created, deleted, or modified.
> +	   This allows for very fast lookup of the label for any element.

We don't normally add new code that's unused. Where is this code used? Or where
will it be used?
It seems like we don't need this hash map at all if we had used LabelsNodeList
and then made it cache named ids like we do for HTMLCollection.

> Source/WebCore/accessibility/AXObjectCache.cpp:687
> +	   HashMap<String, HTMLLabelElement*>* documentMapping = new
HashMap<String, HTMLLabelElement*>();

Please use OwnPtr.


More information about the webkit-reviews mailing list