2011-04-11 Mario Sanchez Prada <msanchez@igalia.com>
authormario@webkit.org <mario@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Apr 2011 18:57:35 +0000 (18:57 +0000)
committermario@webkit.org <mario@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Apr 2011 18:57:35 +0000 (18:57 +0000)
        Reviewed by Xan Lopez.

        [GTK] Implement AccessibilityUIElement::{row|column}IndexRange in DRT
        https://bugs.webkit.org/show_bug.cgi?id=57854

        Unskipped table-cell-spans.html and updated GTK expectations.

        * platform/gtk/Skipped: Unskipped test.
        * platform/gtk/accessibility/table-cell-spans-expected.txt: Added.
2011-04-11  Mario Sanchez Prada  <msanchez@igalia.com>

        Reviewed by Xan Lopez.

        [GTK] Implement AccessibilityUIElement::{row|column}IndexRange in DRT
        https://bugs.webkit.org/show_bug.cgi?id=57854

        Implement missing features in GTK's DRT.

        * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
        (indexRangeInTable): New helper function to get the range string
        for the current cell inside the parent table, either from the
        point of view of rows or columns.
        (AccessibilityUIElement::rowIndexRange): Implemented by relying on
        the new helper function indexRangeInTable().
        (AccessibilityUIElement::columnIndexRange): Ditto.

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

LayoutTests/ChangeLog
LayoutTests/platform/gtk/Skipped
LayoutTests/platform/gtk/accessibility/table-cell-spans-expected.txt [new file with mode: 0644]
Tools/ChangeLog
Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp

index 6b8f507..477b60e 100644 (file)
@@ -1,5 +1,17 @@
 2011-04-11  Mario Sanchez Prada  <msanchez@igalia.com>
 
+        Reviewed by Xan Lopez.
+
+        [GTK] Implement AccessibilityUIElement::{row|column}IndexRange in DRT
+        https://bugs.webkit.org/show_bug.cgi?id=57854
+
+        Unskipped table-cell-spans.html and updated GTK expectations.
+
+        * platform/gtk/Skipped: Unskipped test.
+        * platform/gtk/accessibility/table-cell-spans-expected.txt: Added.
+
+2011-04-11  Mario Sanchez Prada  <msanchez@igalia.com>
+
         Reviewed by Chris Fleizach.
 
         [GTK] Implement AccessibilityUIElement::cellForColumnAndRow in DRT
index 7df2143..04729c1 100644 (file)
@@ -355,7 +355,6 @@ accessibility/radio-button-title-label.html
 accessibility/secure-textfield-title-ui.html
 accessibility/selection-states.html
 accessibility/table-attributes.html
-accessibility/table-cell-spans.html
 accessibility/table-detection.html
 accessibility/table-one-cell.html
 accessibility/table-sections.html
diff --git a/LayoutTests/platform/gtk/accessibility/table-cell-spans-expected.txt b/LayoutTests/platform/gtk/accessibility/table-cell-spans-expected.txt
new file mode 100644 (file)
index 0000000..1954f8a
--- /dev/null
@@ -0,0 +1,39 @@
+Cell A
+COLSPAN="2"
+ROWSPAN="2"    Cell B
+COLSPAN="2"
+2,3    2,4
+Cell C
+ROWSPAN="2"    3,2     3,3     3,4
+4,2    4,3     4,4
+----------------------
+{ 0, 0 }
+toolkit:WebKitGtk
+{0, 2}, {0, 2}
+
+----------------------
+{ 1, 1 }
+toolkit:WebKitGtk
+{0, 2}, {0, 2}
+
+----------------------
+{ 3, 0 }
+toolkit:WebKitGtk
+{2, 2}, {0, 1}
+
+----------------------
+{ 2, 0 }
+toolkit:WebKitGtk
+{2, 2}, {0, 1}
+
+----------------------
+{ 2, 3 }
+toolkit:WebKitGtk
+{2, 1}, {3, 1}
+
+----------------------
+{ 10, 10 }
+
+{0, 0}, {0, 0}
+
+
index ba7ff3e..b28adae 100644 (file)
@@ -1,5 +1,22 @@
 2011-04-11  Mario Sanchez Prada  <msanchez@igalia.com>
 
+        Reviewed by Xan Lopez.
+
+        [GTK] Implement AccessibilityUIElement::{row|column}IndexRange in DRT
+        https://bugs.webkit.org/show_bug.cgi?id=57854
+
+        Implement missing features in GTK's DRT.
+
+        * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+        (indexRangeInTable): New helper function to get the range string
+        for the current cell inside the parent table, either from the
+        point of view of rows or columns.
+        (AccessibilityUIElement::rowIndexRange): Implemented by relying on
+        the new helper function indexRangeInTable().
+        (AccessibilityUIElement::columnIndexRange): Ditto.
+
+2011-04-11  Mario Sanchez Prada  <msanchez@igalia.com>
+
         Reviewed by Chris Fleizach.
 
         [GTK] Implement AccessibilityUIElement::cellForColumnAndRow in DRT
index 798e935..8a4a490 100644 (file)
@@ -487,16 +487,56 @@ int AccessibilityUIElement::indexInTable()
     return 0;
 }
 
+static JSStringRef indexRangeInTable(PlatformUIElement element, bool isRowRange)
+{
+    GOwnPtr<gchar> rangeString(g_strdup("{0, 0}"));
+
+    if (!element)
+        return JSStringCreateWithUTF8CString(rangeString.get());
+
+    ASSERT(ATK_IS_OBJECT(element));
+
+    AtkObject* axTable = atk_object_get_parent(ATK_OBJECT(element));
+    if (!axTable || !ATK_IS_TABLE(axTable))
+        return JSStringCreateWithUTF8CString(rangeString.get());
+
+    // Look for the cell in the table.
+    gint indexInParent = atk_object_get_index_in_parent(ATK_OBJECT(element));
+    if (indexInParent == -1)
+        return JSStringCreateWithUTF8CString(rangeString.get());
+
+    int row = -1;
+    int column = -1;
+    row = atk_table_get_row_at_index(ATK_TABLE(axTable), indexInParent);
+    column = atk_table_get_column_at_index(ATK_TABLE(axTable), indexInParent);
+
+    // Get the actual values, if row and columns are valid values.
+    if (row != -1 && column != -1) {
+        int base = 0;
+        int length = 0;
+        if (isRowRange) {
+            base = row;
+            length = atk_table_get_row_extent_at(ATK_TABLE(axTable), row, column);
+        } else {
+            base = column;
+            length = atk_table_get_column_extent_at(ATK_TABLE(axTable), row, column);
+        }
+        rangeString.set(g_strdup_printf("{%d, %d}", base, length));
+    }
+
+    return JSStringCreateWithUTF8CString(rangeString.get());
+}
+
 JSStringRef AccessibilityUIElement::rowIndexRange()
 {
-    // FIXME: implement
-    return JSStringCreateWithCharacters(0, 0);
+    // Range in table for rows.
+    return indexRangeInTable(m_element, true);
 }
 
 JSStringRef AccessibilityUIElement::columnIndexRange()
 {
-    // FIXME: implement
-    return JSStringCreateWithCharacters(0, 0);
+    // Range in table for columns.
+    return indexRangeInTable(m_element, false);
 }
 
 int AccessibilityUIElement::lineForIndex(int)