Title: [184046] trunk
Revision
184046
Author
[email protected]
Date
2015-05-10 07:52:50 -0700 (Sun, 10 May 2015)

Log Message

AX: Don't expose elements as data tables just because they use display: table
https://bugs.webkit.org/show_bug.cgi?id=144804

Reviewed by Mario Sanchez Prada.

Source/WebCore:

Elements will create RenderTable objects if they have display:table. We shouldn't assume these are accessibility tables.

Test: accessibility/css-table-ignored.html

* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::isDataTable):

LayoutTests:

* accessibility/css-table-ignored-expected.txt: Added.
* accessibility/css-table-ignored.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (184045 => 184046)


--- trunk/LayoutTests/ChangeLog	2015-05-10 12:23:07 UTC (rev 184045)
+++ trunk/LayoutTests/ChangeLog	2015-05-10 14:52:50 UTC (rev 184046)
@@ -1,3 +1,13 @@
+2015-05-10  Chris Fleizach  <[email protected]>
+
+        AX: Don't expose elements as data tables just because they use display: table
+        https://bugs.webkit.org/show_bug.cgi?id=144804
+
+        Reviewed by Mario Sanchez Prada.
+
+        * accessibility/css-table-ignored-expected.txt: Added.
+        * accessibility/css-table-ignored.html: Added.
+
 2015-05-09  Chris Dumez  <[email protected]>
 
         Introduce ParentNode.idl / NonDocumentTypeChildNode.idl

Added: trunk/LayoutTests/accessibility/css-table-ignored-expected.txt (0 => 184046)


--- trunk/LayoutTests/accessibility/css-table-ignored-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/css-table-ignored-expected.txt	2015-05-10 14:52:50 UTC (rev 184046)
@@ -0,0 +1,10 @@
+This tests that an element use display:table will not be exposed as an accessible table.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS !table || !table.isValid is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/css-table-ignored.html (0 => 184046)


--- trunk/LayoutTests/accessibility/css-table-ignored.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/css-table-ignored.html	2015-05-10 14:52:50 UTC (rev 184046)
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+<style>
+.layout-table { display:table; }
+.layout-table .second-cell, .layout-table .third-cell, .layout-table .third-cell-no-border { display: table-cell; }
+.layout-table .third-cell { border-left: 5px solid #f00; }
+</style>
+</head>
+
+<body id="body">
+
+<div id="content">
+<div class="layout-table" id="table">
+    <div class="first-cell a11y">Visually hidden div</div>
+    <div class="second-cell">Left div</div>
+    <div class="third-cell">Right div</div>
+</div>
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("This tests that an element use display:table will not be exposed as an accessible table.");
+
+if (window.accessibilityController) {
+    var table = accessibilityController.accessibleElementById("table");
+    shouldBeTrue("!table || !table.isValid");
+    document.getElementById("content").style.visibility = "hidden";
+}
+
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (184045 => 184046)


--- trunk/Source/WebCore/ChangeLog	2015-05-10 12:23:07 UTC (rev 184045)
+++ trunk/Source/WebCore/ChangeLog	2015-05-10 14:52:50 UTC (rev 184046)
@@ -1,3 +1,17 @@
+2015-05-10  Chris Fleizach  <[email protected]>
+
+        AX: Don't expose elements as data tables just because they use display: table
+        https://bugs.webkit.org/show_bug.cgi?id=144804
+
+        Reviewed by Mario Sanchez Prada.
+
+        Elements will create RenderTable objects if they have display:table. We shouldn't assume these are accessibility tables.
+
+        Test: accessibility/css-table-ignored.html
+
+        * accessibility/AccessibilityTable.cpp:
+        (WebCore::AccessibilityTable::isDataTable):
+
 2015-05-09  Chris Dumez  <[email protected]>
 
         Introduce ParentNode.idl / NonDocumentTypeChildNode.idl

Modified: trunk/Source/WebCore/accessibility/AccessibilityTable.cpp (184045 => 184046)


--- trunk/Source/WebCore/accessibility/AccessibilityTable.cpp	2015-05-10 12:23:07 UTC (rev 184045)
+++ trunk/Source/WebCore/accessibility/AccessibilityTable.cpp	2015-05-10 14:52:50 UTC (rev 184046)
@@ -150,6 +150,10 @@
         }
     }
     
+    // The following checks should only apply if this is a real <table> element.
+    if (!hasTagName(tableTag))
+        return false;
+    
     RenderTable& table = downcast<RenderTable>(*m_renderer);
     // go through the cell's and check for tell-tale signs of "data" table status
     // cells have borders, or use attributes like headers, abbr, scope or axis
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to