Title: [173428] trunk
Revision
173428
Author
[email protected]
Date
2014-09-09 08:09:57 -0700 (Tue, 09 Sep 2014)

Log Message

AX: HTML5 landmark (and related) elements should not be ignored.
https://bugs.webkit.org/show_bug.cgi?id=135116

Patch by Takeshi Kurosawa <[email protected]> on 2014-09-09
Reviewed by Chris Fleizach.

Make sure following element should not be ignored in computeAccessibilityIsIgnored
- header, aside, address, main, nav, article, section
- dt, dd

Source/WebCore:

Tests: platform/mac/accessibility/descriptionlist-not-ignored.html
       platform/mac/accessibility/landmark-not-ignored.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):

LayoutTests:

* platform/mac/accessibility/descriptionlist-not-ignored-expected.txt: Added.
* platform/mac/accessibility/descriptionlist-not-ignored.html: Added.
* platform/mac/accessibility/landmark-not-ignored-expected.txt: Added.
* platform/mac/accessibility/landmark-not-ignored.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (173427 => 173428)


--- trunk/LayoutTests/ChangeLog	2014-09-09 11:39:41 UTC (rev 173427)
+++ trunk/LayoutTests/ChangeLog	2014-09-09 15:09:57 UTC (rev 173428)
@@ -1,3 +1,19 @@
+2014-09-09  Takeshi Kurosawa  <[email protected]>
+
+        AX: HTML5 landmark (and related) elements should not be ignored.
+        https://bugs.webkit.org/show_bug.cgi?id=135116
+
+        Reviewed by Chris Fleizach.
+
+        Make sure following element should not be ignored in computeAccessibilityIsIgnored
+        - header, aside, address, main, nav, article, section
+        - dt, dd
+
+        * platform/mac/accessibility/descriptionlist-not-ignored-expected.txt: Added.
+        * platform/mac/accessibility/descriptionlist-not-ignored.html: Added.
+        * platform/mac/accessibility/landmark-not-ignored-expected.txt: Added.
+        * platform/mac/accessibility/landmark-not-ignored.html: Added.
+
 2014-09-08  Mihnea Ovidenie  <[email protected]>
 
         [CSSRegions]Incorrect layout for multicol element transformed into region

Added: trunk/LayoutTests/platform/mac/accessibility/descriptionlist-not-ignored-expected.txt (0 => 173428)


--- trunk/LayoutTests/platform/mac/accessibility/descriptionlist-not-ignored-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/descriptionlist-not-ignored-expected.txt	2014-09-09 15:09:57 UTC (rev 173428)
@@ -0,0 +1,16 @@
+term
+description
+This tests that dt and dd elements are not ignored if their render objects have block render objects children.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS test.childrenCount is 2
+PASS dt.role is "AXRole: AXGroup"
+PASS dt.subrole is "AXSubrole: AXTerm"
+PASS dd.role is "AXRole: AXGroup"
+PASS dd.subrole is "AXSubrole: AXDescription"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/mac/accessibility/descriptionlist-not-ignored.html (0 => 173428)


--- trunk/LayoutTests/platform/mac/accessibility/descriptionlist-not-ignored.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/descriptionlist-not-ignored.html	2014-09-09 15:09:57 UTC (rev 173428)
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+<dl id="test">
+<dt><div>term</div></dt>
+<dd><div>description</div></dd>
+</dl>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that dt and dd elements are not ignored if their render objects have block render objects children.");
+
+    if (window.accessibilityController) {
+        var test = accessibilityController.accessibleElementById("test");
+        shouldBe("test.childrenCount", "2");
+
+        var dt = test.childAtIndex(0);
+        shouldBeEqualToString("dt.role", "AXRole: AXGroup");
+        shouldBeEqualToString("dt.subrole", "AXSubrole: AXTerm");
+
+        var dd = test.childAtIndex(1);
+        shouldBeEqualToString("dd.role", "AXRole: AXGroup");
+        shouldBeEqualToString("dd.subrole", "AXSubrole: AXDescription");
+    }
+
+</script>
+
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/platform/mac/accessibility/landmark-not-ignored-expected.txt (0 => 173428)


--- trunk/LayoutTests/platform/mac/accessibility/landmark-not-ignored-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/landmark-not-ignored-expected.txt	2014-09-09 15:09:57 UTC (rev 173428)
@@ -0,0 +1,31 @@
+header
+aside
+address
+main
+nav
+article
+section
+This tests that HTML5 elements which have implicit landmark and related semantics are not ignored if their render objects have block render objects children.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS test.childrenCount is 7
+PASS el.role is "AXRole: AXGroup"
+PASS el.subrole is "AXSubrole: AXLandmarkBanner"
+PASS el.role is "AXRole: AXGroup"
+PASS el.subrole is "AXSubrole: AXLandmarkComplementary"
+PASS el.role is "AXRole: AXGroup"
+PASS el.subrole is "AXSubrole: AXLandmarkContentInfo"
+PASS el.role is "AXRole: AXGroup"
+PASS el.subrole is "AXSubrole: AXLandmarkMain"
+PASS el.role is "AXRole: AXGroup"
+PASS el.subrole is "AXSubrole: AXLandmarkNavigation"
+PASS el.role is "AXRole: AXGroup"
+PASS el.subrole is "AXSubrole: AXDocumentArticle"
+PASS el.role is "AXRole: AXGroup"
+PASS el.subrole is "AXSubrole: AXDocumentRegion"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/mac/accessibility/landmark-not-ignored.html (0 => 173428)


--- trunk/LayoutTests/platform/mac/accessibility/landmark-not-ignored.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/landmark-not-ignored.html	2014-09-09 15:09:57 UTC (rev 173428)
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+<div id="test" tabindex="-1">
+<header><div>header</div></header>
+<aside><div>aside</div></aside>
+<address><div>address</div></address>
+<main><div>main</div></main>
+<nav><div>nav</div></nav>
+<article><div>article</div></article>
+<section><div>section</div></section>
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that HTML5 elements which have implicit landmark and related semantics are not ignored if their render objects have block render objects children.");
+
+    if (window.accessibilityController) {
+        var test = accessibilityController.accessibleElementById("test");
+        shouldBe("test.childrenCount", "7");
+
+        var subroles = [
+            "LandmarkBanner",
+            "LandmarkComplementary",
+            "LandmarkContentInfo",
+            "LandmarkMain",
+            "LandmarkNavigation",
+            "DocumentArticle",
+            "DocumentRegion"
+        ];
+        for (var i = 0; i < test.childrenCount; i++) {
+            var el = test.childAtIndex(i);
+            shouldBeEqualToString("el.role", "AXRole: AXGroup");
+            shouldBeEqualToString("el.subrole", "AXSubrole: AX" + subroles[i]);
+        }
+    }
+
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (173427 => 173428)


--- trunk/Source/WebCore/ChangeLog	2014-09-09 11:39:41 UTC (rev 173427)
+++ trunk/Source/WebCore/ChangeLog	2014-09-09 15:09:57 UTC (rev 173428)
@@ -1,3 +1,20 @@
+2014-09-09  Takeshi Kurosawa  <[email protected]>
+
+        AX: HTML5 landmark (and related) elements should not be ignored.
+        https://bugs.webkit.org/show_bug.cgi?id=135116
+
+        Reviewed by Chris Fleizach.
+
+        Make sure following element should not be ignored in computeAccessibilityIsIgnored
+        - header, aside, address, main, nav, article, section
+        - dt, dd
+
+        Tests: platform/mac/accessibility/descriptionlist-not-ignored.html
+               platform/mac/accessibility/landmark-not-ignored.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
+
 2014-09-08  Sergio Villar Senin  <[email protected]>
 
         [CSS Grid Layout] RenderGrid methods should take RenderBox references

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (173427 => 173428)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2014-09-09 11:39:41 UTC (rev 173427)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2014-09-09 15:09:57 UTC (rev 173428)
@@ -1246,9 +1246,25 @@
     if (isLink())
         return false;
     
+    if (isLandmark())
+        return false;
+
     // all controls are accessible
     if (isControl())
         return false;
+
+    switch (roleValue()) {
+    case AudioRole:
+    case DescriptionListTermRole:
+    case DescriptionListDetailRole:
+    case DocumentArticleRole:
+    case DocumentRegionRole:
+    case ListItemRole:
+    case VideoRole:
+        return false;
+    default:
+        break;
+    }
     
     if (ariaRoleAttribute() != UnknownRole)
         return false;
@@ -1267,14 +1283,6 @@
     if (hasContentEditableAttributeSet())
         return false;
     
-    switch (roleValue()) {
-    case AudioRole:
-    case ListItemRole:
-    case VideoRole:
-        return false;
-    default:
-        break;
-    }
     
     // if this element has aria attributes on it, it should not be ignored.
     if (supportsARIAAttributes())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to