Bug 134512 - AX: [iOS WebKit2] Support for Speak selection
Summary: AX: [iOS WebKit2] Support for Speak selection
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: chris fleizach
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-07-01 14:32 PDT by chris fleizach
Modified: 2014-07-01 15:26 PDT (History)
7 users (show)

See Also:


Attachments
patch (1.80 KB, patch)
2014-07-01 14:46 PDT, chris fleizach
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description chris fleizach 2014-07-01 14:32:22 PDT
WebKit2 needs support for speak selection

<rdar://problem/15212005>
Comment 1 chris fleizach 2014-07-01 14:46:44 PDT
Created attachment 234199 [details]
patch
Comment 2 Darin Adler 2014-07-01 14:51:14 PDT
Comment on attachment 234199 [details]
patch

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

> Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:1371
> +    _page->getSelectionOrContentsAsString([self](const String& string, CallbackBase::Error error) {
> +        if (error != CallbackBase::Error::None)
> +            return;
> +        if ([self respondsToSelector:@selector(accessibilitySpeakSelectionSetContent:)])
> +            [self accessibilitySpeakSelectionSetContent:string];
> +    });

Is there a guarantee we won’t get the callback after self is deallocated? Do we need to retain/release self?

> Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:1372
> +

Stray blank line.
Comment 3 chris fleizach 2014-07-01 15:02:50 PDT
(In reply to comment #2)
> (From update of attachment 234199 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=234199&action=review
> 
> > Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:1371
> > +    _page->getSelectionOrContentsAsString([self](const String& string, CallbackBase::Error error) {
> > +        if (error != CallbackBase::Error::None)
> > +            return;
> > +        if ([self respondsToSelector:@selector(accessibilitySpeakSelectionSetContent:)])
> > +            [self accessibilitySpeakSelectionSetContent:string];
> > +    });
> 
> Is there a guarantee we won’t get the callback after self is deallocated? Do we need to retain/release self?

This is basically what define: does as well, so if that case is safe so will this one. 

Maybe someone else is able to speak to whether the connection callback blocks are torn down safely when WKContentView goes away...

> 
> > Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:1372
> > +
> 
> Stray blank line.

Thanks!
Comment 4 chris fleizach 2014-07-01 15:26:00 PDT
http://trac.webkit.org/changeset/170670