Bug 134512

Summary: AX: [iOS WebKit2] Support for Speak selection
Product: WebKit Reporter: chris fleizach <cfleizach>
Component: AccessibilityAssignee: chris fleizach <cfleizach>
Status: RESOLVED FIXED    
Severity: Normal CC: bunhere, cdumez, commit-queue, gyuyoung.kim, mark.lam, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
patch darin: review+

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