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

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

Issue 18313005: Introduce isHTMLTableElement and toHTMLTableElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Retry Created 7 years, 5 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
« no previous file with comments | « no previous file | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/accessibility/AccessibilityTable.cpp
diff --git a/Source/core/accessibility/AccessibilityTable.cpp b/Source/core/accessibility/AccessibilityTable.cpp
index ac0fcf88e1cf5272242a4287e89a15d033c0b404..87200013372cc342df2723cadf14694c55411385 100644
--- a/Source/core/accessibility/AccessibilityTable.cpp
+++ b/Source/core/accessibility/AccessibilityTable.cpp
@@ -103,17 +103,17 @@ bool AccessibilityTable::isDataTable() const
// Only "data" tables should be exposed as tables.
// Unfortunately, there is no good way to determine the difference
// between a "layout" table and a "data" table.
-
+
RenderTable* table = toRenderTable(m_renderer);
Node* tableNode = table->node();
- if (!tableNode || !tableNode->hasTagName(tableTag))
+ if (!tableNode || !isHTMLTableElement(tableNode))
return false;
// if there is a caption element, summary, THEAD, or TFOOT section, it's most certainly a data table
- HTMLTableElement* tableElement = static_cast<HTMLTableElement*>(tableNode);
+ HTMLTableElement* tableElement = toHTMLTableElement(tableNode);
if (!tableElement->summary().isEmpty() || tableElement->tHead() || tableElement->tFoot() || tableElement->caption())
return true;
-
+
// if someone used "rules" attribute than the table should appear
if (!tableElement->rules().isEmpty())
return true;
@@ -531,15 +531,15 @@ String AccessibilityTable::title() const
String title;
if (!m_renderer)
return title;
-
+
// see if there is a caption
Node* tableElement = m_renderer->node();
- if (tableElement && tableElement->hasTagName(tableTag)) {
- HTMLTableCaptionElement* caption = static_cast<HTMLTableElement*>(tableElement)->caption();
+ if (tableElement && isHTMLTableElement(tableElement)) {
+ HTMLTableCaptionElement* caption = toHTMLTableElement(tableElement)->caption();
if (caption)
title = caption->innerText();
}
-
+
// try the standard
if (title.isEmpty())
title = AccessibilityRenderObject::title();
« no previous file with comments | « no previous file | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698