Bug 253752 - AX: -[WebAccessibilityObjectWrapperMac attachmentView] should only be called when needed
Summary: AX: -[WebAccessibilityObjectWrapperMac attachmentView] should only be called ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tyler Wilcock
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-03-10 19:40 PST by Tyler Wilcock
Modified: 2023-03-14 11:12 PDT (History)
10 users (show)

See Also:


Attachments
Patch (8.71 KB, patch)
2023-03-10 19:49 PST, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (8.61 KB, patch)
2023-03-10 20:04 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 2023-03-10 19:40:49 PST
There are several places where we repeat calls to -[WebAccessibilityObjectWrapperMac attachmentView] in close succession rather than storing the attachment view in a local variable and re-using it. This is wasteful in ITM as each call requires a separate, synchronous round-trip to the main-thread.
Comment 1 Radar WebKit Bug Importer 2023-03-10 19:40:59 PST
<rdar://problem/106584475>
Comment 2 Tyler Wilcock 2023-03-10 19:49:59 PST
Created attachment 465390 [details]
Patch
Comment 3 chris fleizach 2023-03-10 19:56:37 PST
Comment on attachment 465390 [details]
Patch

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

> Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:3830
> +            }

I think we can get rid of the isAttschment variable and just use whether attachmentView is nil

AddObject: attachmentView ?: wrapper
Comment 4 Tyler Wilcock 2023-03-10 20:04:30 PST
Created attachment 465391 [details]
Patch
Comment 5 Tyler Wilcock 2023-03-10 20:05:10 PST
(In reply to chris fleizach from comment #3)
> Comment on attachment 465390 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=465390&action=review
> 
> > Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:3830
> > +            }
> 
> I think we can get rid of the isAttschment variable and just use whether
> attachmentView is nil
> 
> AddObject: attachmentView ?: wrapper
Good point, thanks! Fixed in latest patch.
Comment 6 EWS 2023-03-13 10:20:43 PDT
commit-queue failed to commit attachment 465391 [details] to WebKit repository. To retry, please set cq+ flag again.
Comment 7 Andres Gonzalez 2023-03-14 08:04:40 PDT
(In reply to Tyler Wilcock from comment #4)
> Created attachment 465391 [details]
> Patch

Would it make sense to get rid of isAttachment() and just have a attachmentView() that returns nil when it is not an attachment?
Comment 8 Tyler Wilcock 2023-03-14 10:02:58 PDT
(In reply to Andres Gonzalez from comment #7)
> (In reply to Tyler Wilcock from comment #4)
> > Created attachment 465391 [details]
> > Patch
> 
> Would it make sense to get rid of isAttachment() and just have a
> attachmentView() that returns nil when it is not an attachment?
Yes, that's a good idea! Will put on my to-do list for a future patch.
Comment 9 EWS 2023-03-14 11:12:32 PDT
Committed 261641@main (f238a7ef7870): <https://commits.webkit.org/261641@main>

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