[ATK] Allowing the use of AccessibilityUIElement::columnHeaders method for table.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Nov 2014 09:00:54 +0000 (09:00 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Nov 2014 09:00:54 +0000 (09:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=139044

Patch by Andrzej Badowski <a.badowski@samsung.com> on 2014-11-28
Reviewed by Chris Fleizach.

ATK method AccessibilityUIElement::columnHeaders currently focused only on the object table cell.
The proposed solution will enable the use of this method for the object table.
Existing test shows the result.

Tools:

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::columnHeaders):

LayoutTests:

* accessibility/table-column-headers-with-captions.html: Updated for ATK platform.
* platform/efl/accessibility/table-column-headers-with-captions-expected.txt: Added.
* platform/gtk/TestExpectations: Updated for GTK.
* platform/gtk/accessibility/table-column-headers-with-captions-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176556 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/accessibility/table-column-headers-with-captions.html
LayoutTests/platform/efl/accessibility/table-column-headers-with-captions-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/gtk/accessibility/table-column-headers-with-captions-expected.txt [new file with mode: 0644]
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp

index c1566dd..d40a83c 100644 (file)
@@ -1,3 +1,19 @@
+2014-11-28  Andrzej Badowski  <a.badowski@samsung.com>
+
+        [ATK] Allowing the use of AccessibilityUIElement::columnHeaders method for table.
+        https://bugs.webkit.org/show_bug.cgi?id=139044
+
+        Reviewed by Chris Fleizach.
+
+        ATK method AccessibilityUIElement::columnHeaders currently focused only on the object table cell.
+        The proposed solution will enable the use of this method for the object table.
+        Existing test shows the result.
+
+        * accessibility/table-column-headers-with-captions.html: Updated for ATK platform.
+        * platform/efl/accessibility/table-column-headers-with-captions-expected.txt: Added.
+        * platform/gtk/TestExpectations: Updated for GTK.
+        * platform/gtk/accessibility/table-column-headers-with-captions-expected.txt: Added.
+
 2014-11-27  Joanmarie Diggs  <jdiggs@igalia.com>
 
         AX: [ATK] Meter and Option elements do not expose their id attribute
index 7bf7cf9..5064ffc 100644 (file)
 
         var table = accessibilityController.accessibleElementById("table");
         var colHeaders = table.columnHeaders();
-
-        shouldBeTrue("colHeaders[0].isEqual(table.rowAtIndex(0).childAtIndex(0))");
-        shouldBeTrue("colHeaders[1].isEqual(table.rowAtIndex(0).childAtIndex(1))");
+        if (accessibilityController.platformName == "atk") {
+            shouldBeTrue("colHeaders[0].isEqual(table.cellForColumnAndRow(0,0))");
+            shouldBeTrue("colHeaders[1].isEqual(table.cellForColumnAndRow(1,0))");
+        } else {
+            shouldBeTrue("colHeaders[0].isEqual(table.rowAtIndex(0).childAtIndex(0))");
+            shouldBeTrue("colHeaders[1].isEqual(table.rowAtIndex(0).childAtIndex(1))");
+        }
     }
 
 </script>
diff --git a/LayoutTests/platform/efl/accessibility/table-column-headers-with-captions-expected.txt b/LayoutTests/platform/efl/accessibility/table-column-headers-with-captions-expected.txt
new file mode 100644 (file)
index 0000000..54d167c
--- /dev/null
@@ -0,0 +1,14 @@
+caption
+header1        header2
+a      b
+This tests that a table with a caption and an empty colgroup will still correctly report its headers.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS colHeaders[0].isEqual(table.cellForColumnAndRow(0,0)) is true
+PASS colHeaders[1].isEqual(table.cellForColumnAndRow(1,0)) is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
index 0f15b5d..de16043 100644 (file)
@@ -2231,7 +2231,6 @@ webkit.org/b/136673 fast/text/empty-shadow.html [ ImageOnlyFailure ]
 webkit.org/b/136754 css3/flexbox/csswg/flexbox_direction-row-reverse.html [ ImageOnlyFailure ]
 
 webkit.org/b/137109 accessibility/legend-children-are-visible.html [ Failure ]
-webkit.org/b/138069 accessibility/table-column-headers-with-captions.html [ Failure ]
 
 webkit.org/b/137695 media/video-controls-audiotracks-trackmenu.html [ Failure ]
 webkit.org/b/138074 media/video-volume-slider-drag.html [ Failure ]
diff --git a/LayoutTests/platform/gtk/accessibility/table-column-headers-with-captions-expected.txt b/LayoutTests/platform/gtk/accessibility/table-column-headers-with-captions-expected.txt
new file mode 100644 (file)
index 0000000..54d167c
--- /dev/null
@@ -0,0 +1,14 @@
+caption
+header1        header2
+a      b
+This tests that a table with a caption and an empty colgroup will still correctly report its headers.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS colHeaders[0].isEqual(table.cellForColumnAndRow(0,0)) is true
+PASS colHeaders[1].isEqual(table.cellForColumnAndRow(1,0)) is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
index 08108f5..8251f40 100644 (file)
@@ -1,3 +1,17 @@
+2014-11-28  Andrzej Badowski  <a.badowski@samsung.com>
+
+        [ATK] Allowing the use of AccessibilityUIElement::columnHeaders method for table.
+        https://bugs.webkit.org/show_bug.cgi?id=139044
+
+        Reviewed by Chris Fleizach.
+
+        ATK method AccessibilityUIElement::columnHeaders currently focused only on the object table cell.
+        The proposed solution will enable the use of this method for the object table.
+        Existing test shows the result.
+
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+        (WTR::AccessibilityUIElement::columnHeaders):
+
 2014-11-27  Ryuan Choi  <ryuan.choi@navercorp.com>
 
         [EFL] Remove E_Dbus dependency
index 7ce0d61..03c5bd3 100644 (file)
@@ -955,14 +955,18 @@ JSValueRef AccessibilityUIElement::rowHeaders() const
 JSValueRef AccessibilityUIElement::columnHeaders() const
 {
 #if ATK_CHECK_VERSION(2,11,90)
-    if (!ATK_IS_TABLE_CELL(m_element.get()))
+    if (!ATK_IS_TABLE_CELL(m_element.get()) && !ATK_IS_TABLE(m_element.get()))
         return nullptr;
 
-    GRefPtr<GPtrArray> array = adoptGRef(atk_table_cell_get_column_header_cells(ATK_TABLE_CELL(m_element.get())));
-    if (!array)
-        return nullptr;
+    Vector<RefPtr<AccessibilityUIElement>> columns;
+    if (ATK_IS_TABLE_CELL(m_element.get())) {
+        GRefPtr<GPtrArray> array = adoptGRef(atk_table_cell_get_column_header_cells(ATK_TABLE_CELL(m_element.get())));
+        if (!array)
+            return nullptr;
 
-    Vector<RefPtr<AccessibilityUIElement>> columns = convertGPtrArrayToVector(array.get());
+        columns = convertGPtrArrayToVector(array.get());
+    } else
+        columns = getColumnHeaders(ATK_TABLE(m_element.get()));
     return convertToJSObjectArray(columns);
 #else
     return nullptr;