Bug 228336 - Fix for [WebAccessibilityObjectWrapper lineRectsAndText] to properly handle replacement nodes and SVG text.
Summary: Fix for [WebAccessibilityObjectWrapper lineRectsAndText] to properly handle r...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andres Gonzalez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-07-27 11:13 PDT by Andres Gonzalez
Modified: 2021-08-02 07:43 PDT (History)
11 users (show)

See Also:


Attachments
Patch (7.30 KB, patch)
2021-07-27 11:34 PDT, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (8.44 KB, patch)
2021-07-28 17:29 PDT, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (11.59 KB, patch)
2021-07-30 12:41 PDT, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (13.76 KB, patch)
2021-07-31 13:59 PDT, Andres Gonzalez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andres Gonzalez 2021-07-27 11:13:19 PDT
Fix for [WebAccessibilityObjectWrapper lineRectsAndText] to properly handle replacement nodes and SVG text.
Comment 1 Radar WebKit Bug Importer 2021-07-27 11:13:32 PDT
<rdar://problem/81172124>
Comment 2 Andres Gonzalez 2021-07-27 11:34:06 PDT
Created attachment 434300 [details]
Patch
Comment 3 Darin Adler 2021-07-27 13:49:19 PDT
Comment on attachment 434300 [details]
Patch

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

> Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:2881
> +                [text appendAttributedString:[[NSAttributedString alloc] initWithString:label]];

This isn’t ARC, so I think the leaks the attributed string. Need to release it.
Comment 4 Andres Gonzalez 2021-07-28 17:29:07 PDT
Created attachment 434479 [details]
Patch
Comment 5 Andres Gonzalez 2021-07-28 17:52:59 PDT
(In reply to Darin Adler from comment #3)
> Comment on attachment 434300 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=434300&action=review
> 
> > Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:2881
> > +                [text appendAttributedString:[[NSAttributedString alloc] initWithString:label]];
> 
> This isn’t ARC, so I think the leaks the attributed string. Need to release
> it.

Thanks, I changed it to:

                auto label = adoptNS([[NSAttributedString alloc] initWithString:static_cast<WebAccessibilityObjectWrapper *>(item).accessibilityLabel]);
                [text appendAttributedString:label.get()];
Comment 6 Andres Gonzalez 2021-07-30 12:41:55 PDT
Created attachment 434653 [details]
Patch
Comment 7 Andres Gonzalez 2021-07-31 13:59:49 PDT
Created attachment 434705 [details]
Patch
Comment 8 EWS 2021-08-02 07:43:21 PDT
Committed r280529 (240161@main): <https://commits.webkit.org/240161@main>

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