Diff
Modified: trunk/LayoutTests/ChangeLog (242050 => 242051)
--- trunk/LayoutTests/ChangeLog 2019-02-25 19:11:57 UTC (rev 242050)
+++ trunk/LayoutTests/ChangeLog 2019-02-25 19:15:23 UTC (rev 242051)
@@ -1,3 +1,22 @@
+2019-02-25 Chris Fleizach <[email protected]>
+
+ AX: <footer> HTML5 tag not reading as ARIA Landmark to VoiceOver
+ https://bugs.webkit.org/show_bug.cgi?id=190138
+ <rdar://problem/44907695>
+
+ Reviewed by Joanmarie Diggs.
+
+ * accessibility/mac/footer-expected.txt:
+ * accessibility/mac/footer-roledescription-expected.txt:
+ * accessibility/mac/footer-roledescription.html:
+ * accessibility/mac/footer.html:
+ * accessibility/roles-computedRoleString-expected.txt:
+ * accessibility/roles-computedRoleString.html:
+ * platform/gtk/accessibility/roles-computedRoleString-expected.txt:
+ * platform/mac-wk2/accessibility/roles-exposed-expected.txt:
+ * platform/mac/accessibility/roles-computedRoleString-expected.txt:
+ * platform/mac/accessibility/roles-exposed-expected.txt:
+
2019-02-25 Frederic Wang <[email protected]>
Add tests mixing programmatic and user frame scrolling on iOS
Modified: trunk/LayoutTests/accessibility/ios-simulator/landmark-type-expected.txt (242050 => 242051)
--- trunk/LayoutTests/accessibility/ios-simulator/landmark-type-expected.txt 2019-02-25 19:11:57 UTC (rev 242050)
+++ trunk/LayoutTests/accessibility/ios-simulator/landmark-type-expected.txt 2019-02-25 19:15:23 UTC (rev 242051)
@@ -17,7 +17,7 @@
PASS banner.childAtIndex(0).traits != nonLandmarkText.traits is true
PASS region.description is 'AXLabel: testregion, region'
PASS region.childAtIndex(0).traits != nonLandmarkText.traits is true
-PASS footer.description is 'AXLabel: footer'
+PASS footer.description is 'AXLabel: content information'
PASS footer.childAtIndex(0).traits != nonLandmarkText.traits is true
PASS article.description is 'AXLabel: article'
PASS article.childAtIndex(0).traits != nonLandmarkText.traits is true
Modified: trunk/LayoutTests/accessibility/ios-simulator/landmark-type.html (242050 => 242051)
--- trunk/LayoutTests/accessibility/ios-simulator/landmark-type.html 2019-02-25 19:11:57 UTC (rev 242050)
+++ trunk/LayoutTests/accessibility/ios-simulator/landmark-type.html 2019-02-25 19:15:23 UTC (rev 242051)
@@ -66,7 +66,7 @@
shouldBeTrue("region.childAtIndex(0).traits != nonLandmarkText.traits");
var footer = accessibilityController.accessibleElementById("footer");
- shouldBe("footer.description", "'AXLabel: footer'");
+ shouldBe("footer.description", "'AXLabel: content information'");
shouldBeTrue("footer.childAtIndex(0).traits != nonLandmarkText.traits");
var article = accessibilityController.accessibleElementById("article");
Modified: trunk/LayoutTests/accessibility/mac/footer-expected.txt (242050 => 242051)
--- trunk/LayoutTests/accessibility/mac/footer-expected.txt 2019-02-25 19:11:57 UTC (rev 242050)
+++ trunk/LayoutTests/accessibility/mac/footer-expected.txt 2019-02-25 19:15:23 UTC (rev 242051)
@@ -1,9 +1,9 @@
PASS accessibilityController.focusedElement.role is "AXRole: AXGroup"
+PASS accessibilityController.focusedElement.roleDescription is "AXRoleDescription: content information"
+PASS accessibilityController.focusedElement.role is "AXRole: AXGroup"
PASS accessibilityController.focusedElement.roleDescription is "AXRoleDescription: footer"
PASS accessibilityController.focusedElement.role is "AXRole: AXGroup"
-PASS accessibilityController.focusedElement.roleDescription is "AXRoleDescription: group"
-PASS accessibilityController.focusedElement.role is "AXRole: AXGroup"
-PASS accessibilityController.focusedElement.roleDescription is "AXRoleDescription: group"
+PASS accessibilityController.focusedElement.roleDescription is "AXRoleDescription: footer"
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/accessibility/mac/footer-roledescription-expected.txt (242050 => 242051)
--- trunk/LayoutTests/accessibility/mac/footer-roledescription-expected.txt 2019-02-25 19:11:57 UTC (rev 242050)
+++ trunk/LayoutTests/accessibility/mac/footer-roledescription-expected.txt 2019-02-25 19:15:23 UTC (rev 242051)
@@ -1,14 +1,23 @@
-footer
-content info
-This tests that a footer element has a different role description from a contentinfo
+This tests that a footer element and content info has the right role at the right time.
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 footer1.role is 'AXRole: AXGroup'
+PASS footer1.subrole is 'AXSubrole: AXLandmarkContentInfo'
+PASS footer1.roleDescription is 'AXRoleDescription: content information'
+PASS contentinfo.role is 'AXRole: AXGroup'
+PASS contentinfo.subrole is 'AXSubrole: AXLandmarkContentInfo'
+PASS contentinfo.roleDescription is 'AXRoleDescription: content information'
+PASS footer2.role is 'AXRole: AXGroup'
+PASS footer2.subrole is 'AXSubrole: AXFooter'
+PASS footer2.roleDescription is 'AXRoleDescription: footer'
+PASS footer3.role is 'AXRole: AXGroup'
+PASS footer3.subrole is 'AXSubrole: AXFooter'
+PASS footer3.roleDescription is 'AXRoleDescription: footer'
+PASS footer4.role is 'AXRole: AXGroup'
+PASS footer4.subrole is 'AXSubrole: AXFooter'
+PASS footer4.roleDescription is 'AXRoleDescription: footer'
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/accessibility/mac/footer-roledescription.html (242050 => 242051)
--- trunk/LayoutTests/accessibility/mac/footer-roledescription.html 2019-02-25 19:11:57 UTC (rev 242050)
+++ trunk/LayoutTests/accessibility/mac/footer-roledescription.html 2019-02-25 19:15:23 UTC (rev 242051)
@@ -5,29 +5,69 @@
</head>
<body id="body">
-<footer>footer</footer>
-<div role="contentinfo">content info</div>
+<div id="content">
+
+<footer id="footer1">footer that is contentinfo</footer>
+
+<div role="contentinfo" id="contentinfo">content info</div>
+
+<main>
+ <footer id="footer2">footer that is not contentinfo</footer>
+</main>
+
+<blockquote>
+ <footer id="footer3">footer that is not contentinfo</footer>
+</blockquote>
+
+<fieldset>
+ <footer id="footer3">footer that is not contentinfo</footer>
+</fieldset>
+
+<details open>
+ <footer id="footer4">footer that is not contentinfo</footer>
+</details>
+
+</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");
+ description("This tests that a footer element and content info has the right role at the right time.");
if (window.accessibilityController) {
- // this text field should be required.
- document.getElementById("body").focus();
- var obj = accessibilityController.focusedElement;
+ // Scoped to body, becomes a content info.
+ var footer1 = accessibilityController.accessibleElementById("footer1");
+ var contentinfo = accessibilityController.accessibleElementById("contentinfo");
- var footer = obj.childAtIndex(0);
- var contentInfo = obj.childAtIndex(1);
+ // Scoped to other element types, not a content info.
+ var footer2 = accessibilityController.accessibleElementById("footer2");
+ var footer3 = accessibilityController.accessibleElementById("footer3");
+ var footer4 = accessibilityController.accessibleElementById("footer4");
- shouldBe("footer.role", "contentInfo.role");
- shouldBe("footer.subrole", "contentInfo.subrole");
- shouldBe("footer.roleDescription", "'AXRoleDescription: footer'");
- shouldBe("contentInfo.roleDescription", "'AXRoleDescription: content information'");
+ shouldBe("footer1.role", "'AXRole: AXGroup'");
+ shouldBe("footer1.subrole", "'AXSubrole: AXLandmarkContentInfo'");
+ shouldBe("footer1.roleDescription", "'AXRoleDescription: content information'");
+ shouldBe("contentinfo.role", "'AXRole: AXGroup'");
+ shouldBe("contentinfo.subrole", "'AXSubrole: AXLandmarkContentInfo'");
+ shouldBe("contentinfo.roleDescription", "'AXRoleDescription: content information'");
+
+ shouldBe("footer2.role", "'AXRole: AXGroup'");
+ shouldBe("footer2.subrole", "'AXSubrole: AXFooter'");
+ shouldBe("footer2.roleDescription", "'AXRoleDescription: footer'");
+
+ shouldBe("footer3.role", "'AXRole: AXGroup'");
+ shouldBe("footer3.subrole", "'AXSubrole: AXFooter'");
+ shouldBe("footer3.roleDescription", "'AXRoleDescription: footer'");
+
+ shouldBe("footer4.role", "'AXRole: AXGroup'");
+ shouldBe("footer4.subrole", "'AXSubrole: AXFooter'");
+ shouldBe("footer4.roleDescription", "'AXRoleDescription: footer'");
+
+ document.getElementById("content").style.visibility = "hidden";
}
</script>
Modified: trunk/LayoutTests/accessibility/mac/footer.html (242050 => 242051)
--- trunk/LayoutTests/accessibility/mac/footer.html 2019-02-25 19:11:57 UTC (rev 242050)
+++ trunk/LayoutTests/accessibility/mac/footer.html 2019-02-25 19:15:23 UTC (rev 242051)
@@ -27,9 +27,9 @@
shouldBeEqualToString('accessibilityController.focusedElement.roleDescription', "AXRoleDescription: " + expectedDescription);
}
- expectRole('AXGroup', 'footer', '#footer01');
- expectRole('AXGroup', 'group', '#footer02');
- expectRole('AXGroup', 'group', '#footer03');
+ expectRole('AXGroup', 'content information', '#footer01');
+ expectRole('AXGroup', 'footer', '#footer02');
+ expectRole('AXGroup', 'footer', '#footer03');
</script>
<script src=''></script>
</body>
Modified: trunk/LayoutTests/accessibility/roles-computedRoleString-expected.txt (242050 => 242051)
--- trunk/LayoutTests/accessibility/roles-computedRoleString-expected.txt 2019-02-25 19:11:57 UTC (rev 242050)
+++ trunk/LayoutTests/accessibility/roles-computedRoleString-expected.txt 2019-02-25 19:15:23 UTC (rev 242051)
@@ -9,7 +9,7 @@
PASS: button -> button.
PASS: dfn -> definition.
PASS: dl -> .
-PASS: footer -> .
+PASS: footer -> contentinfo.
PASS: form -> form.
PASS: header -> banner.
PASS: h1 -> heading.
Modified: trunk/LayoutTests/accessibility/roles-computedRoleString.html (242050 => 242051)
--- trunk/LayoutTests/accessibility/roles-computedRoleString.html 2019-02-25 19:11:57 UTC (rev 242050)
+++ trunk/LayoutTests/accessibility/roles-computedRoleString.html 2019-02-25 19:15:23 UTC (rev 242051)
@@ -17,7 +17,7 @@
<dt>X</dt>
<dd>X</dd>
</dl>
-<footer data-role="" data-platform="atk,mac" class="ex">X</footer>
+<footer data-role="contentinfo" data-platform="atk,mac" class="ex">X</footer>
<form data-role="form" data-platform="atk,mac" class="ex">X</form>
<header data-role="banner" data-platform="atk,mac" class="ex">X</header>
<h1 data-role="heading" data-platform="atk,mac" class="ex">X</h1>
Modified: trunk/LayoutTests/platform/gtk/accessibility/roles-computedRoleString-expected.txt (242050 => 242051)
--- trunk/LayoutTests/platform/gtk/accessibility/roles-computedRoleString-expected.txt 2019-02-25 19:11:57 UTC (rev 242050)
+++ trunk/LayoutTests/platform/gtk/accessibility/roles-computedRoleString-expected.txt 2019-02-25 19:15:23 UTC (rev 242051)
@@ -9,7 +9,7 @@
PASS: button -> button.
PASS: dfn -> definition.
PASS: dl -> .
-PASS: footer -> .
+PASS: footer -> contentinfo.
PASS: form -> form.
PASS: header -> banner.
PASS: h1 -> heading.
Modified: trunk/LayoutTests/platform/mac/accessibility/roles-computedRoleString-expected.txt (242050 => 242051)
--- trunk/LayoutTests/platform/mac/accessibility/roles-computedRoleString-expected.txt 2019-02-25 19:11:57 UTC (rev 242050)
+++ trunk/LayoutTests/platform/mac/accessibility/roles-computedRoleString-expected.txt 2019-02-25 19:15:23 UTC (rev 242051)
@@ -9,7 +9,7 @@
PASS: button -> button.
PASS: dfn -> definition.
PASS: dl -> .
-PASS: footer -> .
+PASS: footer -> contentinfo.
PASS: form -> form.
PASS: header -> banner.
PASS: h1 -> heading.
Modified: trunk/LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt (242050 => 242051)
--- trunk/LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt 2019-02-25 19:11:57 UTC (rev 242050)
+++ trunk/LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt 2019-02-25 19:15:23 UTC (rev 242051)
@@ -132,7 +132,7 @@
footer
AXRole: AXGroup
AXSubrole: AXLandmarkContentInfo
- AXRoleDescription: footer
+ AXRoleDescription: content information
form
AXRole: AXGroup
Modified: trunk/LayoutTests/platform/mac-wk2/accessibility/roles-exposed-expected.txt (242050 => 242051)
--- trunk/LayoutTests/platform/mac-wk2/accessibility/roles-exposed-expected.txt 2019-02-25 19:11:57 UTC (rev 242050)
+++ trunk/LayoutTests/platform/mac-wk2/accessibility/roles-exposed-expected.txt 2019-02-25 19:15:23 UTC (rev 242051)
@@ -132,7 +132,7 @@
footer
AXRole: AXGroup
AXSubrole: AXLandmarkContentInfo
- AXRoleDescription: footer
+ AXRoleDescription: content information
form
AXRole: AXGroup
Modified: trunk/Source/WebCore/ChangeLog (242050 => 242051)
--- trunk/Source/WebCore/ChangeLog 2019-02-25 19:11:57 UTC (rev 242050)
+++ trunk/Source/WebCore/ChangeLog 2019-02-25 19:15:23 UTC (rev 242051)
@@ -1,3 +1,27 @@
+2019-02-25 Chris Fleizach <[email protected]>
+
+ AX: <footer> HTML5 tag not reading as ARIA Landmark to VoiceOver
+ https://bugs.webkit.org/show_bug.cgi?id=190138
+ <rdar://problem/44907695>
+
+ Reviewed by Joanmarie Diggs.
+
+ Make sure that footer elements use the right role depending on their context.
+ If scoped to body, they become contentinfo. Otherwise they are just delineated by
+ a footer subrole.
+
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::AccessibilityObject::isLandmark const):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
+ (WebCore::AccessibilityRenderObject::isDescendantOfElementType const):
+ (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
+ * accessibility/AccessibilityRenderObject.h:
+ * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+ (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
+ * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+ (-[WebAccessibilityObjectWrapper subrole]):
+
2019-02-25 Sihui Liu <[email protected]>
IndexedDB: IDBDatabase and IDBTransaction are leaked in layout tests
Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (242050 => 242051)
--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2019-02-25 19:11:57 UTC (rev 242050)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2019-02-25 19:15:23 UTC (rev 242051)
@@ -409,16 +409,19 @@
bool AccessibilityObject::isLandmark() const
{
- AccessibilityRole role = roleValue();
-
- return role == AccessibilityRole::LandmarkBanner
- || role == AccessibilityRole::LandmarkComplementary
- || role == AccessibilityRole::LandmarkContentInfo
- || role == AccessibilityRole::LandmarkDocRegion
- || role == AccessibilityRole::LandmarkMain
- || role == AccessibilityRole::LandmarkNavigation
- || role == AccessibilityRole::LandmarkRegion
- || role == AccessibilityRole::LandmarkSearch;
+ switch (roleValue()) {
+ case AccessibilityRole::LandmarkBanner:
+ case AccessibilityRole::LandmarkComplementary:
+ case AccessibilityRole::LandmarkContentInfo:
+ case AccessibilityRole::LandmarkDocRegion:
+ case AccessibilityRole::LandmarkMain:
+ case AccessibilityRole::LandmarkNavigation:
+ case AccessibilityRole::LandmarkRegion:
+ case AccessibilityRole::LandmarkSearch:
+ return true;
+ default:
+ return false;
+ }
}
bool AccessibilityObject::hasMisspelling() const
Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (242050 => 242051)
--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2019-02-25 19:11:57 UTC (rev 242050)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2019-02-25 19:15:23 UTC (rev 242051)
@@ -1273,6 +1273,7 @@
case AccessibilityRole::DescriptionListDetail:
case AccessibilityRole::Details:
case AccessibilityRole::DocumentArticle:
+ case AccessibilityRole::Footer:
case AccessibilityRole::LandmarkRegion:
case AccessibilityRole::ListItem:
case AccessibilityRole::Time:
@@ -2628,6 +2629,15 @@
return nullptr;
}
+bool AccessibilityRenderObject::isDescendantOfElementType(const HashSet<QualifiedName>& tagNames) const
+{
+ for (auto& ancestor : ancestorsOfType<RenderElement>(*m_renderer)) {
+ if (ancestor.element() && tagNames.contains(ancestor.element()->tagQName()))
+ return true;
+ }
+ return false;
+}
+
bool AccessibilityRenderObject::isDescendantOfElementType(const QualifiedName& tagName) const
{
for (auto& ancestor : ancestorsOfType<RenderElement>(*m_renderer)) {
@@ -2853,10 +2863,16 @@
// There should only be one banner/contentInfo per page. If header/footer are being used within an article or section
// then it should not be exposed as whole page's banner/contentInfo
- if (node && node->hasTagName(headerTag) && !isDescendantOfElementType(articleTag) && !isDescendantOfElementType(sectionTag))
+ if (node && node->hasTagName(headerTag) && !isDescendantOfElementType({ articleTag, sectionTag }))
return AccessibilityRole::LandmarkBanner;
- if (node && node->hasTagName(footerTag) && !isDescendantOfElementType(articleTag) && !isDescendantOfElementType(sectionTag))
+
+ // http://webkit.org/b/190138 Footers should become contentInfo's if scoped to body (and consequently become a landmark).
+ // It should remain a footer if scoped to main, sectioning elements (article, section) or root sectioning element (blockquote, details, dialog, fieldset, figure, td).
+ if (node && node->hasTagName(footerTag)) {
+ if (!isDescendantOfElementType({ articleTag, sectionTag, mainTag, blockquoteTag, detailsTag, fieldsetTag, figureTag, tdTag }))
+ return AccessibilityRole::LandmarkContentInfo;
return AccessibilityRole::Footer;
+ }
// menu tags with toolbar type should have Toolbar role.
if (node && node->hasTagName(menuTag) && equalLettersIgnoringASCIICase(getAttribute(typeAttr), "toolbar"))
Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h (242050 => 242051)
--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h 2019-02-25 19:11:57 UTC (rev 242050)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h 2019-02-25 19:15:23 UTC (rev 242051)
@@ -244,7 +244,8 @@
bool renderObjectIsObservable(RenderObject&) const;
RenderObject* renderParentObject() const;
bool isDescendantOfElementType(const QualifiedName& tagName) const;
-
+ bool isDescendantOfElementType(const HashSet<QualifiedName>&) const;
+
bool isSVGImage() const;
void detachRemoteSVGRoot();
enum CreationChoice { Create, Retrieve };
Modified: trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (242050 => 242051)
--- trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm 2019-02-25 19:11:57 UTC (rev 242050)
+++ trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm 2019-02-25 19:15:23 UTC (rev 242051)
@@ -526,7 +526,6 @@
case AccessibilityRole::Document:
case AccessibilityRole::DocumentArticle:
case AccessibilityRole::DocumentNote:
- case AccessibilityRole::Footer:
case AccessibilityRole::LandmarkBanner:
case AccessibilityRole::LandmarkComplementary:
case AccessibilityRole::LandmarkContentInfo:
Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (242050 => 242051)
--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm 2019-02-25 19:11:57 UTC (rev 242050)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm 2019-02-25 19:15:23 UTC (rev 242051)
@@ -2058,7 +2058,9 @@
return NSAccessibilityContentSeparatorSubrole;
if (role == AccessibilityRole::ToggleButton)
return NSAccessibilityToggleSubrole;
-
+ if (role == AccessibilityRole::Footer)
+ return @"AXFooter";
+
if (is<AccessibilitySpinButtonPart>(*m_object)) {
if (downcast<AccessibilitySpinButtonPart>(*m_object).isIncrementor())
return NSAccessibilityIncrementArrowSubrole;
@@ -2090,8 +2092,6 @@
return @"AXLandmarkBanner";
case AccessibilityRole::LandmarkComplementary:
return @"AXLandmarkComplementary";
- // Footer roles should appear as content info types.
- case AccessibilityRole::Footer:
case AccessibilityRole::LandmarkContentInfo:
return @"AXLandmarkContentInfo";
case AccessibilityRole::LandmarkMain: