Title: [170670] trunk/Source/WebKit2
Revision
170670
Author
cfleiz...@apple.com
Date
2014-07-01 15:25:25 -0700 (Tue, 01 Jul 2014)

Log Message

AX: [iOS WebKit2] Support for Speak selection
https://bugs.webkit.org/show_bug.cgi?id=134512

Reviewed by Darin Adler.

Implement a method that Speak Selection can use to retrieve the selected content.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView accessibilityRetrieveSpeakSelectionContent]):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (170669 => 170670)


--- trunk/Source/WebKit2/ChangeLog	2014-07-01 22:19:55 UTC (rev 170669)
+++ trunk/Source/WebKit2/ChangeLog	2014-07-01 22:25:25 UTC (rev 170670)
@@ -1,3 +1,15 @@
+2014-07-01  Chris Fleizach  <cfleiz...@apple.com>
+
+        AX: [iOS WebKit2] Support for Speak selection
+        https://bugs.webkit.org/show_bug.cgi?id=134512
+
+        Reviewed by Darin Adler.
+
+        Implement a method that Speak Selection can use to retrieve the selected content.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
+
 2014-07-01  Anders Carlsson  <ander...@apple.com>
 
         Update the highest back-forward list item ID in the other WebBackForwardListItem constructor

Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (170669 => 170670)


--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2014-07-01 22:19:55 UTC (rev 170669)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2014-07-01 22:25:25 UTC (rev 170670)
@@ -191,6 +191,10 @@
 
 @end
 
+@interface WKContentView (WKInteractionPrivate)
+- (void)accessibilitySpeakSelectionSetContent:(NSString *)string;
+@end
+
 @implementation WKContentView (WKInteraction)
 
 static UIWebSelectionMode toUIWebSelectionMode(WKSelectionGranularity granularity)
@@ -1357,6 +1361,16 @@
     });
 }
 
+- (void)accessibilityRetrieveSpeakSelectionContent
+{
+    _page->getSelectionOrContentsAsString([self](const String& string, CallbackBase::Error error) {
+        if (error != CallbackBase::Error::None)
+            return;
+        if ([self respondsToSelector:@selector(accessibilitySpeakSelectionSetContent:)])
+            [self accessibilitySpeakSelectionSetContent:string];
+    });
+}
+
 // UIWKInteractionViewProtocol
 
 static inline GestureType toGestureType(UIWKGestureType gestureType)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to