Bug 205210 - Isolated object implementation of parameterized attribute SelectTextWithCriteria.
Summary: Isolated object implementation of parameterized attribute SelectTextWithCrite...
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: 2019-12-13 11:19 PST by Andres Gonzalez
Modified: 2019-12-16 10:49 PST (History)
10 users (show)

See Also:


Attachments
Patch (22.64 KB, patch)
2019-12-13 11:55 PST, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (25.12 KB, patch)
2019-12-13 14:12 PST, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (27.02 KB, patch)
2019-12-16 07: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 2019-12-13 11:19:20 PST
Isolated object implementation of parameterized attribute SelectTextWithCriteria.
Comment 1 Andres Gonzalez 2019-12-13 11:55:13 PST
Created attachment 385625 [details]
Patch
Comment 2 chris fleizach 2019-12-13 12:13:51 PST
Comment on attachment 385625 [details]
Patch

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

> Source/WebCore/accessibility/AccessibilityRenderObject.cpp:-3577
> -    ASSERT(roleValue() == AccessibilityRole::TabList);

worried that this might populate tabChildren for elements not expected to have any... maybe we can change this to

if (role != TabList)
   return

> Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.cpp:696
> +Vector<RefPtr<Range>> AXIsolatedObject::findTextRanges(AccessibilitySearchTextCriteria const& criteria) const

what's the implication of returning a Range from the main thread to a secondary thread?

> Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:101
>              m_semaphore.signal();

can you rename execute to something that is more meaningful in explaining that it will dispatch to the main thread

> Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:104
> +        CFRunLoopRunInMode(kCFRunLoopDefaultMode, .25, false);

put a comment why we need to spin the run loop
Comment 3 Andres Gonzalez 2019-12-13 14:12:12 PST
Created attachment 385642 [details]
Patch
Comment 4 Andres Gonzalez 2019-12-13 14:21:46 PST
(In reply to chris fleizach from comment #2)
> Comment on attachment 385625 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=385625&action=review
> 
> > Source/WebCore/accessibility/AccessibilityRenderObject.cpp:-3577
> > -    ASSERT(roleValue() == AccessibilityRole::TabList);
> 
> worried that this might populate tabChildren for elements not expected to
> have any... maybe we can change this to
> 
> if (role != TabList)
>    return

Done.
> 
> > Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.cpp:696
> > +Vector<RefPtr<Range>> AXIsolatedObject::findTextRanges(AccessibilitySearchTextCriteria const& criteria) const
> 
> what's the implication of returning a Range from the main thread to a
> secondary thread?

This function is only used in the wrapper and will be always be executed inside a block dispatched to the main thread. You are right, it won't work if we return this value outside the main thread, but that is not happening.
> 
> > Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:101
> >              m_semaphore.signal();
> 
> can you rename execute to something that is more meaningful in explaining
> that it will dispatch to the main thread

Renamed it executeOnAXThreadIfPossible.
> 
> > Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:104
> > +        CFRunLoopRunInMode(kCFRunLoopDefaultMode, .25, false);
> 
> put a comment why we need to spin the run loop

Done.
Comment 5 Andres Gonzalez 2019-12-16 07:52:57 PST
Created attachment 385766 [details]
Patch
Comment 6 chris fleizach 2019-12-16 08:41:45 PST
Comment on attachment 385766 [details]
Patch

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

> Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h:50
> +    AXObjectCache* axObjectCache() const { return m_axObjectCache; }

feel like we should assert main thread in this getter
Comment 7 Andres Gonzalez 2019-12-16 10:04:29 PST
(In reply to chris fleizach from comment #6)
> Comment on attachment 385766 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=385766&action=review
> 
> > Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h:50
> > +    AXObjectCache* axObjectCache() const { return m_axObjectCache; }
> 
> feel like we should assert main thread in this getter

Will do. Thanks.
Comment 8 WebKit Commit Bot 2019-12-16 10:48:01 PST
Comment on attachment 385766 [details]
Patch

Clearing flags on attachment: 385766

Committed r253565: <https://trac.webkit.org/changeset/253565>
Comment 9 WebKit Commit Bot 2019-12-16 10:48:03 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2019-12-16 10:49:19 PST
<rdar://problem/57976699>