Bug 222125 - AX: Update macOS attribute initializers to be more modern
Summary: AX: Update macOS attribute initializers to be more modern
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-18 12:32 PST by chris fleizach
Modified: 2021-02-18 12:32 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description chris fleizach 2021-02-18 12:32:21 PST
> Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:1601
> +        auto tempArray = adoptNS([[NSMutableArray alloc] initWithArray:attributes]);
> +        [tempArray addObject:NSAccessibilityEmbeddedImageDescriptionAttribute];
> +        [tempArray addObject:NSAccessibilityURLAttribute];
> +        imageAttrs = tempArray.leakRef();
> +    }


adoptNS(...).leakRef() seems to be a no-op, so I'm not sure what it's doing here. This applies to all the other initializers in this function as well.

Additionally, it's a little weird that every attribute dictionary is initialized the first time this method is called, rather than have a separate static/NeverDestroyed method for each, so the cost is only paid when at item of the specific type is passed in.
Comment 1 Radar WebKit Bug Importer 2021-02-18 12:32:40 PST
<rdar://problem/74489846>