AX: AXSelectTextWithCriteria should support capitalize/lowercase/uppercase
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 May 2014 16:17:47 +0000 (16:17 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 May 2014 16:17:47 +0000 (16:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=132622

Reviewed by Mario Sanchez Prada.

Source/WebCore:
The select text with criteria mechanism used through accessibility needs to support
a few more parameters to be complete (including capitalize, lowercase and uppercase).

Updated: accessibility/select-text.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::selectText):
* accessibility/AccessibilityObject.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(accessibilitySelectTextCriteriaForCriteriaParameterizedAttribute):
* rendering/RenderText.cpp:
(WebCore::makeCapitalized):
* rendering/RenderText.h:

Tools:
* DumpRenderTree/AccessibilityUIElement.cpp:
(selectTextWithCriteriaCallback):
(isEqualCallback):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
(AccessibilityUIElement::selectTextWithCriteria):
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::selectTextWithCriteria):
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(selectTextParameterizedAttributeForCriteria):
(AccessibilityUIElement::selectTextWithCriteria):
* DumpRenderTree/win/AccessibilityUIElementWin.cpp:
(AccessibilityUIElement::selectTextWithCriteria):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
(WTR::AccessibilityUIElement::selectTextWithCriteria):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::selectTextWithCriteria):
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::selectTextWithCriteria):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::selectTextParameterizedAttributeForCriteria):
(WTR::AccessibilityUIElement::selectTextWithCriteria):

LayoutTests:
* platform/mac/accessibility/select-text-expected.txt:
* platform/mac/accessibility/select-text.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168427 268f45cc-cd09-0410-ab3c-d52691b4dbfc

22 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/accessibility/select-text-expected.txt
LayoutTests/platform/mac/accessibility/select-text.html
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Source/WebCore/rendering/RenderText.cpp
Source/WebCore/rendering/RenderText.h
Tools/ChangeLog
Tools/DumpRenderTree/AccessibilityUIElement.cpp
Tools/DumpRenderTree/AccessibilityUIElement.h
Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp
Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm
Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h
Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp
Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm

index 2edb5be..d9967e4 100644 (file)
@@ -1,3 +1,13 @@
+2014-05-07  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: AXSelectTextWithCriteria should support capitalize/lowercase/uppercase
+        https://bugs.webkit.org/show_bug.cgi?id=132622
+
+        Reviewed by Mario Sanchez Prada.
+
+        * platform/mac/accessibility/select-text-expected.txt:
+        * platform/mac/accessibility/select-text.html:
+
 2014-05-07  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
 
         Share mac/editing/spelling/editing-multiple-words-with-markers.html with other platforms
index c5620d6..d4ade52 100644 (file)
@@ -1,4 +1,4 @@
-The slow brown cat jumps over the lazy dog.
+The slow BROWN cat jumps over the lazy dog.
 
 This tests the ability to select and replace text with respect to selection.
 
@@ -21,6 +21,12 @@ PASS result is 'quick'
 PASS selection is 'slow'
 PASS result is 'fox'
 PASS selection is 'cat'
+PASS result is 'brown'
+PASS selection is 'Brown'
+PASS result is 'Brown'
+PASS selection is 'brown'
+PASS result is 'brown'
+PASS selection is 'BROWN'
 PASS successfullyParsed is true
 
 TEST COMPLETE
index dbd7f37..03eabce 100644 (file)
         shouldBe("result", "'fox'");
         selection = selectedText();
         shouldBe("selection", "'cat'");
+
+        // Select brown and capitalize it.
+        selectElementText(target);
+        result = text.selectTextWithCriteria("AXSelectTextAmbiguityResolutionClosestToSelection", "brown", null, "AXSelectTextActivityFindAndCapitalize");
+        shouldBe("result", "'brown'");
+        selection = selectedText();
+        shouldBe("selection", "'Brown'");
+
+        // Select Brown and lowercase it.
+        selectElementText(target);
+        result = text.selectTextWithCriteria("AXSelectTextAmbiguityResolutionClosestToSelection", "Brown", null, "AXSelectTextActivityFindAndLowercase");
+        shouldBe("result", "'Brown'");
+        selection = selectedText();
+        shouldBe("selection", "'brown'");
+
+        // Select brown and uppercase it.
+        selectElementText(target);
+        result = text.selectTextWithCriteria("AXSelectTextAmbiguityResolutionClosestToSelection", "brown", null, "AXSelectTextActivityFindAndUppercase");
+        shouldBe("result", "'brown'");
+        selection = selectedText();
+        shouldBe("selection", "'BROWN'");
+
     }
 </script>
 
index 92366a7..0f10e3d 100644 (file)
@@ -1,3 +1,24 @@
+2014-05-07  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: AXSelectTextWithCriteria should support capitalize/lowercase/uppercase
+        https://bugs.webkit.org/show_bug.cgi?id=132622
+
+        Reviewed by Mario Sanchez Prada.
+
+        The select text with criteria mechanism used through accessibility needs to support
+        a few more parameters to be complete (including capitalize, lowercase and uppercase).
+
+        Updated: accessibility/select-text.html
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::selectText):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (accessibilitySelectTextCriteriaForCriteriaParameterizedAttribute):
+        * rendering/RenderText.cpp:
+        (WebCore::makeCapitalized):
+        * rendering/RenderText.h:
+
 2014-05-07  peavo@outlook.com  <peavo@outlook.com>
 
         DocumentLoader::dataReceived assertion failed
index f1ed8fc..fd53075 100644 (file)
@@ -54,6 +54,7 @@
 #include "RenderListItem.h"
 #include "RenderListMarker.h"
 #include "RenderMenuList.h"
+#include "RenderText.h"
 #include "RenderTextControl.h"
 #include "RenderTheme.h"
 #include "RenderView.h"
@@ -629,14 +630,33 @@ String AccessibilityObject::selectText(AccessibilitySelectTextCriteria* criteria
     // Determine which candidate is closest to the selection and perform the activity.
     if (RefPtr<Range> closestStringRange = rangeClosestToRange(selectedStringRange.get(), closestAfterStringRange, closestBeforeStringRange)) {
         String closestString = closestStringRange->text();
+        bool replaceSelection = false;
         if (frame->selection().setSelectedRange(closestStringRange.get(), DOWNSTREAM, true)) {
             switch (activity) {
+            case FindAndCapitalize: {
+                replacementString = closestString;
+                makeCapitalized(&replacementString, 0);
+                replaceSelection = true;
+                break;
+            }
+            case FindAndUppercase:
+                replacementString = closestString.upper();
+                replaceSelection = true;
+                break;
+            case FindAndLowercase:
+                replacementString = closestString.lower();
+                replaceSelection = true;
+                break;
             case FindAndReplaceActivity:
-                frame->editor().replaceSelectionWithText(replacementString, true, true);
-                FALLTHROUGH;
+                replaceSelection = true;
+                break;
             case FindAndSelectActivity:
-                return closestString;
+                break;
             }
+            
+            if (replaceSelection)
+                frame->editor().replaceSelectionWithText(replacementString, true, true);
+            return closestString;
         }
     }
     
index 5d24df1..b46a078 100644 (file)
@@ -391,7 +391,10 @@ struct PlainTextRange {
 
 enum AccessibilitySelectTextActivity {
     FindAndReplaceActivity,
-    FindAndSelectActivity
+    FindAndSelectActivity,
+    FindAndCapitalize,
+    FindAndLowercase,
+    FindAndUppercase
 };
 
 enum AccessibilitySelectTextAmbiguityResolution {
index 40e9bb3..e5f8c34 100644 (file)
@@ -404,6 +404,18 @@ using namespace HTMLNames;
 #define NSAccessibilitySelectTextActivityFindAndSelect @"AXSelectTextActivityFindAndSelect"
 #endif
 
+#ifndef kAXSelectTextActivityFindAndCapitalize
+#define kAXSelectTextActivityFindAndCapitalize @"AXSelectTextActivityFindAndCapitalize"
+#endif
+
+#ifndef kAXSelectTextActivityFindAndLowercase
+#define kAXSelectTextActivityFindAndLowercase @"AXSelectTextActivityFindAndLowercase"
+#endif
+
+#ifndef kAXSelectTextActivityFindAndUppercase
+#define kAXSelectTextActivityFindAndUppercase @"AXSelectTextActivityFindAndUppercase"
+#endif
+
 #ifndef NSAccessibilitySelectTextAmbiguityResolution
 #define NSAccessibilitySelectTextAmbiguityResolution @"AXSelectTextAmbiguityResolution"
 #endif
@@ -662,6 +674,12 @@ static AccessibilitySelectTextCriteria accessibilitySelectTextCriteriaForCriteri
     if ([activityParameter isKindOfClass:[NSString class]]) {
         if ([activityParameter isEqualToString:NSAccessibilitySelectTextActivityFindAndReplace])
             activity = FindAndReplaceActivity;
+        else if ([activityParameter isEqualToString:kAXSelectTextActivityFindAndCapitalize])
+            activity = FindAndCapitalize;
+        else if ([activityParameter isEqualToString:kAXSelectTextActivityFindAndLowercase])
+            activity = FindAndLowercase;
+        else if ([activityParameter isEqualToString:kAXSelectTextActivityFindAndUppercase])
+            activity = FindAndUppercase;
     }
     
     AccessibilitySelectTextAmbiguityResolution ambiguityResolution = ClosestToSelectionAmbiguityResolution;
index 6f8b56d..98b6a29 100644 (file)
@@ -111,7 +111,7 @@ static HashMap<const RenderText*, String>& originalTextMap()
     return map;
 }
 
-static void makeCapitalized(String* string, UChar previous)
+void makeCapitalized(String* string, UChar previous)
 {
     // FIXME: Need to change this to use u_strToTitle instead of u_totitle and to consider locale.
 
index f914777..aa516b6 100644 (file)
@@ -242,7 +242,8 @@ inline RenderStyle& RenderText::firstLineStyle() const
 }
 
 void applyTextTransform(const RenderStyle&, String&, UChar);
-
+void makeCapitalized(String*, UChar previous);
+    
 inline RenderText* Text::renderer() const
 {
     return toRenderText(Node::renderer());
index 9ed1ef7..8c2a835 100644 (file)
@@ -1,3 +1,35 @@
+2014-05-07  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: AXSelectTextWithCriteria should support capitalize/lowercase/uppercase
+        https://bugs.webkit.org/show_bug.cgi?id=132622
+
+        Reviewed by Mario Sanchez Prada.
+
+        * DumpRenderTree/AccessibilityUIElement.cpp:
+        (selectTextWithCriteriaCallback):
+        (isEqualCallback):
+        * DumpRenderTree/AccessibilityUIElement.h:
+        * DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
+        (AccessibilityUIElement::selectTextWithCriteria):
+        * DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
+        (AccessibilityUIElement::selectTextWithCriteria):
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+        (selectTextParameterizedAttributeForCriteria):
+        (AccessibilityUIElement::selectTextWithCriteria):
+        * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+        (AccessibilityUIElement::selectTextWithCriteria):
+        * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
+        (WTR::AccessibilityUIElement::selectTextWithCriteria):
+        * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
+        * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+        (WTR::AccessibilityUIElement::selectTextWithCriteria):
+        * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
+        (WTR::AccessibilityUIElement::selectTextWithCriteria):
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+        (WTR::selectTextParameterizedAttributeForCriteria):
+        (WTR::AccessibilityUIElement::selectTextWithCriteria):
+
 2014-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [SOUP] TLSErrors do not cause page load to fail when not ignored
index 032794c..ea60c60 100644 (file)
@@ -260,7 +260,7 @@ static JSValueRef uiElementForSearchPredicateCallback(JSContextRef context, JSOb
 
 static JSValueRef selectTextWithCriteriaCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
-    if (argumentCount < 2 || argumentCount > 3)
+    if (argumentCount < 2 || argumentCount > 4)
         return JSValueMakeUndefined(context);
     
     JSRetainPtr<JSStringRef> ambiguityResolution(Adopt, JSValueToStringCopy(context, arguments[0], exception));
@@ -268,8 +268,11 @@ static JSValueRef selectTextWithCriteriaCallback(JSContextRef context, JSObjectR
     JSStringRef replacementString = nullptr;
     if (argumentCount == 3)
         replacementString = JSValueToStringCopy(context, arguments[2], exception);
+    JSStringRef activityString = nullptr;
+    if (argumentCount == 4)
+        activityString = JSValueToStringCopy(context, arguments[3], exception);
     
-    JSRetainPtr<JSStringRef> result(Adopt, toAXElement(thisObject)->selectTextWithCriteria(context, ambiguityResolution.get(), searchStrings, replacementString));
+    JSRetainPtr<JSStringRef> result(Adopt, toAXElement(thisObject)->selectTextWithCriteria(context, ambiguityResolution.get(), searchStrings, replacementString, activityString));
     if (replacementString)
         JSStringRelease(replacementString);
     return JSValueMakeString(context, result.get());
index aa781a6..310c0cf 100644 (file)
@@ -212,7 +212,7 @@ public:
     bool attributedStringRangeIsMisspelled(unsigned location, unsigned length);
     unsigned uiElementCountForSearchPredicate(JSContextRef, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly, bool immediateDescendantsOnly);
     AccessibilityUIElement uiElementForSearchPredicate(JSContextRef, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly, bool immediateDescendantsOnly);
-    JSStringRef selectTextWithCriteria(JSContextRef, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString);
+    JSStringRef selectTextWithCriteria(JSContextRef, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity);
 #if PLATFORM(IOS)
     void elementsForRange(unsigned location, unsigned length, Vector<AccessibilityUIElement>& elements);
     JSStringRef stringForSelection();
index 4d083fe..b24d173 100644 (file)
@@ -1305,7 +1305,7 @@ AccessibilityUIElement AccessibilityUIElement::uiElementForSearchPredicate(JSCon
     return nullptr;
 }
 
-JSStringRef AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString)
+JSStringRef AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity)
 {
     // FIXME: implement
     return nullptr;
index 759d924..4b45f68 100644 (file)
@@ -828,7 +828,7 @@ AccessibilityUIElement AccessibilityUIElement::uiElementForSearchPredicate(JSCon
     return 0;
 }
 
-JSStringRef AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString)
+JSStringRef AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity)
 {
     // FIXME: Implement.
     return nullptr;
index 7ac6728..d22cbd3 100644 (file)
@@ -247,7 +247,7 @@ static NSDictionary *searchPredicateParameterizedAttributeForSearchCriteria(JSCo
     return parameterizedAttribute;
 }
 
-static NSDictionary *selectTextParameterizedAttributeForCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString)
+static NSDictionary *selectTextParameterizedAttributeForCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity)
 {
     NSMutableDictionary *parameterizedAttribute = [NSMutableDictionary dictionary];
     
@@ -285,6 +285,9 @@ static NSDictionary *selectTextParameterizedAttributeForCriteria(JSContextRef co
     } else
         [parameterizedAttribute setObject:@"AXSelectTextActivityFindAndSelect" forKey:@"AXSelectTextActivity"];
     
+    if (activity)
+        [parameterizedAttribute setObject:[NSString stringWithJSStringRef:activity] forKey:@"AXSelectTextActivity"];
+    
     return parameterizedAttribute;
 }
 
@@ -1111,10 +1114,10 @@ AccessibilityUIElement AccessibilityUIElement::uiElementForSearchPredicate(JSCon
     return nullptr;
 }
 
-JSStringRef AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString)
+JSStringRef AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    NSDictionary *parameterizedAttribute = selectTextParameterizedAttributeForCriteria(context, ambiguityResolution, searchStrings, replacementString);
+    NSDictionary *parameterizedAttribute = selectTextParameterizedAttributeForCriteria(context, ambiguityResolution, searchStrings, replacementString, activity);
     id result = [m_element accessibilityAttributeValue:@"AXSelectTextWithCriteria" forParameter:parameterizedAttribute];
     if ([result isKindOfClass:[NSString class]])
         return [result createJSStringRef];
index 1814ed3..0de8985 100644 (file)
@@ -608,7 +608,7 @@ AccessibilityUIElement AccessibilityUIElement::uiElementForSearchPredicate(JSCon
     return 0;
 }
 
-JSStringRef AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString)
+JSStringRef AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity)
 {
     return 0;
 }
index 878074b..39d7aeb 100644 (file)
@@ -178,7 +178,7 @@ JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForRange(unsign
 bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned, unsigned) { return false; }
 unsigned AccessibilityUIElement::uiElementCountForSearchPredicate(JSContextRef, AccessibilityUIElement*, bool, JSValueRef, JSStringRef, bool, bool) { return 0; }
 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::uiElementForSearchPredicate(JSContextRef, AccessibilityUIElement*, bool, JSValueRef, JSStringRef, bool, bool) { return 0; }
-JSRetainPtr<JSStringRef> AccessibilityUIElement::selectTextWithCriteria(JSContextRef, JSStringRef, JSValueRef, JSStringRef) { return nullptr; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::selectTextWithCriteria(JSContextRef, JSStringRef, JSValueRef, JSStringRef, JSStringRef) { return nullptr; }
 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::cellForColumnAndRow(unsigned, unsigned) { return 0; }
 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::horizontalScrollbar() const { return 0; }
 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::verticalScrollbar() const { return 0; }
index 7dfd844..a8938fc 100644 (file)
@@ -208,7 +208,7 @@ public:
     bool attributedStringRangeIsMisspelled(unsigned location, unsigned length);
     unsigned uiElementCountForSearchPredicate(JSContextRef, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly, bool immediateDescendantsOnly);
     PassRefPtr<AccessibilityUIElement> uiElementForSearchPredicate(JSContextRef, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly, bool immediateDescendantsOnly);
-    JSRetainPtr<JSStringRef> selectTextWithCriteria(JSContextRef, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString);
+    JSRetainPtr<JSStringRef> selectTextWithCriteria(JSContextRef, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity);
 
     // Text-specific
     JSRetainPtr<JSStringRef> characterAtOffset(int offset);
index 1baed0a..1261699 100644 (file)
@@ -160,7 +160,7 @@ interface AccessibilityUIElement {
     boolean attributedStringRangeIsMisspelled(unsigned long location, unsigned long length);
     [PassContext] unsigned int uiElementCountForSearchPredicate(AccessibilityUIElement startElement, boolean isDirectionNext, object searchKey, DOMString searchText, boolean visibleOnly, boolean immediateDescendantsOnly);
     [PassContext] AccessibilityUIElement uiElementForSearchPredicate(AccessibilityUIElement startElement, boolean isDirectionNext, object searchKey, DOMString searchText, boolean visibleOnly, boolean immediateDescendantsOnly);
-    [PassContext] DOMString selectTextWithCriteria(DOMString ambiguityResolution, object searchStrings, DOMString replacementString);
+    [PassContext] DOMString selectTextWithCriteria(DOMString ambiguityResolution, object searchStrings, DOMString replacementString, DOMString activity);
     void setSelectedTextRange(unsigned long location, unsigned long length);
 
     // Scroll area attributes.
index d9d4a65..44cae90 100644 (file)
@@ -1460,7 +1460,7 @@ PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::uiElementForSearchPre
     return nullptr;
 }
 
-JSRetainPtr<JSStringRef> AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString)
+JSRetainPtr<JSStringRef> AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity)
 {
     // FIXME: implement
     return nullptr;
index ca2c51b..7c8ce41 100644 (file)
@@ -478,7 +478,7 @@ PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::uiElementForSearchPre
     return nullptr;
 }
 
-JSRetainPtr<JSStringRef> AccessibilityUIElement::selectTextWithCriteria(JSContextRef, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString)
+JSRetainPtr<JSStringRef> AccessibilityUIElement::selectTextWithCriteria(JSContextRef, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity)
 {
     return nullptr;
 }
index e7124af..e1653f2 100644 (file)
@@ -273,7 +273,7 @@ static NSDictionary *searchPredicateParameterizedAttributeForSearchCriteria(JSCo
     return parameterizedAttribute;
 }
 
-static NSDictionary *selectTextParameterizedAttributeForCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString)
+static NSDictionary *selectTextParameterizedAttributeForCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity)
 {
     NSMutableDictionary *parameterizedAttribute = [NSMutableDictionary dictionary];
     
@@ -311,6 +311,9 @@ static NSDictionary *selectTextParameterizedAttributeForCriteria(JSContextRef co
     } else
         [parameterizedAttribute setObject:@"AXSelectTextActivityFindAndSelect" forKey:@"AXSelectTextActivity"];
     
+    if (activity)
+        [parameterizedAttribute setObject:[NSString stringWithJSStringRef:activity] forKey:@"AXSelectTextActivity"];
+    
     return parameterizedAttribute;
 }
 
@@ -1167,10 +1170,10 @@ PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::uiElementForSearchPre
     return nullptr;
 }
 
-JSRetainPtr<JSStringRef> AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString)
+JSRetainPtr<JSStringRef> AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    NSDictionary *parameterizedAttribute = selectTextParameterizedAttributeForCriteria(context, ambiguityResolution, searchStrings, replacementString);
+    NSDictionary *parameterizedAttribute = selectTextParameterizedAttributeForCriteria(context, ambiguityResolution, searchStrings, replacementString, activity);
     id result = [m_element accessibilityAttributeValue:@"AXSelectTextWithCriteria" forParameter:parameterizedAttribute];
     if ([result isKindOfClass:[NSString class]])
         return [result createJSStringRef];