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 a7046356cdac5e77b46bafae9aca3ffeed605e5e..f780dd7f1e2e300bd6178c4327576c4fe7cf3f33 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 { |
@@ -38,6 +39,7 @@ using namespace HTMLNames; |
AXTableCell::AXTableCell(LayoutObject* layoutObject, AXObjectCacheImpl& axObjectCache) |
: AXLayoutObject(layoutObject, axObjectCache) |
+ , m_ariaColIndexFromRow(0) |
{ |
} |
@@ -107,6 +109,32 @@ 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) |