Bug 206009 - WKAccessibilityWebPageObject should use Accessibility::retrieveValueFromMainThread.
Summary: WKAccessibilityWebPageObject should use Accessibility::retrieveValueFromMainT...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andres Gonzalez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-01-09 08:14 PST by Andres Gonzalez
Modified: 2020-01-09 13:40 PST (History)
4 users (show)

See Also:


Attachments
Patch (8.01 KB, patch)
2020-01-09 08:45 PST, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (8.20 KB, patch)
2020-01-09 10:22 PST, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (8.20 KB, patch)
2020-01-09 10:52 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 2020-01-09 08:14:39 PST
Make WKAccessibilityWebPageObjectt should use Accessibility::retrieveValueFromMainThread.
Comment 1 Andres Gonzalez 2020-01-09 08:45:19 PST
Created attachment 387235 [details]
Patch
Comment 2 chris fleizach 2020-01-09 09:09:16 PST
Comment on attachment 387235 [details]
Patch

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

> Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:193
> +        return [NSValue valueWithPoint:(NSPoint)protectedSelf->m_page->accessibilityPosition()];

we should also check 
'if (!protectedSelf->m_page) here

> Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:203
> +            if (protectedSelf->m_page->corePage()->pageOverlayController().copyAccessibilityAttributeBoolValueForPoint(attribute, point, boolValue))

if (!protectedSelf->m_page)

> Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:208
> +            if (protectedSelf->m_page->corePage()->pageOverlayController().copyAccessibilityAttributeStringValueForPoint(attribute, point, stringValue))

if (!protectedSelf->m_page)
Comment 3 Andres Gonzalez 2020-01-09 10:22:41 PST
Created attachment 387242 [details]
Patch
Comment 4 Andres Gonzalez 2020-01-09 10:25:36 PST
(In reply to chris fleizach from comment #2)
> Comment on attachment 387235 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=387235&action=review

Also added the check in line 118.
> 
> > Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:193
> > +        return [NSValue valueWithPoint:(NSPoint)protectedSelf->m_page->accessibilityPosition()];
> 
> we should also check 
> 'if (!protectedSelf->m_page) here

Done.
> 
> > Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:203
> > +            if (protectedSelf->m_page->corePage()->pageOverlayController().copyAccessibilityAttributeBoolValueForPoint(attribute, point, boolValue))
> 
> if (!protectedSelf->m_page)

Done.
> 
> > Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:208
> > +            if (protectedSelf->m_page->corePage()->pageOverlayController().copyAccessibilityAttributeStringValueForPoint(attribute, point, stringValue))
> 
> if (!protectedSelf->m_page)

Done.
Comment 5 Dean Jackson 2020-01-09 10:38:43 PST
Comment on attachment 387242 [details]
Patch

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

Is there any testable behaviour here?

> Source/WebKit/ChangeLog:3
> +        WKAccessibilityWebPageObjectt should use Accessibility::retrieveValueFromMainThread.

Typo Objectt

> Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:56
> +#define PROTECTED_SELF protectedSelf = RetainPtr<WKAccessibilityWebPageObject>(self)

We don't normally do something like this. We just duplicate the code. I don't really mind though.
Comment 6 Andres Gonzalez 2020-01-09 10:52:08 PST
Created attachment 387244 [details]
Patch
Comment 7 Andres Gonzalez 2020-01-09 11:00:59 PST
(In reply to Dean Jackson from comment #5)
> Comment on attachment 387242 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=387242&action=review
> 
> Is there any testable behaviour here?

Thanks Dean. We don't have a framework to test the WKAccessibilityWebPageObject functionality. We are working on a way to test the accessibility multi-threaded mode though, but are not there yet.

> 
> > Source/WebKit/ChangeLog:3
> > +        WKAccessibilityWebPageObjectt should use Accessibility::retrieveValueFromMainThread.
> 
> Typo Objectt

Fixed.
> 
> > Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:56
> > +#define PROTECTED_SELF protectedSelf = RetainPtr<WKAccessibilityWebPageObject>(self)
> 
> We don't normally do something like this. We just duplicate the code. I
> don't really mind though.

Thought that it is more readable this way.
Comment 8 WebKit Commit Bot 2020-01-09 13:39:50 PST
Comment on attachment 387244 [details]
Patch

Clearing flags on attachment: 387244

Committed r254294: <https://trac.webkit.org/changeset/254294>
Comment 9 WebKit Commit Bot 2020-01-09 13:39:51 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2020-01-09 13:40:13 PST
<rdar://problem/58455650>