Diff
Modified: trunk/LayoutTests/ChangeLog (175407 => 175408)
--- trunk/LayoutTests/ChangeLog 2014-10-31 07:18:25 UTC (rev 175407)
+++ trunk/LayoutTests/ChangeLog 2014-10-31 12:45:55 UTC (rev 175408)
@@ -1,3 +1,24 @@
+2014-10-31 Andrzej Badowski <[email protected]>
+
+ [ATK] Improve AccessibilityTableCell's determineAccessibilityRole function.
+ https://bugs.webkit.org/show_bug.cgi?id=137737
+
+ Reviewed by Chris Fleizach.
+
+ The new test illustrates the different cases deciding whether a table cell
+ is a row header or column header or just a table cell.
+ Files of expected type and one html type are adapted to changes in the code of several member functions
+ of AccessibilityTableCell, i.e determineAccessibilityRole, isColumnHeaderCell, isRowHeaderCell.
+
+ * accessibility/table-cells-roles-expected.txt: Added.
+ * accessibility/table-cells-roles.html: Added.
+ * platform/efl/accessibility/table-attributes-expected.txt:
+ * platform/efl/accessibility/table-cells-expected.txt:
+ * platform/gtk/accessibility/table-attributes-expected.txt:
+ * platform/gtk/accessibility/table-cells-expected.txt:
+ * platform/gtk/accessibility/table-hierarchy-expected.txt:
+ * platform/gtk/accessibility/table-hierarchy.html:
+
2014-10-31 Roger Fong <[email protected]>
[Windows] Additional rebaselining after r175259.
Added: trunk/LayoutTests/accessibility/table-cells-roles-expected.txt (0 => 175408)
--- trunk/LayoutTests/accessibility/table-cells-roles-expected.txt (rev 0)
+++ trunk/LayoutTests/accessibility/table-cells-roles-expected.txt 2014-10-31 12:45:55 UTC (rev 175408)
@@ -0,0 +1,28 @@
+table
+No Country Capital
+1. Poland Warsaw
+2. Russia Moscow
+3. Ukraine Kiev
+All 3 countries 3 capitals
+
+table2
+No Country Capital
+1. Germany Berlin
+2. Sweden Stockholm
+3. Norway Oslo
+
+
+This test checks the correctness of roles for different cases of table cells.
+
+The table cell at (2,0) should have a role AXRole: AXColumnHeader , currently it has AXRole: AXColumnHeader .
+The table cell at (1,2) should have a role AXRole: AXCell , currently it has AXRole: AXCell .
+The table cell at (2,3) should have a role AXRole: AXCell , currently it has AXRole: AXCell .
+The table cell at (1,4) should have a role AXRole: AXCell , currently it has AXRole: AXCell .
+The table cell at (0,2) should have a role AXRole: AXRowHeader , currently it has AXRole: AXRowHeader .
+The table cell at (0,4) should have a role AXRole: AXRowHeader , currently it has AXRole: AXRowHeader .
+
+The table2 cell at (2,0) should have a role AXRole: AXColumnHeader , currently it has AXRole: AXCell .
+The table2 cell at (1,2) should have a role AXRole: AXCell , currently it has AXRole: AXCell .
+The table2 cell at (2,3) should have a role AXRole: AXCell , currently it has AXRole: AXCell .
+The table2 cell at (0,2) should have a role AXRole: AXRowHeader , currently it has AXRole: AXRowHeader .
+
Added: trunk/LayoutTests/accessibility/table-cells-roles.html (0 => 175408)
--- trunk/LayoutTests/accessibility/table-cells-roles.html (rev 0)
+++ trunk/LayoutTests/accessibility/table-cells-roles.html 2014-10-31 12:45:55 UTC (rev 175408)
@@ -0,0 +1,118 @@
+<html>
+<script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+</script>
+<body>
+
+<table id="table1">
+<caption>table</caption>
+ <thead>
+ <tr>
+ <th>No</th>
+ <th>Country</th>
+ <th id="cell1">Capital</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <th>1.</th>
+ <th>Poland</th>
+ <th >Warsaw</th>
+ </tr>
+ <tr>
+ <th id="cell5">2.</th>
+ <th id="cell2">Russia</th>
+ <th>Moscow</th>
+ </tr>
+ <tr>
+ <th>3.</th>
+ <td>Ukraine</td>
+ <th id="cell3">Kiev</th>
+ </tr>
+ </tbody>
+ <tfoot>
+ <tr>
+ <th id="cell6">All</th>
+ <th id="cell4">3 countries</th>
+ <th>3 capitals</th>
+ </tr>
+ </tfoot>
+</table>
+<br>
+<br>
+
+<table id="table2">
+<caption>table2</caption>
+ <tr>
+ <th>No</th>
+ <th>Country</th>
+ <th id="cell21">Capital</th>
+ </tr>
+ <tr>
+ <th>1.</th>
+ <th>Germany</th>
+ <th>Berlin</th>
+ </tr>
+ <tr>
+ <th id="cell25">2.</th>
+ <th id="cell22">Sweden</th>
+ <th>Stockholm</th>
+ </tr>
+ <tr>
+ <th>3.</th>
+ <td>Norway</td>
+ <th id="cell23">Oslo</th>
+ </tr>
+</table>
+
+
+<br>
+<br>
+<p>This test checks the correctness of roles for different cases of table cells.</p>
+<div id="result"></div>
+
+<script>
+ if (window.accessibilityController) {
+ var table = accessibilityController.accessibleElementById("table1");
+ var cell1 = table.cellForColumnAndRow(2, 0);
+ var role1 = cell1.role;
+ var cell2 = table.cellForColumnAndRow(1, 2);
+ var role2 = cell2.role;
+ var cell3 = table.cellForColumnAndRow(2, 3);
+ var role3 = cell3.role;
+ var cell4 = table.cellForColumnAndRow(1, 4);
+ var role4 = cell4.role;
+ var cell5 = table.cellForColumnAndRow(0, 2);
+ var role5 = cell5.role;
+ var cell6 = table.cellForColumnAndRow(0, 4);
+ var role6 = cell6.role;
+
+ result.innerText += "The table cell at (2,0) should have a role AXRole: AXColumnHeader , currently it has " + role1 + " .\n";
+ result.innerText += "The table cell at (1,2) should have a role AXRole: AXCell , currently it has " + role2 + " .\n";
+ result.innerText += "The table cell at (2,3) should have a role AXRole: AXCell , currently it has " + role3 + " .\n";
+ result.innerText += "The table cell at (1,4) should have a role AXRole: AXCell , currently it has " + role4 + " .\n";
+ result.innerText += "The table cell at (0,2) should have a role AXRole: AXRowHeader , currently it has " + role5 + " .\n";
+ result.innerText += "The table cell at (0,4) should have a role AXRole: AXRowHeader , currently it has " + role6 + " .\n";
+
+ result.innerText += "\n";
+
+ var table2 = accessibilityController.accessibleElementById("table2");
+ var cell21 = table2.cellForColumnAndRow(2, 0);
+ var role21 = cell21.role;
+ var cell22 = table2.cellForColumnAndRow(1, 2);
+ var role22 = cell22.role;
+ var cell23 = table2.cellForColumnAndRow(2, 3);
+ var role23 = cell23.role;
+ var cell25 = table2.cellForColumnAndRow(0, 2);
+ var role25 = cell25.role;
+
+ result.innerText += "The table2 cell at (2,0) should have a role AXRole: AXColumnHeader , currently it has " + role21 + " .\n";
+ result.innerText += "The table2 cell at (1,2) should have a role AXRole: AXCell , currently it has " + role22 + " .\n";
+ result.innerText += "The table2 cell at (2,3) should have a role AXRole: AXCell , currently it has " + role23 + " .\n";
+ result.innerText += "The table2 cell at (0,2) should have a role AXRole: AXRowHeader , currently it has " + role25 + " .\n";
+ }
+</script>
+
+</body>
+</html>
Modified: trunk/LayoutTests/platform/efl/accessibility/table-attributes-expected.txt (175407 => 175408)
--- trunk/LayoutTests/platform/efl/accessibility/table-attributes-expected.txt 2014-10-31 07:18:25 UTC (rev 175407)
+++ trunk/LayoutTests/platform/efl/accessibility/table-attributes-expected.txt 2014-10-31 12:45:55 UTC (rev 175408)
@@ -46,7 +46,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitEfl
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 0.000000, 0.000000 }
@@ -65,7 +65,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitEfl
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 0.000000, 0.000000 }
@@ -84,7 +84,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitEfl
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 0.000000, 0.000000 }
@@ -233,7 +233,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitEfl
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 0.000000, 0.000000 }
@@ -252,7 +252,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitEfl
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 0.000000, 0.000000 }
@@ -271,7 +271,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitEfl
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 0.000000, 0.000000 }
@@ -328,7 +328,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitEfl
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 0.000000, 0.000000 }
@@ -347,7 +347,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitEfl
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 0.000000, 0.000000 }
@@ -366,7 +366,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitEfl
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 0.000000, 0.000000 }
@@ -404,7 +404,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitEfl
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 0.000000, 0.000000 }
@@ -499,7 +499,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitEfl
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 0.000000, 0.000000 }
Modified: trunk/LayoutTests/platform/efl/accessibility/table-cells-expected.txt (175407 => 175408)
--- trunk/LayoutTests/platform/efl/accessibility/table-cells-expected.txt 2014-10-31 07:18:25 UTC (rev 175407)
+++ trunk/LayoutTests/platform/efl/accessibility/table-cells-expected.txt 2014-10-31 12:45:55 UTC (rev 175408)
@@ -30,7 +30,7 @@
AXPlatformAttributes: toolkit:WebKitEfl
------------------------
[3,1]
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 0.000000, 0.000000 }
Modified: trunk/LayoutTests/platform/gtk/accessibility/table-attributes-expected.txt (175407 => 175408)
--- trunk/LayoutTests/platform/gtk/accessibility/table-attributes-expected.txt 2014-10-31 07:18:25 UTC (rev 175407)
+++ trunk/LayoutTests/platform/gtk/accessibility/table-attributes-expected.txt 2014-10-31 12:45:55 UTC (rev 175408)
@@ -46,7 +46,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitGtk
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 378.000000, 26.000000 }
@@ -65,7 +65,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitGtk
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 447.000000, 26.000000 }
@@ -84,7 +84,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitGtk
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 447.000000, 26.000000 }
@@ -233,7 +233,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitGtk
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 370.000000, 26.000000 }
@@ -252,7 +252,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitGtk
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 439.000000, 26.000000 }
@@ -271,7 +271,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitGtk
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 439.000000, 26.000000 }
@@ -328,7 +328,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitGtk
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 370.000000, 26.000000 }
@@ -347,7 +347,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitGtk
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 439.000000, 55.000000 }
@@ -366,7 +366,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitGtk
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 491.000000, 55.000000 }
@@ -404,7 +404,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitGtk
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 317.000000, 89.000000 }
@@ -499,7 +499,7 @@
AXChecked: 0
AXPlatformAttributes: toolkit:WebKitGtk
------------
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 317.000000, 118.000000 }
Modified: trunk/LayoutTests/platform/gtk/accessibility/table-cells-expected.txt (175407 => 175408)
--- trunk/LayoutTests/platform/gtk/accessibility/table-cells-expected.txt 2014-10-31 07:18:25 UTC (rev 175407)
+++ trunk/LayoutTests/platform/gtk/accessibility/table-cells-expected.txt 2014-10-31 12:45:55 UTC (rev 175408)
@@ -30,7 +30,7 @@
AXPlatformAttributes: toolkit:WebKitGtk
------------------------
[3,1]
-AXRole: AXRowHeader
+AXRole: AXCell
AXParent: AXTable: Example #1: Nested Stubs
AXChildren: 0
AXPosition: { 447.000000, 55.000000 }
Modified: trunk/LayoutTests/platform/gtk/accessibility/table-hierarchy-expected.txt (175407 => 175408)
--- trunk/LayoutTests/platform/gtk/accessibility/table-hierarchy-expected.txt 2014-10-31 07:18:25 UTC (rev 175407)
+++ trunk/LayoutTests/platform/gtk/accessibility/table-hierarchy-expected.txt 2014-10-31 12:45:55 UTC (rev 175408)
@@ -34,7 +34,7 @@
PASS table1.childAtIndex(i).role is 'AXRole: AXCell'
PASS children is 6
PASS table2.childAtIndex(0).role is 'AXRole: AXRowHeader'
-PASS table2.childAtIndex(1).role is 'AXRole: AXRowHeader'
+PASS table2.childAtIndex(1).role is 'AXRole: AXCell'
PASS table2.childAtIndex(i).role is 'AXRole: AXCell'
PASS table2.childAtIndex(i).role is 'AXRole: AXCell'
PASS table2.childAtIndex(i).role is 'AXRole: AXCell'
@@ -44,7 +44,7 @@
PASS table3.childAtIndex(i).role is 'AXRole: AXCell'
PASS children is 6
PASS table4.childAtIndex(0).role is 'AXRole: AXRowHeader'
-PASS table4.childAtIndex(1).role is 'AXRole: AXRowHeader'
+PASS table4.childAtIndex(1).role is 'AXRole: AXCell'
PASS table4.childAtIndex(i).role is 'AXRole: AXCell'
PASS table4.childAtIndex(i).role is 'AXRole: AXCell'
PASS table4.childAtIndex(i).role is 'AXRole: AXCell'
Modified: trunk/LayoutTests/platform/gtk/accessibility/table-hierarchy.html (175407 => 175408)
--- trunk/LayoutTests/platform/gtk/accessibility/table-hierarchy.html 2014-10-31 07:18:25 UTC (rev 175407)
+++ trunk/LayoutTests/platform/gtk/accessibility/table-hierarchy.html 2014-10-31 12:45:55 UTC (rev 175408)
@@ -56,7 +56,7 @@
children = table2.childrenCount;
shouldBe("children", "6");
shouldBe("table2.childAtIndex(0).role", "'AXRole: AXRowHeader'");
- shouldBe("table2.childAtIndex(1).role", "'AXRole: AXRowHeader'");
+ shouldBe("table2.childAtIndex(1).role", "'AXRole: AXCell'");
for (i = 2; i < children; ++i) {
shouldBe("table2.childAtIndex(i).role", "'AXRole: AXCell'");
}
@@ -68,7 +68,7 @@
children = table4.childrenCount;
shouldBe("children", "6");
shouldBe("table4.childAtIndex(0).role", "'AXRole: AXRowHeader'");
- shouldBe("table4.childAtIndex(1).role", "'AXRole: AXRowHeader'");
+ shouldBe("table4.childAtIndex(1).role", "'AXRole: AXCell'");
for (i = 2; i < children; ++i) {
shouldBe("table4.childAtIndex(i).role", "'AXRole: AXCell'");
}
Modified: trunk/LayoutTests/platform/mac/TestExpectations (175407 => 175408)
--- trunk/LayoutTests/platform/mac/TestExpectations 2014-10-31 07:18:25 UTC (rev 175407)
+++ trunk/LayoutTests/platform/mac/TestExpectations 2014-10-31 12:45:55 UTC (rev 175408)
@@ -1073,6 +1073,8 @@
webkit.org/b/136718 fast/dynamic/layer-no-longer-paginated.html [ Skip ]
+webkit.org/b/137737 accessibility/table-cells-roles.html [ Skip ]
+
# --- Start media tests ---
## --- Start media wontfix tests ---
# This test requires ogg codecs
Modified: trunk/Source/WebCore/ChangeLog (175407 => 175408)
--- trunk/Source/WebCore/ChangeLog 2014-10-31 07:18:25 UTC (rev 175407)
+++ trunk/Source/WebCore/ChangeLog 2014-10-31 12:45:55 UTC (rev 175408)
@@ -1,3 +1,32 @@
+2014-10-31 Andrzej Badowski <[email protected]>
+
+ [ATK] Improve AccessibilityTableCell's determineAccessibilityRole function.
+ https://bugs.webkit.org/show_bug.cgi?id=137737
+
+ Reviewed by Chris Fleizach.
+
+ Use of new functions isRowHeaderCell and isColumnHeaderCell (bug 136818)
+ to more accurately determine accessibility role of the table cell.
+
+ Test: accessibility/table-cells-roles.html
+
+ * accessibility/AccessibilityARIAGridCell.cpp:
+ (WebCore::AccessibilityARIAGridCell::rowIndexRange):
+ Change to const.
+ * accessibility/AccessibilityARIAGridCell.h:
+ Change rowIndexRange function to const.
+ * accessibility/AccessibilityTableCell.cpp:
+ (WebCore::AccessibilityTableCell::determineAccessibilityRole):
+ Use of isRowHeaderCell and isColumnHeaderCell to more accurately determine accessibility role (ATK).
+ (WebCore::AccessibilityTableCell::isColumnHeaderCell):
+ Add a case of direct placement a row in the table.
+ (WebCore::AccessibilityTableCell::isRowHeaderCell):
+ Add a case of direct placement a row in the table.
+ (WebCore::AccessibilityTableCell::rowIndexRange):
+ Change to const.
+ * accessibility/AccessibilityTableCell.h:
+ Change rowIndexRange function to const.
+
2014-10-30 Darin Adler <[email protected]>
Eliminate ResourceBuffer and use SharedBuffer directly instead
Modified: trunk/Source/WebCore/accessibility/AccessibilityARIAGridCell.cpp (175407 => 175408)
--- trunk/Source/WebCore/accessibility/AccessibilityARIAGridCell.cpp 2014-10-31 07:18:25 UTC (rev 175407)
+++ trunk/Source/WebCore/accessibility/AccessibilityARIAGridCell.cpp 2014-10-31 12:45:55 UTC (rev 175408)
@@ -68,7 +68,7 @@
return downcast<AccessibilityTable>(parent);
}
-void AccessibilityARIAGridCell::rowIndexRange(std::pair<unsigned, unsigned>& rowRange)
+void AccessibilityARIAGridCell::rowIndexRange(std::pair<unsigned, unsigned>& rowRange) const
{
AccessibilityObject* parent = parentObjectUnignored();
if (!parent)
Modified: trunk/Source/WebCore/accessibility/AccessibilityARIAGridCell.h (175407 => 175408)
--- trunk/Source/WebCore/accessibility/AccessibilityARIAGridCell.h 2014-10-31 07:18:25 UTC (rev 175407)
+++ trunk/Source/WebCore/accessibility/AccessibilityARIAGridCell.h 2014-10-31 12:45:55 UTC (rev 175408)
@@ -39,7 +39,7 @@
virtual ~AccessibilityARIAGridCell();
// fills in the start location and row span of cell
- virtual void rowIndexRange(std::pair<unsigned, unsigned>& rowRange) override;
+ virtual void rowIndexRange(std::pair<unsigned, unsigned>& rowRange) const override;
// fills in the start location and column span of cell
virtual void columnIndexRange(std::pair<unsigned, unsigned>& columnRange) const override;
Modified: trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp (175407 => 175408)
--- trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp 2014-10-31 07:18:25 UTC (rev 175407)
+++ trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp 2014-10-31 12:45:55 UTC (rev 175408)
@@ -112,9 +112,26 @@
#if !PLATFORM(EFL) && !PLATFORM(GTK)
if (!isTableCell())
return defaultRole;
-
return CellRole;
#endif
+
+ // If AccessibilityRenderObject::determineAccessibilityRole returns the type of CellRole,
+ // which is derived from the role attribute, it does not change anything.
+ if (defaultRole != UnknownRole) {
+ AccessibilityRole ariaRole = ariaRoleAttribute();
+ if (ariaRole == CellRole || ariaRole == RowHeaderRole || ariaRole == ColumnHeaderRole)
+ return ariaRole;
+ }
+
+ // Here there is a more precide definition of the type of CellRole than was possible
+ // at the level of AccessibilityRenderObject.
+ if (defaultRole == ColumnHeaderRole || defaultRole == CellRole || defaultRole == RowHeaderRole) {
+ if (isColumnHeaderCell())
+ return ColumnHeaderRole;
+ if (isRowHeaderCell())
+ return RowHeaderRole;
+ return CellRole;
+ }
return defaultRole;
}
@@ -135,12 +152,19 @@
// We are in a situation after checking the scope attribute.
// It is an attempt to resolve the type of th element without support in the specification.
- // Checking tableTag lets stop the loop at the table level.
+ // Checking tableTag allows to check the case of direct row placement in the table and lets stop the loop at the table level.
for (Node* parentNode = node(); parentNode; parentNode = parentNode->parentNode()) {
if (parentNode->hasTagName(theadTag))
return true;
- if (parentNode->hasTagName(tbodyTag) || parentNode->hasTagName(tfootTag) || parentNode->hasTagName(tableTag))
+ if (parentNode->hasTagName(tbodyTag) || parentNode->hasTagName(tfootTag))
return false;
+ if (parentNode->hasTagName(tableTag)) {
+ std::pair<unsigned, unsigned> rowRange;
+ rowIndexRange(rowRange);
+ if (!rowRange.first)
+ return true;
+ return false;
+ }
}
return false;
}
@@ -157,16 +181,16 @@
// We are in a situation after checking the scope attribute.
// It is an attempt to resolve the type of th element without support in the specification.
- // Checking tableTag lets stop the loop at the table level.
+ // Checking tableTag allows to check the case of direct row placement in the table and lets stop the loop at the table level.
for (Node* parentNode = node(); parentNode; parentNode = parentNode->parentNode()) {
- if (parentNode->hasTagName(tfootTag) || parentNode->hasTagName(tbodyTag)) {
+ if (parentNode->hasTagName(tfootTag) || parentNode->hasTagName(tbodyTag) || parentNode->hasTagName(tableTag)) {
std::pair<unsigned, unsigned> colRange;
columnIndexRange(colRange);
if (!colRange.first)
return true;
return false;
}
- if (parentNode->hasTagName(theadTag) || parentNode->hasTagName(tableTag))
+ if (parentNode->hasTagName(theadTag))
return false;
}
return false;
@@ -272,7 +296,7 @@
}
}
-void AccessibilityTableCell::rowIndexRange(std::pair<unsigned, unsigned>& rowRange)
+void AccessibilityTableCell::rowIndexRange(std::pair<unsigned, unsigned>& rowRange) const
{
if (!is<RenderTableCell>(m_renderer))
return;
Modified: trunk/Source/WebCore/accessibility/AccessibilityTableCell.h (175407 => 175408)
--- trunk/Source/WebCore/accessibility/AccessibilityTableCell.h 2014-10-31 07:18:25 UTC (rev 175407)
+++ trunk/Source/WebCore/accessibility/AccessibilityTableCell.h 2014-10-31 12:45:55 UTC (rev 175408)
@@ -46,7 +46,7 @@
bool isRowHeaderCell() const;
// fills in the start location and row span of cell
- virtual void rowIndexRange(std::pair<unsigned, unsigned>& rowRange);
+ virtual void rowIndexRange(std::pair<unsigned, unsigned>& rowRange) const;
// fills in the start location and column span of cell
virtual void columnIndexRange(std::pair<unsigned, unsigned>& columnRange) const;