Title: [181988] trunk
Revision
181988
Author
[email protected]
Date
2015-03-25 17:53:52 -0700 (Wed, 25 Mar 2015)

Log Message

AX: table cells that use display:block render the table inaccessible to VoiceOver
https://bugs.webkit.org/show_bug.cgi?id=143007

Reviewed by Mario Sanchez Prada.

Source/WebCore:

When display:block is used on a table cell, it was being ignored because it was anonymous.
This is still a valid scenario however if it's still inside of a valid table.

Test: accessibility/table-cell-display-block.html

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

LayoutTests:

* accessibility/table-cell-display-block-expected.txt: Added.
* accessibility/table-cell-display-block.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (181987 => 181988)


--- trunk/LayoutTests/ChangeLog	2015-03-26 00:46:57 UTC (rev 181987)
+++ trunk/LayoutTests/ChangeLog	2015-03-26 00:53:52 UTC (rev 181988)
@@ -1,3 +1,13 @@
+2015-03-25  Chris Fleizach  <[email protected]>
+
+        AX: table cells that use display:block render the table inaccessible to VoiceOver
+        https://bugs.webkit.org/show_bug.cgi?id=143007
+
+        Reviewed by Mario Sanchez Prada.
+
+        * accessibility/table-cell-display-block-expected.txt: Added.
+        * accessibility/table-cell-display-block.html: Added.
+
 2015-03-25  Joseph Pecoraro  <[email protected]>
 
         Add a few more tests for Class names

Added: trunk/LayoutTests/accessibility/table-cell-display-block-expected.txt (0 => 181988)


--- trunk/LayoutTests/accessibility/table-cell-display-block-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/table-cell-display-block-expected.txt	2015-03-26 00:53:52 UTC (rev 181988)
@@ -0,0 +1,14 @@
+This tests that if a table cell uses display:block, the table cell will still be accessible
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS cell1a.isEqual(cell1b) is true
+PASS cell1a.role is 'AXRole: AXCell'
+PASS domCell1.style.display is 'block'
+PASS table2.role is 'AXRole: AXGroup'
+PASS cell2.role is 'AXRole: AXStaticText'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/table-cell-display-block.html (0 => 181988)


--- trunk/LayoutTests/accessibility/table-cell-display-block.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/table-cell-display-block.html	2015-03-26 00:53:52 UTC (rev 181988)
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+<div id="content">
+
+<table border=1 id="table1">
+  <tr><td id="cell1" style="display:block;">a1</td><td>b1</td><td>c1</td></tr>
+  <tr><td style="display:block;">a2</td><td>b2</td><td>c2</td></tr>
+</table>
+
+<table border=1 id="table2" role="group">
+  <tr><td id="cell2" style="display:block;">a1</td><td>b1</td><td>c1</td></tr>
+  <tr><td style="display:block;">a2</td><td>b2</td><td>c2</td></tr>
+</table>
+
+</div>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+    description("This tests that if a table cell uses display:block, the table cell will still be accessible");
+
+    if (window.accessibilityController) {
+        var table = accessibilityController.accessibleElementById("table1");
+        var cell1a = table.cellForColumnAndRow(0, 0);
+        var cell1b = table.childAtIndex(0).childAtIndex(0);
+
+        shouldBeTrue("cell1a.isEqual(cell1b)");
+        shouldBe("cell1a.role", "'AXRole: AXCell'");
+        
+        var domCell1 = document.getElementById("cell1");
+        shouldBe("domCell1.style.display", "'block'");
+
+        // Now check a table that uses a different role to make sure we don't have any cell roles.
+        var table2 = accessibilityController.accessibleElementById("table2");
+        shouldBe("table2.role", "'AXRole: AXGroup'");
+        var cell2 = table2.childAtIndex(0).childAtIndex(0);
+        shouldBe("cell2.role", "'AXRole: AXStaticText'");
+
+        document.getElementById("content").style.visibility = "hidden";
+    }
+
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (181987 => 181988)


--- trunk/Source/WebCore/ChangeLog	2015-03-26 00:46:57 UTC (rev 181987)
+++ trunk/Source/WebCore/ChangeLog	2015-03-26 00:53:52 UTC (rev 181988)
@@ -1,3 +1,18 @@
+2015-03-25  Chris Fleizach  <[email protected]>
+
+        AX: table cells that use display:block render the table inaccessible to VoiceOver
+        https://bugs.webkit.org/show_bug.cgi?id=143007
+
+        Reviewed by Mario Sanchez Prada.
+
+        When display:block is used on a table cell, it was being ignored because it was anonymous.
+        This is still a valid scenario however if it's still inside of a valid table.
+
+        Test: accessibility/table-cell-display-block.html
+
+        * accessibility/AccessibilityTableCell.cpp:
+        (WebCore::AccessibilityTableCell::computeAccessibilityIsIgnored):
+
 2015-03-25  Tim Horton  <[email protected]>
 
         Add a preference to prevent "user-scalable=no" from having any effect

Modified: trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp (181987 => 181988)


--- trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp	2015-03-26 00:46:57 UTC (rev 181987)
+++ trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp	2015-03-26 00:53:52 UTC (rev 181988)
@@ -64,8 +64,10 @@
     if (decision == IgnoreObject)
         return true;
     
-    // Ignore anonymous table cells.
-    if (!node())
+    // Ignore anonymous table cells as long as they're not in a table (ie. when display:table is used).
+    RenderObject* renderTable = is<RenderTableCell>(m_renderer) ? downcast<RenderTableCell>(*m_renderer).table() : nullptr;
+    bool inTable = renderTable && renderTable->node() && (renderTable->node()->hasTagName(tableTag) || nodeHasRole(renderTable->node(), "grid"));
+    if (!node() && !inTable)
         return true;
         
     if (!isTableCell())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to