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

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: Moved declarations to the section labeled "For a table" 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
« no previous file with comments | « Source/modules/accessibility/AXTable.cpp ('k') | public/web/WebAXObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebAXObject.cpp
diff --git a/Source/web/WebAXObject.cpp b/Source/web/WebAXObject.cpp
index 9dad1280444274211e319864a9c0124395d362a4..2b9c3defb5eb8c5667475bca7a4290668f31fd24 100644
--- a/Source/web/WebAXObject.cpp
+++ b/Source/web/WebAXObject.cpp
@@ -1120,6 +1120,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())
@@ -1142,6 +1162,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())
« no previous file with comments | « Source/modules/accessibility/AXTable.cpp ('k') | public/web/WebAXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698