AX: input role="spinbutton" gets skipped in voiceover
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Jun 2015 14:13:30 +0000 (14:13 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Jun 2015 14:13:30 +0000 (14:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=145514

Reviewed by Mario Sanchez Prada.

SpinButton role was added, but left out of iOS.
To prevent this from happening again, explicitly list every role in the switch statement that
determines accessible visibility.

Test: platform/ios-simulator/accessibility/spinbutton.html

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

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

LayoutTests/platform/ios-simulator/accessibility/spinbutton-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios-simulator/accessibility/spinbutton.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm

diff --git a/LayoutTests/platform/ios-simulator/accessibility/spinbutton-expected.txt b/LayoutTests/platform/ios-simulator/accessibility/spinbutton-expected.txt
new file mode 100644 (file)
index 0000000..399748a
--- /dev/null
@@ -0,0 +1,12 @@
+button
+This test makes sure that spinbuttons appear.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS button.description is 'AXLabel: spinner'
+PASS button.isIgnored is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/ios-simulator/accessibility/spinbutton.html b/LayoutTests/platform/ios-simulator/accessibility/spinbutton.html
new file mode 100644 (file)
index 0000000..3f17a71
--- /dev/null
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../../../resources/js-test-pre.js"></script>
+<script>
+var successfullyParsed = false;
+if (window.testRunner)
+   testRunner.dumpAsText();
+</script>
+</head>
+<body>
+
+<div id="fakeButton" tabindex=0 role="spinbutton" aria-label="spinner">button</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This test makes sure that spinbuttons appear.");
+
+    if (window.accessibilityController) {
+
+        var button = accessibilityController.accessibleElementById("fakeButton");
+        shouldBe("button.description", "'AXLabel: spinner'");
+        shouldBeFalse("button.isIgnored");
+    }
+
+    successfullyParsed = true;
+</script>
+
+<script src="../../../resources/js-test-post.js"></script>
+
+</body>
+</html>
+
index 5d9f912..04aa0fc 100644 (file)
@@ -1,3 +1,20 @@
+2015-06-17  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: input role="spinbutton" gets skipped in voiceover
+        https://bugs.webkit.org/show_bug.cgi?id=145514
+
+        Reviewed by Mario Sanchez Prada.
+
+        SpinButton role was added, but left out of iOS.
+        To prevent this from happening again, explicitly list every role in the switch statement that
+        determines accessible visibility.
+
+        Test: platform/ios-simulator/accessibility/spinbutton.html
+
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+        (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
+        (-[WebAccessibilityObjectWrapper isAccessibilityElement]):
+
 2015-06-17  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
 
         [Streams API] ReadableJSStream should handle promises returned by JS source pull callback
index c48a675..ad5cfc5 100644 (file)
@@ -638,8 +638,11 @@ static AccessibilityObjectWrapper* AccessibilityUnignoredAncestor(AccessibilityO
         case MenuButtonRole:
         case ValueIndicatorRole:
         case ImageRole:
+        case ImageMapLinkRole:
         case ProgressIndicatorRole:
         case MenuItemRole:
+        case MenuItemCheckboxRole:
+        case MenuItemRadioRole:
         case IncrementorRole:
         case ComboBoxRole:
         case DisclosureTriangleRole:
@@ -649,8 +652,10 @@ static AccessibilityObjectWrapper* AccessibilityUnignoredAncestor(AccessibilityO
         case TabRole:
         case DocumentMathRole:
         case HorizontalRuleRole:
+        case SliderThumbRole:
         case SwitchRole:
         case SearchFieldRole:
+        case SpinButtonRole:
             return true;
         case StaticTextRole:
         {
@@ -682,40 +687,105 @@ static AccessibilityObjectWrapper* AccessibilityUnignoredAncestor(AccessibilityO
                 return true;
             FALLTHROUGH;
         // All other elements are ignored on the iphone.
-        default:
-        case UnknownRole:
-        case TabGroupRole:
-        case ScrollAreaRole:
-        case TableRole:
+        case AnnotationRole:
         case ApplicationRole:
-        case RadioGroupRole:
-        case ListRole:
-        case ListBoxRole:
-        case ScrollBarRole:
-        case MenuBarRole:
-        case MenuRole:
-        case ColumnRole:
-        case RowRole:
-        case ToolbarRole:
-        case BusyIndicatorRole:
-        case WindowRole:
-        case DrawerRole:
-        case SystemWideRole:
-        case OutlineRole:
+        case ApplicationAlertRole:
+        case ApplicationAlertDialogRole:
+        case ApplicationDialogRole:
+        case ApplicationLogRole:
+        case ApplicationMarqueeRole:
+        case ApplicationStatusRole:
+        case ApplicationTimerRole:
+        case AudioRole:
+        case BlockquoteRole:
         case BrowserRole:
-        case SplitGroupRole:
-        case SplitterRole:
+        case BusyIndicatorRole:
+        case CanvasRole:
+        case CaptionRole:
+        case CellRole:
         case ColorWellRole:
+        case ColumnRole:
+        case ColumnHeaderRole:
+        case DefinitionRole:
+        case DescriptionListRole:
+        case DescriptionListTermRole:
+        case DescriptionListDetailRole:
+        case DetailsRole:
+        case DirectoryRole:
+        case DivRole:
+        case DocumentRole:
+        case DocumentArticleRole:
+        case DocumentNoteRole:
+        case DocumentRegionRole:
+        case DrawerRole:
+        case EditableTextRole:
+        case FooterRole:
+        case FormRole:
+        case GridRole:
         case GrowAreaRole:
-        case SheetRole:
         case HelpTagRole:
+        case IgnoredRole:
+        case InlineRole:
+        case LabelRole:
+        case LandmarkApplicationRole:
+        case LandmarkBannerRole:
+        case LandmarkComplementaryRole:
+        case LandmarkContentInfoRole:
+        case LandmarkMainRole:
+        case LandmarkNavigationRole:
+        case LandmarkSearchRole:
+        case LegendRole:
+        case ListRole:
+        case ListBoxRole:
+        case ListItemRole:
+        case MathElementRole:
         case MatteRole:
+        case MenuRole:
+        case MenuBarRole:
+        case MenuListPopupRole:
+        case MenuListOptionRole:
+        case OutlineRole:
+        case ParagraphRole:
+        case PreRole:
+        case PresentationalRole:
+        case RadioGroupRole:
+        case RowHeaderRole:
+        case RowRole:
+        case RubyBaseRole:
+        case RubyBlockRole:
+        case RubyInlineRole:
+        case RubyRunRole:
+        case RubyTextRole:
         case RulerRole:
         case RulerMarkerRole:
-        case GridRole:
+        case ScrollAreaRole:
+        case ScrollBarRole:
+        case SheetRole:
+        case SpinButtonPartRole:
+        case SplitGroupRole:
+        case SplitterRole:
+        case SummaryRole:
+        case SystemWideRole:
+        case SVGRootRole:
+        case TabGroupRole:
+        case TabListRole:
+        case TabPanelRole:
+        case TableRole:
+        case TableHeaderContainerRole:
+        case TreeRole:
+        case TreeItemRole:
+        case TreeGridRole:
+        case ToolbarRole:
+        case UnknownRole:
+        case UserInterfaceTooltipRole:
+        case VideoRole:
         case WebAreaRole:
+        case WindowRole:
             return false;
     }
+    
+    ASSERT_NOT_REACHED();
+    return false;
 }
 
 - (BOOL)isAccessibilityElement