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

Unified Diff: Source/web/WebAXObject.cpp

Issue 797223002: Provides an API to cope with table headers in Accessibility (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Separated tableHeaders into rowHeaders and columnHeaders. Created 6 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: Source/web/WebAXObject.cpp
diff --git a/Source/web/WebAXObject.cpp b/Source/web/WebAXObject.cpp
index 90cd1617df84d5e330040e70d1aea3a0594fb706..09e4752581a9a516b3d053281b29e5a5559de3fa 100644
--- a/Source/web/WebAXObject.cpp
+++ b/Source/web/WebAXObject.cpp
@@ -1112,6 +1112,26 @@ WebAXObject WebAXObject::rowHeader() const
return WebAXObject(toAXTableRow(m_private.get())->headerObject());
}
+void WebAXObject::rowHeaders(WebVector<WebAXObject>& rowHeaderElements) const
+{
+ if (isDetached())
+ return;
+
+ if (!m_private->isAXTable())
+ return;
+
+ AXObject::AccessibilityChildrenVector headers;
+ toAXTable(m_private.get())->rowHeaders(headers);
+
+ size_t headerCount = headers.size();
+ WebVector<WebAXObject> result(headerCount);
+
+ for (size_t i = 0; i < headerCount; i++)
+ result[i] = WebAXObject(headers[i]);
+
+ rowHeaderElements.swap(result);
+}
+
unsigned WebAXObject::columnIndex() const
{
if (isDetached())
@@ -1134,6 +1154,26 @@ WebAXObject WebAXObject::columnHeader() const
return WebAXObject(toAXTableColumn(m_private.get())->headerObject());
}
+void WebAXObject::columnHeaders(WebVector<WebAXObject>& columnHeaderElements) const
+{
+ if (isDetached())
+ return;
+
+ if (!m_private->isAXTable())
+ return;
+
+ AXObject::AccessibilityChildrenVector headers;
+ toAXTable(m_private.get())->columnHeaders(headers);
+
+ size_t headerCount = headers.size();
+ WebVector<WebAXObject> result(headerCount);
+
+ for (size_t i = 0; i < headerCount; i++)
+ result[i] = WebAXObject(headers[i]);
+
+ columnHeaderElements.swap(result);
+}
+
unsigned WebAXObject::cellColumnIndex() const
{
if (isDetached())

Powered by Google App Engine
This is Rietveld 408576698