Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp

Issue 2539503003: ARIA 1.1: implementation for aria-col-* and aria-row-*. (Closed)
Patch Set: Fix bad rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp b/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp
index 4880b6f1f6fc1c462ffada39467a276e4e2b434e..09d51159dceeebd1a6bdcb9b728a5b3f0fb1781c 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp
@@ -30,6 +30,7 @@
#include "core/layout/LayoutTableCell.h"
#include "modules/accessibility/AXObjectCacheImpl.h"
+#include "modules/accessibility/AXTableRow.h"
namespace blink {
@@ -101,6 +102,30 @@ bool AXTableCell::isTableCell() const {
return true;
}
+unsigned AXTableCell::ariaColumnIndex() const {
+ const AtomicString& colIndex = getAttribute(aria_colindexAttr);
+ if (colIndex.toInt() >= 1)
+ return colIndex.toInt();
+
+ AXObject* parent = parentObjectUnignored();
+ if (!parent || !parent->isTableRow())
+ return 0;
+
+ return m_ariaColIndexFromRow;
+}
+
+unsigned AXTableCell::ariaRowIndex() const {
+ const AtomicString& rowIndex = getAttribute(aria_rowindexAttr);
+ if (rowIndex.toInt() >= 1)
+ return rowIndex.toInt();
+
+ AXObject* parent = parentObjectUnignored();
+ if (!parent || !parent->isTableRow())
+ return 0;
+
+ return toAXTableRow(parent)->ariaRowIndex();
+}
+
static AccessibilityRole decideRoleFromSibling(LayoutTableCell* siblingCell) {
if (!siblingCell)
return CellRole;

Powered by Google App Engine
This is Rietveld 408576698