Bug 247948 - AX: Optimize shouldIgnoreGroup to avoid calling AccessibilityObject::textUnderElement unnecessarily.
Summary: AX: Optimize shouldIgnoreGroup to avoid calling AccessibilityObject::textUnde...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Andres Gonzalez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-11-15 09:13 PST by Andres Gonzalez
Modified: 2022-11-16 05:30 PST (History)
10 users (show)

See Also:


Attachments
Patch (2.94 KB, patch)
2022-11-15 09:18 PST, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (2.94 KB, patch)
2022-11-15 11:18 PST, 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 2022-11-15 09:13:09 PST
This function can be optimized.
Comment 1 Radar WebKit Bug Importer 2022-11-15 09:13:21 PST
<rdar://problem/102370543>
Comment 2 Andres Gonzalez 2022-11-15 09:18:10 PST
Created attachment 463533 [details]
Patch
Comment 3 chris fleizach 2022-11-15 10:08:15 PST
Comment on attachment 463533 [details]
Patch

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

> Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm:132
> +    if (!first || first != axObject.lastChild() || first->roleValue() != AccessibilityRole::StaticText)

is checking roleValue() faster than getting lastChild?
Comment 4 Andres Gonzalez 2022-11-15 11:18:10 PST
Created attachment 463537 [details]
Patch
Comment 5 Andres Gonzalez 2022-11-15 11:19:51 PST
(In reply to chris fleizach from comment #3)
> Comment on attachment 463533 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=463533&action=review
> 
> > Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm:132
> > +    if (!first || first != axObject.lastChild() || first->roleValue() != AccessibilityRole::StaticText)
> 
> is checking roleValue() faster than getting lastChild?

Yes, fixed.
Comment 6 EWS 2022-11-16 05:30:36 PST
Committed 256730@main (8f48b85eab58): <https://commits.webkit.org/256730@main>

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