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

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

Issue 2539503003: ARIA 1.1: implementation for aria-col-* and aria-row-*. (Closed)
Patch Set: Created 4 years, 1 month 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/AXTable.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXTable.cpp b/third_party/WebKit/Source/modules/accessibility/AXTable.cpp
index 222711547d7e8e4ecc9bc702e05426b930169f4c..bc6ea1ddfdec51496089703a5ebbc9552faffb6c 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXTable.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXTable.cpp
@@ -491,7 +491,44 @@ void AXTable::rowHeaders(AXObjectVector& headers) {
}
}
-unsigned AXTable::columnCount() {
+int AXTable::ariaColumnCount()
+{
+ const AtomicString& colCountValue = getAttribute(aria_colcountAttr);
+ int colCountInt = colCountValue.toInt();
+
+ if (colCountInt > (int)columnCount())
+ return colCountInt;
+
+ // Spec says that if all of the columns are present in the DOM, it
+ // is not necessary to set this attribute as the user agent can
+ // automatically calculate the total number of columns.
+ // It returns 0 in order not to set this attribute.
+ if (colCountInt == (int)columnCount() || colCountInt != -1)
+ return 0;
+
+ return -1;
+}
+
+int AXTable::ariaRowCount()
+{
+ const AtomicString& rowCountValue = getAttribute(aria_rowcountAttr);
aboxhall 2016/11/29 17:36:54 Any point checking hasAttribute here and early out
dmazzoni 2016/11/30 22:48:17 Done.
+ int rowCountInt = rowCountValue.toInt();
+
+ if (rowCountInt > (int)rowCount())
+ return rowCountInt;
+
+ // Spec says that If all of the rows are present in the DOM, it is
+ // not necessary to set this attribute as the user agent can
+ // automatically calculate the total number of rows. .
+ // It returns 0 in order not to set this attribute.
+ if (rowCountInt == (int)rowCount() || rowCountInt != -1)
+ return 0;
+
+ return -1;
+}
+
+unsigned AXTable::columnCount()
+{
updateChildrenIfNecessary();
return m_columns.size();

Powered by Google App Engine
This is Rietveld 408576698