Title: [176318] trunk
Revision
176318
Author
[email protected]
Date
2014-11-19 07:47:16 -0800 (Wed, 19 Nov 2014)

Log Message

AX: Screen braille input doesn't work on forms.
https://bugs.webkit.org/show_bug.cgi?id=138804

Reviewed by Mario Sanchez Prada.

Source/WebCore:

Allow iOS to set values of text fields through the API.

Test: platform/ios-sim/accessibility/set-value.html

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilitySetValue:]):

Tools:

Add a method to setValue through the AX API in DRT.

* DumpRenderTree/AccessibilityUIElement.cpp:
(setValueCallback):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::setValue):
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::setValue):

LayoutTests:

* platform/ios-sim: Copied from LayoutTests/platform/ios-sim.
* platform/ios-sim/accessibility/set-value-expected.txt: Added.
* platform/ios-sim/accessibility/set-value.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (176317 => 176318)


--- trunk/LayoutTests/ChangeLog	2014-11-19 15:40:35 UTC (rev 176317)
+++ trunk/LayoutTests/ChangeLog	2014-11-19 15:47:16 UTC (rev 176318)
@@ -1,3 +1,14 @@
+2014-11-19  Chris Fleizach  <[email protected]>
+
+        AX: Screen braille input doesn't work on forms.
+        https://bugs.webkit.org/show_bug.cgi?id=138804
+
+        Reviewed by Mario Sanchez Prada.
+
+        * platform/ios-sim: Copied from LayoutTests/platform/ios-sim.
+        * platform/ios-sim/accessibility/set-value-expected.txt: Added.
+        * platform/ios-sim/accessibility/set-value.html: Added.
+
 2014-11-19  Dhi Aurrahman  <[email protected]>
 
         Add selector checker for :lang pseudo class in Selectors level 4

Added: trunk/LayoutTests/platform/ios-sim/accessibility/set-value-expected.txt (0 => 176318)


--- trunk/LayoutTests/platform/ios-sim/accessibility/set-value-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios-sim/accessibility/set-value-expected.txt	2014-11-19 15:47:16 UTC (rev 176318)
@@ -0,0 +1,12 @@
+
+This makes sure that you can set the ax value through accessibility.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Initial value : AXValue: 
+Final value : AXValue: TEST
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/ios-sim/accessibility/set-value.html (0 => 176318)


--- trunk/LayoutTests/platform/ios-sim/accessibility/set-value.html	                        (rev 0)
+++ trunk/LayoutTests/platform/ios-sim/accessibility/set-value.html	2014-11-19 15:47:16 UTC (rev 176318)
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+<script>
+var successfullyParsed = false;
+</script>
+</head>
+<body id="body">
+
+<input type="text" id="text">
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This makes sure that you can set the ax value through accessibility.");
+
+    if (window.accessibilityController) {
+
+        var textField = accessibilityController.accessibleElementById("text");
+        debug("Initial value : " + textField.iphoneValue);
+        textField.setValue("TEST");
+        debug("Final value : " + textField.iphoneValue);
+    }
+
+    successfullyParsed = true;
+</script>
+
+<script src=""
+</body>
+</html>
+

Modified: trunk/Source/WebCore/ChangeLog (176317 => 176318)


--- trunk/Source/WebCore/ChangeLog	2014-11-19 15:40:35 UTC (rev 176317)
+++ trunk/Source/WebCore/ChangeLog	2014-11-19 15:47:16 UTC (rev 176318)
@@ -1,3 +1,17 @@
+2014-11-19  Chris Fleizach  <[email protected]>
+
+        AX: Screen braille input doesn't work on forms.
+        https://bugs.webkit.org/show_bug.cgi?id=138804
+
+        Reviewed by Mario Sanchez Prada.
+
+        Allow iOS to set values of text fields through the API.
+
+        Test: platform/ios-sim/accessibility/set-value.html
+
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+        (-[WebAccessibilityObjectWrapper _accessibilitySetValue:]):
+
 2014-11-19  Zalan Bujtas  <[email protected]>
 
         Simple line layout: Add renderer based rect collecting to RunResolver.

Modified: trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (176317 => 176318)


--- trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm	2014-11-19 15:40:35 UTC (rev 176317)
+++ trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm	2014-11-19 15:47:16 UTC (rev 176318)
@@ -1625,6 +1625,13 @@
     return YES;
 }
 
+- (void)_accessibilitySetValue:(NSString *)string
+{
+    if (![self _prepareAccessibilityCall])
+        return;
+    m_object->setValue(string);
+}
+
 - (NSString *)stringForTextMarkers:(NSArray *)markers
 {
     if (![self _prepareAccessibilityCall])

Modified: trunk/Tools/ChangeLog (176317 => 176318)


--- trunk/Tools/ChangeLog	2014-11-19 15:40:35 UTC (rev 176317)
+++ trunk/Tools/ChangeLog	2014-11-19 15:47:16 UTC (rev 176318)
@@ -1,3 +1,21 @@
+2014-11-19  Chris Fleizach  <[email protected]>
+
+        AX: Screen braille input doesn't work on forms.
+        https://bugs.webkit.org/show_bug.cgi?id=138804
+
+        Reviewed by Mario Sanchez Prada.
+
+        Add a method to setValue through the AX API in DRT.
+
+        * DumpRenderTree/AccessibilityUIElement.cpp:
+        (setValueCallback):
+        (AccessibilityUIElement::getJSClass):
+        * DumpRenderTree/AccessibilityUIElement.h:
+        * DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
+        (AccessibilityUIElement::setValue):
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+        (AccessibilityUIElement::setValue):
+
 2014-11-18  Csaba Osztrogonác  <[email protected]>
 
         Remove the WinCairo buildbot

Modified: trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp (176317 => 176318)


--- trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp	2014-11-19 15:40:35 UTC (rev 176317)
+++ trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp	2014-11-19 15:47:16 UTC (rev 176318)
@@ -438,6 +438,19 @@
     return JSValueMakeBoolean(context, toAXElement(thisObject)->isEqual(toAXElement(otherElement)));
 }
 
+static JSValueRef setValueCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    JSRetainPtr<JSStringRef> valueText = 0;
+    if (argumentCount == 1) {
+        if (JSValueIsString(context, arguments[0]))
+            valueText.adopt(JSValueToStringCopy(context, arguments[0], exception));
+    }
+    
+    toAXElement(thisObject)->setValue(valueText.get());
+    
+    return JSValueMakeUndefined(context);
+}
+
 static JSValueRef setSelectedChildCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     JSObjectRef element = 0;
@@ -1337,6 +1350,7 @@
 
 #if !PLATFORM(MAC) && !PLATFORM(IOS)
 JSStringRef AccessibilityUIElement::pathDescription() const { return 0; }
+void AccessibilityUIElement::setValue(JSStringRef);
 #endif
 
 #if !PLATFORM(COCOA)
@@ -1628,6 +1642,7 @@
         { "previousTextMarker", previousTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "stringForTextMarkerRange", stringForTextMarkerRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setSelectedChild", setSelectedChildCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "setValue", setValueCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "selectedChildAtIndex", selectedChildAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "scrollToMakeVisible", scrollToMakeVisibleCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
 #if PLATFORM(GTK) || PLATFORM(EFL)

Modified: trunk/Tools/DumpRenderTree/AccessibilityUIElement.h (176317 => 176318)


--- trunk/Tools/DumpRenderTree/AccessibilityUIElement.h	2014-11-19 15:40:35 UTC (rev 176317)
+++ trunk/Tools/DumpRenderTree/AccessibilityUIElement.h	2014-11-19 15:47:16 UTC (rev 176318)
@@ -123,6 +123,7 @@
     JSStringRef language();
     JSStringRef stringValue();
     JSStringRef accessibilityValue() const;
+    void setValue(JSStringRef);
     JSStringRef helpText() const;
     JSStringRef orientation() const;
     double x();

Modified: trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm (176317 => 176318)


--- trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm	2014-11-19 15:40:35 UTC (rev 176317)
+++ trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm	2014-11-19 15:47:16 UTC (rev 176318)
@@ -76,6 +76,7 @@
 - (void)accessibilitySetPostedNotificationCallback:(AXPostedNotificationCallback)function withContext:(void*)context;
 - (CGFloat)_accessibilityMinValue;
 - (CGFloat)_accessibilityMaxValue;
+- (void)_accessibilitySetValue:(NSString *)value;
 @end
 
 @interface NSObject (WebAccessibilityObjectWrapperPrivate)
@@ -526,6 +527,11 @@
     return [m_element _accessibilityMaxValue];
 }
 
+void AccessibilityUIElement::setValue(JSStringRef valueText)
+{
+    [m_element _accessibilitySetValue:[NSString stringWithJSStringRef:valueText]];
+}
+
 JSStringRef AccessibilityUIElement::valueDescription()
 {
     return JSStringCreateWithCharacters(0, 0);

Modified: trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm (176317 => 176318)


--- trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm	2014-11-19 15:40:35 UTC (rev 176317)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm	2014-11-19 15:47:16 UTC (rev 176318)
@@ -1343,6 +1343,13 @@
     END_AX_OBJC_EXCEPTIONS
 }
 
+void AccessibilityUIElement::setValue(JSStringRef valueText)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    [m_element accessibilitySetValue:[NSString stringWithJSStringRef:valueText] forAttribute:NSAccessibilityValueAttribute];
+    END_AX_OBJC_EXCEPTIONS
+}
+
 void AccessibilityUIElement::increment()
 {
     BEGIN_AX_OBJC_EXCEPTIONS
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to