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

Unified Diff: Source/core/accessibility/AXTable.cpp

Issue 192413002: Use new is*Element() helper functions in accessibility code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months 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/core/accessibility/AXTable.cpp
diff --git a/Source/core/accessibility/AXTable.cpp b/Source/core/accessibility/AXTable.cpp
index cec8734bebe40a81220f330dfa86c156da81ec95..58ba00253c47229a1860b453ba6ffb77752ace0c 100644
--- a/Source/core/accessibility/AXTable.cpp
+++ b/Source/core/accessibility/AXTable.cpp
@@ -35,6 +35,7 @@
#include "core/accessibility/AXTableRow.h"
#include "core/html/HTMLTableCaptionElement.h"
#include "core/html/HTMLTableCellElement.h"
+#include "core/html/HTMLTableColElement.h"
#include "core/html/HTMLTableElement.h"
#include "core/rendering/RenderTableCell.h"
@@ -119,10 +120,8 @@ bool AXTable::isDataTable() const
return true;
// if there's a colgroup or col element, it's probably a data table.
- for (Node* child = tableElement->firstChild(); child; child = child->nextSibling()) {
- if (child->hasTagName(colTag) || child->hasTagName(colgroupTag))
- return true;
- }
+ if (Traversal<HTMLTableColElement>::firstChild(*tableElement))
+ return true;
// go through the cell's and check for tell-tale signs of "data" table status
// cells have borders, or use attributes like headers, abbr, scope or axis
@@ -191,10 +190,10 @@ bool AXTable::isDataTable() const
headersInFirstColumnCount++;
// in this case, the developer explicitly assigned a "data" table attribute
- if (cellNode->hasTagName(tdTag) || cellNode->hasTagName(thTag)) {
- HTMLTableCellElement* cellElement = toHTMLTableCellElement(cellNode);
- if (!cellElement->headers().isEmpty() || !cellElement->abbr().isEmpty()
- || !cellElement->axis().isEmpty() || !cellElement->scope().isEmpty())
+ if (isHTMLTableCellElement(*cellNode)) {
+ HTMLTableCellElement& cellElement = toHTMLTableCellElement(*cellNode);
+ if (!cellElement.headers().isEmpty() || !cellElement.abbr().isEmpty()
+ || !cellElement.axis().isEmpty() || !cellElement.scope().isEmpty())
return true;
}
« Source/core/accessibility/AXRenderObject.cpp ('K') | « Source/core/accessibility/AXRenderObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698