Title: [176481] trunk
Revision
176481
Author
cfleiz...@apple.com
Date
2014-11-21 16:02:59 -0800 (Fri, 21 Nov 2014)

Log Message

AX: Unclear that user and password are autofilled, no VoiceOver version of the yellow outline.
https://bugs.webkit.org/show_bug.cgi?id=138904

Reviewed by Mario Sanchez Prada.

Source/WebCore:

Add an attribute that marks when a text field is auto-filled.

Test: accessibility/auto-filled-value.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isValueAutofilled):
* accessibility/AccessibilityObject.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

LayoutTests:

* accessibility/auto-filled-value.html: Added.
* platform/mac/accessibility/auto-filled-value-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (176480 => 176481)


--- trunk/LayoutTests/ChangeLog	2014-11-21 23:53:13 UTC (rev 176480)
+++ trunk/LayoutTests/ChangeLog	2014-11-22 00:02:59 UTC (rev 176481)
@@ -1,3 +1,13 @@
+2014-11-21  Chris Fleizach  <cfleiz...@apple.com>
+
+        AX: Unclear that user and password are autofilled, no VoiceOver version of the yellow outline.
+        https://bugs.webkit.org/show_bug.cgi?id=138904
+
+        Reviewed by Mario Sanchez Prada.
+
+        * accessibility/auto-filled-value.html: Added.
+        * platform/mac/accessibility/auto-filled-value-expected.txt: Added.
+
 2014-11-21  Michael Saboff  <msab...@apple.com>
 
         Allocate local ScopeChain register

Added: trunk/LayoutTests/accessibility/auto-filled-value.html (0 => 176481)


--- trunk/LayoutTests/accessibility/auto-filled-value.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/auto-filled-value.html	2014-11-22 00:02:59 UTC (rev 176481)
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<meta charset="utf-8">
+<script src=""
+</head>
+<body id="body">
+
+<input type="text" value="hello" id="textfield">
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that the auto-filled attribute is reported correctly.");
+
+    if (window.accessibilityController) {
+
+        var textField = document.getElementById("textfield");
+        var axTextField = accessibilityController.accessibleElementById("textfield");
+
+        debug("Initial auto-fill value: " + axTextField.boolAttributeValue("AXValueAutofilled"));
+        window.internals.setAutofilled(textField, true);
+        debug("Set auto-fill to true value: " + axTextField.boolAttributeValue("AXValueAutofilled"));
+        window.internals.setAutofilled(textField, false);
+        debug("Set auto-fill to false value: " + axTextField.boolAttributeValue("AXValueAutofilled"));
+    }
+
+</script>
+
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/platform/mac/accessibility/auto-filled-value-expected.txt (0 => 176481)


--- trunk/LayoutTests/platform/mac/accessibility/auto-filled-value-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/auto-filled-value-expected.txt	2014-11-22 00:02:59 UTC (rev 176481)
@@ -0,0 +1,13 @@
+
+This tests that the auto-filled attribute is reported correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Initial auto-fill value: false
+Set auto-fill to true value: true
+Set auto-fill to false value: false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Modified: trunk/Source/WebCore/ChangeLog (176480 => 176481)


--- trunk/Source/WebCore/ChangeLog	2014-11-21 23:53:13 UTC (rev 176480)
+++ trunk/Source/WebCore/ChangeLog	2014-11-22 00:02:59 UTC (rev 176481)
@@ -1,3 +1,21 @@
+2014-11-21  Chris Fleizach  <cfleiz...@apple.com>
+
+        AX: Unclear that user and password are autofilled, no VoiceOver version of the yellow outline.
+        https://bugs.webkit.org/show_bug.cgi?id=138904
+
+        Reviewed by Mario Sanchez Prada.
+
+        Add an attribute that marks when a text field is auto-filled.
+
+        Test: accessibility/auto-filled-value.html
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::isValueAutofilled):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
+        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
+
 2014-11-21  Andreas Kling  <akl...@apple.com>
 
         RenderElement::removeChild() doesn't need a return value.

Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (176480 => 176481)


--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2014-11-21 23:53:13 UTC (rev 176480)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2014-11-22 00:02:59 UTC (rev 176481)
@@ -40,6 +40,7 @@
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameSelection.h"
+#include "HTMLInputElement.h"
 #include "HTMLNames.h"
 #include "HTMLParserIdioms.h"
 #include "HitTestResult.h"
@@ -1971,6 +1972,18 @@
         return downcast<Element>(node);
     return nullptr;
 }
+    
+bool AccessibilityObject::isValueAutofilled() const
+{
+    if (!isNativeTextControl())
+        return false;
+    
+    Node* node = this->node();
+    if (!node || !is<HTMLInputElement>(*node))
+        return false;
+    
+    return downcast<HTMLInputElement>(*node).isAutofilled();
+}
 
 const AtomicString& AccessibilityObject::placeholderValue() const
 {

Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (176480 => 176481)


--- trunk/Source/WebCore/accessibility/AccessibilityObject.h	2014-11-21 23:53:13 UTC (rev 176480)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h	2014-11-22 00:02:59 UTC (rev 176481)
@@ -832,7 +832,8 @@
     virtual AccessibilityRole roleValueForMSAA() const { return roleValue(); }
 
     virtual String passwordFieldValue() const { return String(); }
-
+    bool isValueAutofilled() const;
+    
     // Used by an ARIA tree to get all its rows.
     void ariaTreeRows(AccessibilityChildrenVector&);
     // Used by an ARIA tree item to get all of its direct rows that it can disclose.

Modified: trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (176480 => 176481)


--- trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm	2014-11-21 23:53:13 UTC (rev 176480)
+++ trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm	2014-11-22 00:02:59 UTC (rev 176481)
@@ -750,6 +750,14 @@
     [result appendString:string];
 }
 
+- (BOOL)_accessibilityValueIsAutofilled
+{
+    if (![self _prepareAccessibilityCall])
+        return NO;
+
+    return m_object->isValueAutofilled();
+}
+
 - (CGFloat)_accessibilityMinValue
 {
     return m_object->minValueForRange();

Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (176480 => 176481)


--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2014-11-21 23:53:13 UTC (rev 176480)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2014-11-22 00:02:59 UTC (rev 176481)
@@ -129,6 +129,10 @@
 #define NSAccessibilityAccessKeyAttribute @"AXAccessKey"
 #endif
 
+#ifndef NSAccessibilityValueAutofilledAttribute
+#define NSAccessibilityValueAutofilledAttribute @"AXValueAutofilled"
+#endif
+
 #ifndef NSAccessibilityLanguageAttribute
 #define NSAccessibilityLanguageAttribute @"AXLanguage"
 #endif
@@ -1373,6 +1377,7 @@
         [tempArray addObject:NSAccessibilityRequiredAttribute];
         [tempArray addObject:NSAccessibilityInvalidAttribute];
         [tempArray addObject:NSAccessibilityPlaceholderValueAttribute];
+        [tempArray addObject:NSAccessibilityValueAutofilledAttribute];
         textAttrs = [[NSArray alloc] initWithArray:tempArray];
         [tempArray release];
     }
@@ -1540,6 +1545,7 @@
         [tempArray addObject:NSAccessibilityRequiredAttribute];
         [tempArray addObject:NSAccessibilityInvalidAttribute];
         [tempArray addObject:NSAccessibilityPlaceholderValueAttribute];
+        [tempArray addObject:NSAccessibilityValueAutofilledAttribute];
         passwordFieldAttrs = [[NSArray alloc] initWithArray:tempArray];
         [tempArray release];
     }
@@ -2860,7 +2866,10 @@
     
     if ([attributeName isEqualToString:NSAccessibilityPlaceholderValueAttribute])
         return m_object->placeholderValue();
-    
+
+    if ([attributeName isEqualToString:NSAccessibilityValueAutofilledAttribute])
+        return @(m_object->isValueAutofilled());
+
     if ([attributeName isEqualToString:NSAccessibilityHasPopupAttribute])
         return [NSNumber numberWithBool:m_object->ariaHasPopup()];
     
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to