From a5bcc98b8f507bfa67a8bf0adafe35f5992c0670 Mon Sep 17 00:00:00 2001 From: Joanmarie Diggs Date: Tue, 17 Oct 2017 09:38:56 +0000 Subject: [PATCH] Merge r222821 - AX: [ATK] aria-rowindex set on row element is not being exposed https://bugs.webkit.org/show_bug.cgi?id=177821 Reviewed by Chris Fleizach. Source/WebCore: Expose the value of aria-rowindex when set on a row as an object attribute, as we already do when it's set on a cell. Test: accessibility/gtk/aria-rowindex-on-row.html * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetAttributes): LayoutTests: * accessibility/gtk/aria-rowindex-on-row-expected.txt: Added. * accessibility/gtk/aria-rowindex-on-row.html: Added. --- LayoutTests/ChangeLog | 10 +++++++ .../gtk/aria-rowindex-on-row-expected.txt | 10 +++++++ .../gtk/aria-rowindex-on-row.html | 26 +++++++++++++++++++ Source/WebCore/ChangeLog | 15 +++++++++++ .../atk/WebKitAccessibleWrapperAtk.cpp | 10 ++++--- 5 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 LayoutTests/accessibility/gtk/aria-rowindex-on-row-expected.txt create mode 100644 LayoutTests/accessibility/gtk/aria-rowindex-on-row.html diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 5f45f5214e1c..086b97fe63c3 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,13 @@ +2017-10-03 Joanmarie Diggs + + AX: [ATK] aria-rowindex set on row element is not being exposed + https://bugs.webkit.org/show_bug.cgi?id=177821 + + Reviewed by Chris Fleizach. + + * accessibility/gtk/aria-rowindex-on-row-expected.txt: Added. + * accessibility/gtk/aria-rowindex-on-row.html: Added. + 2017-10-03 Zalan Bujtas [AX] Do not trigger redundant layout on tables. diff --git a/LayoutTests/accessibility/gtk/aria-rowindex-on-row-expected.txt b/LayoutTests/accessibility/gtk/aria-rowindex-on-row-expected.txt new file mode 100644 index 000000000000..f56c1e0dd0a7 --- /dev/null +++ b/LayoutTests/accessibility/gtk/aria-rowindex-on-row-expected.txt @@ -0,0 +1,10 @@ +Verifies the exposure of a mixed value of aria-pressed. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS axRow.numberAttributeValue('AXARIARowIndex') is 4 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/accessibility/gtk/aria-rowindex-on-row.html b/LayoutTests/accessibility/gtk/aria-rowindex-on-row.html new file mode 100644 index 000000000000..c73a3b0cc772 --- /dev/null +++ b/LayoutTests/accessibility/gtk/aria-rowindex-on-row.html @@ -0,0 +1,26 @@ + + + + + + +
+
+
+
test cell
+
+
+
+

+
+ + + + diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 0a567a106d5c..21921456a80c 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,18 @@ +2017-10-03 Joanmarie Diggs + + AX: [ATK] aria-rowindex set on row element is not being exposed + https://bugs.webkit.org/show_bug.cgi?id=177821 + + Reviewed by Chris Fleizach. + + Expose the value of aria-rowindex when set on a row as an object + attribute, as we already do when it's set on a cell. + + Test: accessibility/gtk/aria-rowindex-on-row.html + + * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: + (webkitAccessibleGetAttributes): + 2017-10-03 Zalan Bujtas [AX] Do not trigger redundant layout on tables. diff --git a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp index abb0242c6a21..4f778d3a4d2a 100644 --- a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp +++ b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp @@ -39,6 +39,7 @@ #include "AccessibilityListBoxOption.h" #include "AccessibilityTable.h" #include "AccessibilityTableCell.h" +#include "AccessibilityTableRow.h" #include "Document.h" #include "Editing.h" #include "Frame.h" @@ -470,9 +471,12 @@ static AtkAttributeSet* webkitAccessibleGetAttributes(AtkObject* object) int columnCount = table.ariaColumnCount(); if (columnCount) attributeSet = addToAtkAttributeSet(attributeSet, "colcount", String::number(columnCount).utf8().data()); - } - - if (is(*coreObject)) { + } else if (is(*coreObject)) { + auto& row = downcast(*coreObject); + int rowIndex = row.ariaRowIndex(); + if (rowIndex != -1) + attributeSet = addToAtkAttributeSet(attributeSet, "rowindex", String::number(rowIndex).utf8().data()); + } else if (is(*coreObject)) { auto& cell = downcast(*coreObject); int rowIndex = cell.ariaRowIndex(); if (rowIndex != -1)