Skip to content

Commit

Permalink
Merge r222821 - AX: [ATK] aria-rowindex set on row element is not bei…
Browse files Browse the repository at this point in the history
…ng 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.
  • Loading branch information
joanmarie authored and carlosgcampos committed Oct 17, 2017
1 parent f6a3019 commit a5bcc98
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 3 deletions.
10 changes: 10 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
2017-10-03 Joanmarie Diggs <jdiggs@igalia.com>

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 <zalan@apple.com>

[AX] Do not trigger redundant layout on tables.
Expand Down
10 changes: 10 additions & 0 deletions 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

26 changes: 26 additions & 0 deletions LayoutTests/accessibility/gtk/aria-rowindex-on-row.html
@@ -0,0 +1,26 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body id="body">
<div id="content">
<div role="table">
<div id="test" role="row" aria-rowindex="4">
<div role="cell">test cell</div>
</div>
</div>
</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("Verifies the exposure of a mixed value of aria-pressed.");
if (window.accessibilityController) {
var axRow = accessibilityController.accessibleElementById("test");
shouldBe("axRow.numberAttributeValue('AXARIARowIndex')", "4");
document.getElementById("content").style.visibility = "hidden";
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>
15 changes: 15 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,18 @@
2017-10-03 Joanmarie Diggs <jdiggs@igalia.com>

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 <zalan@apple.com>

[AX] Do not trigger redundant layout on tables.
Expand Down
10 changes: 7 additions & 3 deletions Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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<AccessibilityTableCell>(*coreObject)) {
} else if (is<AccessibilityTableRow>(*coreObject)) {
auto& row = downcast<AccessibilityTableRow>(*coreObject);
int rowIndex = row.ariaRowIndex();
if (rowIndex != -1)
attributeSet = addToAtkAttributeSet(attributeSet, "rowindex", String::number(rowIndex).utf8().data());
} else if (is<AccessibilityTableCell>(*coreObject)) {
auto& cell = downcast<AccessibilityTableCell>(*coreObject);
int rowIndex = cell.ariaRowIndex();
if (rowIndex != -1)
Expand Down

0 comments on commit a5bcc98

Please sign in to comment.