Bug 233767 - AX: In AccessibilityRenderObject::documentLinks, use existing image-map document links instead of always creating new ones
Summary: AX: In AccessibilityRenderObject::documentLinks, use existing image-map docum...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tyler Wilcock
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-12-02 10:03 PST by Tyler Wilcock
Modified: 2021-12-02 20:17 PST (History)
10 users (show)

See Also:


Attachments
Patch (12.66 KB, patch)
2021-12-02 10:11 PST, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (12.65 KB, patch)
2021-12-02 11:27 PST, Tyler Wilcock
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tyler Wilcock 2021-12-02 10:03:18 PST
The current implementation of AccessibilityRenderObject::documentLinks always creates new image-map links rather than using the existing ones created via AccessibilityRenderObject::addImageMapChildren. This is problematic for two reasons:

  1. It is wasteful in terms of memory usage as we will endlessly accumulate AccessibilityImageMapLink objects in the cache each time AccessibilityRenderObject::documentLinks is called.
  2. It breaks document links in isolated tree mode, since the objects created this way aren't a child of any other object, and thus don't have any representation in the isolated tree. Concretely, this means AXIsolatedTree::nodeForID never returns anything for these objects.
Comment 1 Radar WebKit Bug Importer 2021-12-02 10:03:45 PST
<rdar://problem/85976724>
Comment 2 Tyler Wilcock 2021-12-02 10:11:36 PST
Created attachment 445733 [details]
Patch
Comment 3 chris fleizach 2021-12-02 11:22:08 PST
Comment on attachment 445733 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=445733&action=review

> Source/WebCore/accessibility/AccessibilityRenderObject.cpp:2064
> +                    HTMLMapElement& map = downcast<HTMLMapElement>(*parent);

this could be auto& map
Comment 4 Tyler Wilcock 2021-12-02 11:27:50 PST
Created attachment 445754 [details]
Patch
Comment 5 EWS 2021-12-02 20:17:37 PST
Committed r286477 (244816@main): <https://commits.webkit.org/244816@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 445754 [details].