Source/WebCore: AXDescription for HTML5 footer
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Mar 2012 06:32:13 +0000 (06:32 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Mar 2012 06:32:13 +0000 (06:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=78967

Return a unique role description for the footer element.

Reviewed by Beth Dakin.

Test: platform/mac/accessibility/footer-roledescription.html

* English.lproj/Localizable.strings:+
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/mac/WebAccessibilityObjectWrapper.mm:
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper subrole]):
(-[WebAccessibilityObjectWrapper roleDescription]):
* platform/LocalizedStrings.cpp:
(WebCore::AXFooterRoleDescriptionText):
(WebCore):
* platform/LocalizedStrings.h:
(WebCore):
* platform/blackberry/LocalizedStringsBlackBerry.cpp:
(WebCore::AXFooterRoleDescriptionText):
(WebCore):
* platform/efl/LocalizedStringsEfl.cpp:
(WebCore::AXFooterRoleDescriptionText):
(WebCore):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::AXFooterRoleDescriptionText):
(WebCore):

Source/WebKit/chromium: AXDescription for HTML5 footer and ARIA role contentinfo incorrect
https://bugs.webkit.org/show_bug.cgi?id=78967

Reviewed by Beth Dakin.

* src/LocalizedStrings.cpp:

LayoutTests: AXDescription for HTML5 footer and ARIA role contentinfo incorrect
https://bugs.webkit.org/show_bug.cgi?id=78967

Reviewed by Beth Dakin.

* platform/mac/accessibility/footer-roledescription-expected.txt: Added.
* platform/mac/accessibility/footer-roledescription.html: Added.

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

17 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/accessibility/footer-roledescription-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/footer-roledescription.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/English.lproj/Localizable.strings
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm
Source/WebCore/platform/LocalizedStrings.cpp
Source/WebCore/platform/LocalizedStrings.h
Source/WebCore/platform/blackberry/LocalizedStringsBlackBerry.cpp
Source/WebCore/platform/efl/LocalizedStringsEfl.cpp
Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebAccessibilityRole.h
Source/WebKit/chromium/src/AssertMatchingEnums.cpp
Source/WebKit/chromium/src/LocalizedStrings.cpp

index e25a4fd..2b5cde9 100644 (file)
@@ -1,3 +1,13 @@
+2012-03-14  Chris Fleizach  <cfleizach@apple.com>
+
+        AXDescription for HTML5 footer and ARIA role contentinfo incorrect
+        https://bugs.webkit.org/show_bug.cgi?id=78967
+
+        Reviewed by Beth Dakin.
+
+        * platform/mac/accessibility/footer-roledescription-expected.txt: Added.
+        * platform/mac/accessibility/footer-roledescription.html: Added.
+
 2012-03-14 Hajime Morrita  <morrita@chromium.org>
 
         Unreviewed expectation update for Chrome-Lion.
diff --git a/LayoutTests/platform/mac/accessibility/footer-roledescription-expected.txt b/LayoutTests/platform/mac/accessibility/footer-roledescription-expected.txt
new file mode 100644 (file)
index 0000000..f30a9ff
--- /dev/null
@@ -0,0 +1,15 @@
+footer
+content info
+This tests that a footer element has a different role description from a contentinfo
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS footer.role is contentInfo.role
+PASS footer.subrole is contentInfo.subrole
+PASS footer.roleDescription is 'AXRoleDescription: footer'
+PASS contentInfo.roleDescription is 'AXRoleDescription: content information'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/accessibility/footer-roledescription.html b/LayoutTests/platform/mac/accessibility/footer-roledescription.html
new file mode 100644 (file)
index 0000000..b577b14
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<footer>footer</footer>
+<div role="contentinfo">content info</div>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that a footer element has a different role description from a contentinfo");
+
+    if (window.accessibilityController) {
+
+          // this text field should be required.
+          document.getElementById("body").focus();
+          var obj = accessibilityController.focusedElement;
+
+          var footer = obj.childAtIndex(0);
+          var contentInfo = obj.childAtIndex(1);
+         
+          shouldBe("footer.role", "contentInfo.role");
+          shouldBe("footer.subrole", "contentInfo.subrole");
+          shouldBe("footer.roleDescription", "'AXRoleDescription: footer'");
+          shouldBe("contentInfo.roleDescription", "'AXRoleDescription: content information'");
+
+    }
+
+</script>
+
+<script src="../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
index 3e104d1..a9666fe 100644 (file)
@@ -1,3 +1,37 @@
+2012-03-14  Chris Fleizach  <cfleizach@apple.com>
+
+        AXDescription for HTML5 footer
+        https://bugs.webkit.org/show_bug.cgi?id=78967
+
+        Return a unique role description for the footer element.
+
+        Reviewed by Beth Dakin.
+
+        Test: platform/mac/accessibility/footer-roledescription.html
+
+        * English.lproj/Localizable.strings:+
+        * accessibility/AccessibilityObject.h:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
+        * accessibility/mac/WebAccessibilityObjectWrapper.mm:
+        (createAccessibilityRoleMap):
+        (-[WebAccessibilityObjectWrapper subrole]):
+        (-[WebAccessibilityObjectWrapper roleDescription]):
+        * platform/LocalizedStrings.cpp:
+        (WebCore::AXFooterRoleDescriptionText):
+        (WebCore):
+        * platform/LocalizedStrings.h:
+        (WebCore):
+        * platform/blackberry/LocalizedStringsBlackBerry.cpp:
+        (WebCore::AXFooterRoleDescriptionText):
+        (WebCore):
+        * platform/efl/LocalizedStringsEfl.cpp:
+        (WebCore::AXFooterRoleDescriptionText):
+        (WebCore):
+        * platform/gtk/LocalizedStringsGtk.cpp:
+        (WebCore::AXFooterRoleDescriptionText):
+        (WebCore):
+
 2012-03-14  Mark Rowe  <mrowe@apple.com>
 
         <http://webkit.org/b/81193> Ensure libWebCoreTestSupport.dylib's library identifier is set appropriately for all configurations.
index 8f1a5c9..0b60754 100644 (file)
Binary files a/Source/WebCore/English.lproj/Localizable.strings and b/Source/WebCore/English.lproj/Localizable.strings differ
index 9346dc4..4f689b2 100644 (file)
@@ -121,6 +121,7 @@ enum AccessibilityRole {
     DocumentRegionRole,            
     DrawerRole,
     EditableTextRole,
+    FooterRole,
     FormRole,
     GridRole,
     GroupRole,
index 4f81a24..54e4afb 100644 (file)
@@ -3251,7 +3251,7 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
     if (node && node->hasTagName(headerTag) && !isDescendantOfElementType(articleTag) && !isDescendantOfElementType(sectionTag))
         return LandmarkBannerRole;
     if (node && node->hasTagName(footerTag) && !isDescendantOfElementType(articleTag) && !isDescendantOfElementType(sectionTag))
-        return LandmarkContentInfoRole;
+        return FooterRole;
 
     if (m_renderer->isBlockFlow())
         return GroupRole;
index edd7223..0b7dc4a 100644 (file)
@@ -1549,7 +1549,8 @@ static const AccessibilityRoleMap& createAccessibilityRoleMap()
         { LabelRole, NSAccessibilityGroupRole },
         { DivRole, NSAccessibilityGroupRole },
         { FormRole, NSAccessibilityGroupRole },
-        { SpinButtonRole, NSAccessibilityIncrementorRole }
+        { SpinButtonRole, NSAccessibilityIncrementorRole },
+        { FooterRole, NSAccessibilityGroupRole }
     };
     AccessibilityRoleMap& roleMap = *new AccessibilityRoleMap;
     
@@ -1614,6 +1615,8 @@ static NSString* roleValueToNSString(AccessibilityRole value)
             return @"AXLandmarkBanner";
         case LandmarkComplementaryRole:
             return @"AXLandmarkComplementary";
+        // Footer roles should appear as content info types.
+        case FooterRole:
         case LandmarkContentInfoRole:
             return @"AXLandmarkContentInfo";
         case LandmarkMainRole:
@@ -1726,6 +1729,8 @@ static NSString* roleValueToNSString(AccessibilityRole value)
                 return AXDefinitionListTermText();
             case DefinitionListDefinitionRole:
                 return AXDefinitionListDefinitionText();
+            case FooterRole:
+                return AXFooterRoleDescriptionText();
         }
     }        
     
index a365b38..45b7b4e 100644 (file)
@@ -567,6 +567,11 @@ String AXDefinitionListDefinitionText()
     return WEB_UI_STRING("definition", "definition phrase");
 }
 
+String AXFooterRoleDescriptionText()
+{
+    return WEB_UI_STRING("footer", "accessibility role description for a footer");
+}
+
 #if PLATFORM(MAC)
 String AXARIAContentGroupText(const String& ariaType)
 {
index 3ebbef7..ff8fbbf 100644 (file)
@@ -141,7 +141,7 @@ namespace WebCore {
     String AXHeadingText();
     String AXDefinitionListTermText();
     String AXDefinitionListDefinitionText();
-
+    String AXFooterRoleDescriptionText();
 #if PLATFORM(MAC)
     String AXARIAContentGroupText(const String& ariaType);
 #endif
index 7f5bef7..2207f3a 100644 (file)
@@ -398,6 +398,12 @@ String AXDefinitionListTermText()
     return String();
 }
 
+String AXFooterRoleDescriptionText()
+{
+    notImplemented();
+    return String();
+}
+
 String AXLinkActionVerb()
 {
     notImplemented();
index 27240e8..32aefe1 100644 (file)
@@ -379,6 +379,11 @@ String AXDefinitionListDefinitionText()
     return String::fromUTF8("definition");
 }
 
+String AXFooterRoleDescriptionText()
+{
+    return String::fromUTF8("footer");
+}
+
 String AXButtonActionVerb()
 {
     return String::fromUTF8("press");
index 07bed8d..2230da3 100644 (file)
@@ -367,6 +367,11 @@ String AXDefinitionListDefinitionText()
     return String::fromUTF8(_("definition"));
 }
 
+String AXFooterRoleDescriptionText()
+{
+    return String::fromUTF8(_("footer"));
+}
+
 String AXButtonActionVerb()
 {
     return String::fromUTF8(_("press"));
index 5d47fe8..f9d6331 100644 (file)
@@ -1,3 +1,12 @@
+2012-03-14  Chris Fleizach  <cfleizach@apple.com>
+
+        AXDescription for HTML5 footer and ARIA role contentinfo incorrect
+        https://bugs.webkit.org/show_bug.cgi?id=78967
+
+        Reviewed by Beth Dakin.
+
+        * src/LocalizedStrings.cpp:
+
 2012-03-13  Jon Lee  <jonlee@apple.com>
 
         Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS
index 1968457..60958f9 100644 (file)
@@ -67,6 +67,7 @@ enum WebAccessibilityRole {
     WebAccessibilityRoleDocumentRegion,
     WebAccessibilityRoleDrawer,
     WebAccessibilityRoleEditableText,
+    WebAccessibilityRoleFooter,
     WebAccessibilityRoleForm,
     WebAccessibilityRoleGrid,
     WebAccessibilityRoleGroup,
index 6a54208..c18416f 100644 (file)
@@ -212,6 +212,7 @@ COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleTreeGrid, TreeGridRole);
 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleTreeItemRole, TreeItemRole);
 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDirectory, DirectoryRole);
 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleEditableText, EditableTextRole);
+COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleFooter, FooterRole);
 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleListItem, ListItemRole);
 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleParagraph, ParagraphRole);
 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLabel, LabelRole);
index 917180b..f4a91e4 100644 (file)
@@ -158,6 +158,12 @@ String AXDefinitionListDefinitionText()
     return String("definition");
 }
 
+String AXFooterRoleDescriptionText()
+{
+    notImplemented();
+    return String("footer");
+}
+
 String AXButtonActionVerb()
 {
     return query(WebLocalizedString::AXButtonActionVerb);