Bug 273248 - AX: Implement off-main-thread support for AXTextMarkerRangeForLineAttribute
Summary: AX: Implement off-main-thread support for AXTextMarkerRangeForLineAttribute
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: 2024-04-25 08:35 PDT by Tyler Wilcock
Modified: 2024-04-27 12:21 PDT (History)
9 users (show)

See Also:


Attachments
Patch (23.08 KB, patch)
2024-04-25 08:48 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (23.76 KB, patch)
2024-04-25 12:31 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (23.80 KB, patch)
2024-04-27 08:41 PDT, 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 2024-04-25 08:35:56 PDT
...
Comment 1 Radar WebKit Bug Importer 2024-04-25 08:36:08 PDT
<rdar://problem/127052882>
Comment 2 Tyler Wilcock 2024-04-25 08:48:04 PDT
Created attachment 471127 [details]
Patch
Comment 3 Tyler Wilcock 2024-04-25 12:31:07 PDT
Created attachment 471135 [details]
Patch
Comment 4 chris fleizach 2024-04-27 08:28:59 PDT
Comment on attachment 471135 [details]
Patch

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

> Source/WebCore/accessibility/AXTextMarker.h:199
> +    AXTextMarkerRange markerRangeForLine(unsigned lineIndex) const;

markerRangeForLineIndex(unsigned)

> Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:2351
> +    else if ([parameter isKindOfClass:[NSValue class]] && !strcmp([(NSValue*)parameter objCType], @encode(NSRange)))

NSValue *

> Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:3797
> +    if (AXObjectCache::clientIsInTestMode()) {

UNLIKELY()
Comment 5 Tyler Wilcock 2024-04-27 08:41:27 PDT
Created attachment 471181 [details]
Patch
Comment 6 Tyler Wilcock 2024-04-27 08:44:02 PDT
(In reply to chris fleizach from comment #4)
> Comment on attachment 471135 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=471135&action=review
> 
> > Source/WebCore/accessibility/AXTextMarker.h:199
> > +    AXTextMarkerRange markerRangeForLine(unsigned lineIndex) const;
> 
> markerRangeForLineIndex(unsigned)
> 
> > Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:2351
> > +    else if ([parameter isKindOfClass:[NSValue class]] && !strcmp([(NSValue*)parameter objCType], @encode(NSRange)))
> 
> NSValue *
> 
> > Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:3797
> > +    if (AXObjectCache::clientIsInTestMode()) {
> 
> UNLIKELY()
AXObjectCache::clientIsInTestMode() is defined wrapping the entire expression in UNLIKELY, so we shouldn't need it at any callsites. Addressed the other two comments, thanks!

bool AXObjectCache::clientIsInTestMode()
{
    return UNLIKELY(isTestAXClientType(_AXGetClientForCurrentRequestUntrusted()));
}
Comment 7 EWS 2024-04-27 12:21:53 PDT
Committed 278081@main (1dd6d95b8d00): <https://commits.webkit.org/278081@main>

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