Title: [212270] trunk
Revision
212270
Author
commit-qu...@webkit.org
Date
2017-02-13 18:11:09 -0800 (Mon, 13 Feb 2017)

Log Message

Source/WebCore:
Added the other missing BSTR roles tag names.
https://bugs.webkit.org/show_bug.cgi?id=165545

Patch by Karim H <ka...@karhm.com> on 2017-02-13
Reviewed by Chris Fleizach.

Test: accessibility/win/bstr-elements-role.html

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

LayoutTests:
Added the BSTR roles tag test for Windows.
https://bugs.webkit.org/show_bug.cgi?id=165545

Patch by Karim H <ka...@karhm.com> on 2017-02-13
Reviewed by Chris Fleizach.

* accessibility/win/bstr-elements-role-expected.txt: Added.
* accessibility/win/bstr-elements-role.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (212269 => 212270)


--- trunk/LayoutTests/ChangeLog	2017-02-14 02:09:03 UTC (rev 212269)
+++ trunk/LayoutTests/ChangeLog	2017-02-14 02:11:09 UTC (rev 212270)
@@ -1,3 +1,13 @@
+2017-02-13  Karim H  <ka...@karhm.com>
+
+        Added the BSTR roles tag test for Windows.
+        https://bugs.webkit.org/show_bug.cgi?id=165545
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/win/bstr-elements-role-expected.txt: Added.
+        * accessibility/win/bstr-elements-role.html: Added.
+
 2017-02-13  Said Abou-Hallawa  <sabouhall...@apple.com>
 
         The current frame of an image should not deleted if another frame is asynchronously being decoded

Added: trunk/LayoutTests/accessibility/win/bstr-elements-role-expected.txt (0 => 212270)


--- trunk/LayoutTests/accessibility/win/bstr-elements-role-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/win/bstr-elements-role-expected.txt	2017-02-14 02:11:09 UTC (rev 212270)
@@ -0,0 +1,62 @@
+abbr
+
+acronym
+
+blockquote
+
+dd
+
+dl
+
+dt
+
+form
+
+frame
+
+h1
+
+h2
+
+h3
+
+h4
+
+h5
+
+h6
+
+iframe
+
+q
+
+tbody
+
+tfoot
+
+thead
+
+This test verifies that on Windows, the following elements: abbr, acronym, blockquote, dd, dl, dt, form, frame, h1, h2, h3, h4, h5, h6, iframe, q, tbody, tfoot, thead return their tag name for their 'role' property.
+
+Bug 165545 - WebCore::AccessibilityRenderObject add the other tag names that should be returned as the role
+
+PASS e.role is "AXRole: ABBR"
+PASS e.role is "AXRole: ACRONYM"
+PASS e.role is "AXRole: BLOCKQUOTE"
+PASS e.role is "AXRole: DD"
+PASS e.role is "AXRole: DL"
+PASS e.role is "AXRole: DT"                
+PASS e.role is "AXRole: FORM"
+PASS e.role is "AXRole: FRAME"
+PASS e.role is "AXRole: H1"
+PASS e.role is "AXRole: H2"
+PASS e.role is "AXRole: H3"
+PASS e.role is "AXRole: H4"
+PASS e.role is "AXRole: H5"
+PASS e.role is "AXRole: H6"
+PASS e.role is "AXRole: IFRAME"
+PASS e.role is "AXRole: Q"
+PASS e.role is "AXRole: TBODY"
+PASS e.role is "AXRole: TFOOT"
+PASS e.role is "AXRole: THEAD"
+

Added: trunk/LayoutTests/accessibility/win/bstr-elements-role.html (0 => 212270)


--- trunk/LayoutTests/accessibility/win/bstr-elements-role.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/win/bstr-elements-role.html	2017-02-14 02:11:09 UTC (rev 212270)
@@ -0,0 +1,105 @@
+<html>
+    <head>
+        <script src=""
+
+        <script>
+            if (window.testRunner)
+                testRunner.dumpAsText();
+        </script>
+    </head>
+    <body id="body">
+        <abbr>abbr</abbr>
+        <acronym>acronym</acronym>
+        <blockquote>blockquote</blockquote>
+        <dd>dd</dd>
+        <dl>dl</dl>
+        <dt>dt</dt>
+        <form>form</form>
+        <frame>frame</frame>
+        <h1>h1</h1>
+        <h2>h2</h2>
+        <h3>h3</h3>
+        <h4>h4</h4>
+        <h5>h5</h5>
+        <h6>h6</h6>
+        <iframe>iframe</iframe>
+        <q>q</q>
+        <tbody>tbody</tbody>
+        <tfoot>tfoot</tfoot>
+        <thead>thead</thead>
+    
+
+        <p>
+            This test verifies that on Windows, the following elements: <b>abbr, acronym, blockquote, dd, dl, dt, form, frame, h1, h2, h3, h4, h5, h6,
+            iframe, q, tbody, tfoot, thead</b> return their
+            tag name for their 'role' property.
+            <br><br>
+            <a href="" add the other tag names that should be returned as the role</a>
+        </p>
+
+        <p id="console"></p>
+
+        <script>
+            if (window.accessibilityController) {
+                document.getElementById("body").focus();
+
+                var e = accessibilityController.focusedElement.childAtIndex(0);
+                shouldBe('e.role', '"AXRole: ABBR"');
+
+                e = accessibilityController.focusedElement.childAtIndex(1);
+                shouldBe('e.role', '"AXRole: ACRONYM"');
+
+                e = accessibilityController.focusedElement.childAtIndex(2);
+                shouldBe('e.role', '"AXRole: BLOCKQUOTE"');
+
+                e = accessibilityController.focusedElement.childAtIndex(3);
+                shouldBe('e.role', '"AXRole: DD"');
+
+                e = accessibilityController.focusedElement.childAtIndex(4);
+                shouldBe('e.role', '"AXRole: DL"');
+
+                e = accessibilityController.focusedElement.childAtIndex(5);
+                shouldBe('e.role', '"AXRole: DT"');
+                
+                e = accessibilityController.focusedElement.childAtIndex(6);
+                shouldBe('e.role', '"AXRole: FORM"');
+
+                e = accessibilityController.focusedElement.childAtIndex(7);
+                shouldBe('e.role', '"AXRole: FRAME"');
+
+                e = accessibilityController.focusedElement.childAtIndex(8);
+                shouldBe('e.role', '"AXRole: H1"');
+
+                e = accessibilityController.focusedElement.childAtIndex(9);
+                shouldBe('e.role', '"AXRole: H2"');
+
+                e = accessibilityController.focusedElement.childAtIndex(10);
+                shouldBe('e.role', '"AXRole: H3"');
+
+                e = accessibilityController.focusedElement.childAtIndex(11);
+                shouldBe('e.role', '"AXRole: H4"');
+                
+                e = accessibilityController.focusedElement.childAtIndex(12);
+                shouldBe('e.role', '"AXRole: H5"');
+
+                e = accessibilityController.focusedElement.childAtIndex(13);
+                shouldBe('e.role', '"AXRole: H6"');
+
+                e = accessibilityController.focusedElement.childAtIndex(14);
+                shouldBe('e.role', '"AXRole: IFRAME"');
+                
+                e = accessibilityController.focusedElement.childAtIndex(15);
+                shouldBe('e.role', '"AXRole: Q"');
+                
+                e = accessibilityController.focusedElement.childAtIndex(16);
+                shouldBe('e.role', '"AXRole: TBODY"');
+                
+                e = accessibilityController.focusedElement.childAtIndex(17);
+                shouldBe('e.role', '"AXRole: TFOOT"');
+                
+                e = accessibilityController.focusedElement.childAtIndex(18);
+                shouldBe('e.role', '"AXRole: THEAD"');
+            }
+        </script>
+    </body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (212269 => 212270)


--- trunk/Source/WebCore/ChangeLog	2017-02-14 02:09:03 UTC (rev 212269)
+++ trunk/Source/WebCore/ChangeLog	2017-02-14 02:11:09 UTC (rev 212270)
@@ -1,3 +1,15 @@
+2017-02-13  Karim H  <ka...@karhm.com>
+
+        Added the other missing BSTR roles tag names.
+        https://bugs.webkit.org/show_bug.cgi?id=165545
+
+        Reviewed by Chris Fleizach.
+
+        Test: accessibility/win/bstr-elements-role.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::shouldReturnTagNameAsRoleForMSAA):
+
 2017-02-13  Youenn Fablet  <youe...@gmail.com>
 
         [WebRTC] Creating RTCPeerConnection with libwebrtc backend is crashing on rwt

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (212269 => 212270)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2017-02-14 02:09:03 UTC (rev 212269)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2017-02-14 02:11:09 UTC (rev 212270)
@@ -3566,12 +3566,16 @@
 
 static bool shouldReturnTagNameAsRoleForMSAA(const Element& element)
 {
-    // See "document structure",
-    // https://wiki.mozilla.org/Accessibility/AT-Windows-API
-    // FIXME: Add the other tag names that should be returned as the role.
-    return element.hasTagName(h1Tag) || element.hasTagName(h2Tag) 
+    return element.hasTagName(abbrTag) || element.hasTagName(acronymTag)
+        || element.hasTagName(blockquoteTag) || element.hasTagName(ddTag)
+        || element.hasTagName(dlTag) || element.hasTagName(dtTag)
+        || element.hasTagName(formTag) || element.hasTagName(frameTag)
+        || element.hasTagName(h1Tag) || element.hasTagName(h2Tag)
         || element.hasTagName(h3Tag) || element.hasTagName(h4Tag)
-        || element.hasTagName(h5Tag) || element.hasTagName(h6Tag);
+        || element.hasTagName(h5Tag) || element.hasTagName(h6Tag)
+        || element.hasTagName(iframeTag) || element.hasTagName(qTag)
+        || element.hasTagName(tbodyTag) || element.hasTagName(tfootTag)
+        || element.hasTagName(theadTag);
 }
 
 String AccessibilityRenderObject::stringRoleForMSAA() const
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to