Title: [148522] trunk
Revision
148522
Author
[email protected]
Date
2013-04-16 10:52:12 -0700 (Tue, 16 Apr 2013)

Log Message

AX: aria-valuetext is not exposed on OS X.
https://bugs.webkit.org/show_bug.cgi?id=114628

Reviewed by Tim Horton.

Source/WebCore: 

aria-valuetext is only being exposed on ARIA controls. That's because there were
checks in place so that ONLY ARIA defined controls would return anything related to valuetext.
We should allow this to work on native controls as well.

Test: platform/mac/accessibility/aria-valuetext-on-native-slider.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::valueDescription):
(WebCore):
(WebCore::AccessibilityNodeObject::valueForRange):
(WebCore::AccessibilityNodeObject::maxValueForRange):
(WebCore::AccessibilityNodeObject::minValueForRange):
* accessibility/AccessibilityNodeObject.h:
(AccessibilityNodeObject):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isRangeControl):
     Rename isARIAControl to isRangeControl and make it apply to all elements.
* accessibility/AccessibilityObject.h:

LayoutTests: 

* platform/mac/accessibility/aria-valuetext-on-native-slider-expected.txt: Added.
* platform/mac/accessibility/aria-valuetext-on-native-slider.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (148521 => 148522)


--- trunk/LayoutTests/ChangeLog	2013-04-16 17:18:38 UTC (rev 148521)
+++ trunk/LayoutTests/ChangeLog	2013-04-16 17:52:12 UTC (rev 148522)
@@ -1,3 +1,13 @@
+2013-04-16  Chris Fleizach  <[email protected]>
+
+        AX: aria-valuetext is not exposed on OS X.
+        https://bugs.webkit.org/show_bug.cgi?id=114628
+
+        Reviewed by Tim Horton.
+
+        * platform/mac/accessibility/aria-valuetext-on-native-slider-expected.txt: Added.
+        * platform/mac/accessibility/aria-valuetext-on-native-slider.html: Added.
+
 2013-04-16  Pan Deng  <[email protected]>
 
         Web Inspector: [Network] Cover the type of preflight xhr.

Added: trunk/LayoutTests/platform/mac/accessibility/aria-valuetext-on-native-slider-expected.txt (0 => 148522)


--- trunk/LayoutTests/platform/mac/accessibility/aria-valuetext-on-native-slider-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/aria-valuetext-on-native-slider-expected.txt	2013-04-16 17:52:12 UTC (rev 148522)
@@ -0,0 +1,11 @@
+
+This tests that aria-valuetext can be used on native elements, like input=range
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS range.valueDescription is 'hello'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/mac/accessibility/aria-valuetext-on-native-slider.html (0 => 148522)


--- trunk/LayoutTests/platform/mac/accessibility/aria-valuetext-on-native-slider.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/aria-valuetext-on-native-slider.html	2013-04-16 17:52:12 UTC (rev 148522)
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+<input type="range" aria-valuetext="hello" id="range">
+
+<div id="console"></div>
+
+<script>
+
+    description("This tests that aria-valuetext can be used on native elements, like input=range");
+
+    if (window.accessibilityController) {
+          var range = accessibilityController.accessibleElementById("range");
+          shouldBe("range.valueDescription", "'hello'");
+    }
+
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (148521 => 148522)


--- trunk/Source/WebCore/ChangeLog	2013-04-16 17:18:38 UTC (rev 148521)
+++ trunk/Source/WebCore/ChangeLog	2013-04-16 17:52:12 UTC (rev 148522)
@@ -1,3 +1,29 @@
+2013-04-16  Chris Fleizach  <[email protected]>
+
+        AX: aria-valuetext is not exposed on OS X.
+        https://bugs.webkit.org/show_bug.cgi?id=114628
+
+        Reviewed by Tim Horton.
+
+        aria-valuetext is only being exposed on ARIA controls. That's because there were
+        checks in place so that ONLY ARIA defined controls would return anything related to valuetext.
+        We should allow this to work on native controls as well.
+
+        Test: platform/mac/accessibility/aria-valuetext-on-native-slider.html
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::valueDescription):
+        (WebCore):
+        (WebCore::AccessibilityNodeObject::valueForRange):
+        (WebCore::AccessibilityNodeObject::maxValueForRange):
+        (WebCore::AccessibilityNodeObject::minValueForRange):
+        * accessibility/AccessibilityNodeObject.h:
+        (AccessibilityNodeObject):
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::isRangeControl):
+             Rename isARIAControl to isRangeControl and make it apply to all elements.
+        * accessibility/AccessibilityObject.h:
+
 2013-04-15  Jon Lee  <[email protected]>
 
         RenderView should bail out of paintBoxDecorations() when painting with a different renderer

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (148521 => 148522)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2013-04-16 17:18:38 UTC (rev 148521)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2013-04-16 17:52:12 UTC (rev 148522)
@@ -742,25 +742,12 @@
 
 String AccessibilityNodeObject::valueDescription() const
 {
-    if (!isARIARange())
+    if (!isRangeControl())
         return String();
 
     return getAttribute(aria_valuetextAttr).string();
 }
 
-bool AccessibilityNodeObject::isARIARange() const
-{
-    switch (m_ariaRole) {
-    case ProgressIndicatorRole:
-    case SliderRole:
-    case ScrollBarRole:
-    case SpinButtonRole:
-        return true;
-    default:
-        return false;
-    }
-}
-
 float AccessibilityNodeObject::valueForRange() const
 {
     if (node() && node()->hasTagName(inputTag)) {
@@ -769,7 +756,7 @@
             return input->valueAsNumber();
     }
 
-    if (!isARIARange())
+    if (!isRangeControl())
         return 0.0f;
 
     return getAttribute(aria_valuenowAttr).toFloat();
@@ -783,7 +770,7 @@
             return input->maximum();
     }
 
-    if (!isARIARange())
+    if (!isRangeControl())
         return 0.0f;
 
     return getAttribute(aria_valuemaxAttr).toFloat();
@@ -797,7 +784,7 @@
             return input->minimum();
     }
 
-    if (!isARIARange())
+    if (!isRangeControl())
         return 0.0f;
 
     return getAttribute(aria_valueminAttr).toFloat();

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h (148521 => 148522)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h	2013-04-16 17:18:38 UTC (rev 148521)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h	2013-04-16 17:52:12 UTC (rev 148522)
@@ -172,7 +172,6 @@
     virtual bool isDescendantOfBarrenParent() const;
     void alterSliderValue(bool increase);
     void changeValueByStep(bool increase);
-    bool isARIARange() const;
     // This returns true if it's focusable but it's not content editable and it's not a control or ARIA control.
     bool isGenericFocusableElement() const;
     HTMLLabelElement* labelForElement(Element*) const;

Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (148521 => 148522)


--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2013-04-16 17:18:38 UTC (rev 148521)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2013-04-16 17:52:12 UTC (rev 148522)
@@ -528,6 +528,19 @@
     return isARIAInput(ariaRole) || ariaRole == TextAreaRole || ariaRole == ButtonRole 
     || ariaRole == ComboBoxRole || ariaRole == SliderRole; 
 }
+    
+bool AccessibilityObject::isRangeControl() const
+{
+    switch (roleValue()) {
+    case ProgressIndicatorRole:
+    case SliderRole:
+    case ScrollBarRole:
+    case SpinButtonRole:
+        return true;
+    default:
+        return false;
+    }
+}
 
 IntPoint AccessibilityObject::clickPoint()
 {

Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (148521 => 148522)


--- trunk/Source/WebCore/accessibility/AccessibilityObject.h	2013-04-16 17:18:38 UTC (rev 148521)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h	2013-04-16 17:52:12 UTC (rev 148522)
@@ -448,7 +448,8 @@
     bool isBlockquote() const;
     bool isLandmark() const;
     bool isColorWell() const { return roleValue() == ColorWellRole; }
-    
+    bool isRangeControl() const;
+
     virtual bool isChecked() const { return false; }
     virtual bool isEnabled() const { return false; }
     virtual bool isSelected() const { return false; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to