AX: ARIA 1.1 @aria-placeholder
authorn_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Oct 2015 18:17:56 +0000 (18:17 +0000)
committern_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Oct 2015 18:17:56 +0000 (18:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=148970

Reviewed by Chris Fleizach.

Source/WebCore:

Added support for aria-placeholder attribute.

Modified accessibility/placeholder.html test.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::placeholderValue):
* html/HTMLAttributeNames.in:

LayoutTests:

* accessibility/placeholder-expected.txt:
* accessibility/placeholder.html:

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

LayoutTests/ChangeLog
LayoutTests/accessibility/placeholder-expected.txt
LayoutTests/accessibility/placeholder.html
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/html/HTMLAttributeNames.in

index 552ead1aa24450c2a6c3c4a657a2b42a83f14796..a1ab77d9e6f16883c48e896b024282ca11a9a03b 100644 (file)
@@ -1,3 +1,13 @@
+2015-10-07  Nan Wang  <n_wang@apple.com>
+
+        AX: ARIA 1.1 @aria-placeholder
+        https://bugs.webkit.org/show_bug.cgi?id=148970
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/placeholder-expected.txt:
+        * accessibility/placeholder.html:
+
 2015-10-06  Simon Fraser  <simon.fraser@apple.com>
 
         will-change should trigger stacking context based purely on properties
index ddc71ce8fd29878574e18fe9f5b46b98e72a89d0..f15bcf17a03d23bc84fe413d031a58cb4835aed0 100644 (file)
@@ -1,4 +1,5 @@
-  
+   Birthday:
+03-14-1879
 This test makes sure that the placeholder is returned as the correct attribute
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
@@ -6,6 +7,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 PASS fieldElement.stringAttributeValue('AXPlaceholderValue') is 'search'
 PASS pass.stringAttributeValue('AXPlaceholderValue') is 'Password'
+PASS search.stringAttributeValue('AXPlaceholderValue') is 'MM-DD-YYYY'
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 8475dac9f07fdf96c02a7df9eec3ef1fd416aecb..4a66dae3c1bc170112f2e5c8092458ecf5aa4cb8 100644 (file)
@@ -9,6 +9,9 @@
 
     <input id="password" class="field" type="password" name="sc1798" value="" placeholder="Password" spellcheck="true" maxlength="5096">
     
+    <span id="label">Birthday:</span>
+    <div id="search" role="searchbox" aria-labelledby="label" aria-placeholder="MM-DD-YYYY">03-14-1879</div>
+    
     <p id="description"></p>
     <div id="console"></div>
      
             document.getElementById("password").focus();
             var pass = accessibilityController.focusedElement;
             shouldBe("pass.stringAttributeValue('AXPlaceholderValue')", "'Password'");
+            
+            var search = accessibilityController.accessibleElementById("search");
+            shouldBe("search.stringAttributeValue('AXPlaceholderValue')", "'MM-DD-YYYY'");
 
         }
     </script>
 
 <script src="../resources/js-test-post.js"></script>
 </body>
-</html>
+</html>
\ No newline at end of file
index 0931ed5b7ee2c8c72ec02b183fe4193494062a54..d0be42f615b539a765773f30d1cbeaaa4fa3e85b 100644 (file)
@@ -1,3 +1,18 @@
+2015-10-07  Nan Wang  <n_wang@apple.com>
+
+        AX: ARIA 1.1 @aria-placeholder
+        https://bugs.webkit.org/show_bug.cgi?id=148970
+
+        Reviewed by Chris Fleizach.
+
+        Added support for aria-placeholder attribute.
+
+        Modified accessibility/placeholder.html test.
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::placeholderValue):
+        * html/HTMLAttributeNames.in:
+
 2015-10-07  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r190664.
index e1686f24fce8ac4cff34f1c7417955b6ff1689bd..dbd92eec3a62d98e7863a6af37215a917c21805a 100644 (file)
@@ -2120,6 +2120,10 @@ bool AccessibilityObject::isValueAutofilled() const
 
 const AtomicString& AccessibilityObject::placeholderValue() const
 {
+    const AtomicString& ariaPlaceholder = getAttribute(aria_placeholderAttr);
+    if (!ariaPlaceholder.isEmpty())
+        return ariaPlaceholder;
+    
     const AtomicString& placeholder = getAttribute(placeholderAttr);
     if (!placeholder.isEmpty())
         return placeholder;
index 12c5f5d9ad1a7cf0977e96c503ac29f3d3edc870..4f159486139ace20fbc0a99ee0436720e56fc86f 100644 (file)
@@ -38,6 +38,7 @@ aria-multiline
 aria-multiselectable
 aria-orientation
 aria-owns
+aria-placeholder
 aria-posinset
 aria-pressed
 aria-readonly