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

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

Issue 20294002: Fix trailing whitespace in .cpp, .h, and .idl files (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased 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
Index: Source/core/accessibility/AccessibilityTableColumn.cpp
diff --git a/Source/core/accessibility/AccessibilityTableColumn.cpp b/Source/core/accessibility/AccessibilityTableColumn.cpp
index 3ba9dcc3b97e11909b9a9d3b95f2750d76b5046d..6b5617e5af11bdf5589bf3da3e91f33e85dc51d0 100644
--- a/Source/core/accessibility/AccessibilityTableColumn.cpp
+++ b/Source/core/accessibility/AccessibilityTableColumn.cpp
@@ -36,7 +36,7 @@
using namespace std;
namespace WebCore {
-
+
using namespace HTMLNames;
AccessibilityTableColumn::AccessibilityTableColumn()
@@ -45,7 +45,7 @@ AccessibilityTableColumn::AccessibilityTableColumn()
AccessibilityTableColumn::~AccessibilityTableColumn()
{
-}
+}
PassRefPtr<AccessibilityTableColumn> AccessibilityTableColumn::create()
{
@@ -55,10 +55,10 @@ PassRefPtr<AccessibilityTableColumn> AccessibilityTableColumn::create()
void AccessibilityTableColumn::setParent(AccessibilityObject* parent)
{
AccessibilityMockObject::setParent(parent);
-
+
clearChildren();
}
-
+
LayoutRect AccessibilityTableColumn::elementRect() const
{
// this will be filled in when addChildren is called
@@ -69,14 +69,14 @@ AccessibilityObject* AccessibilityTableColumn::headerObject()
{
if (!m_parent)
return 0;
-
+
RenderObject* renderer = m_parent->renderer();
if (!renderer)
return 0;
-
+
if (!m_parent->isAccessibilityTable())
return 0;
-
+
AccessibilityTable* parentTable = toAccessibilityTable(m_parent);
if (parentTable->isAriaTable()) {
AccessibilityChildrenVector rowChildren = children();
@@ -86,23 +86,23 @@ AccessibilityObject* AccessibilityTableColumn::headerObject()
if (cell->ariaRoleAttribute() == ColumnHeaderRole)
return cell;
}
-
+
return 0;
}
if (!renderer->isTable())
return 0;
-
+
RenderTable* table = toRenderTable(renderer);
-
+
AccessibilityObject* headerObject = 0;
-
+
// try the <thead> section first. this doesn't require th tags
headerObject = headerObjectForSection(table->header(), false);
if (headerObject)
return headerObject;
-
+
// now try for <th> tags in the first body
headerObject = headerObjectForSection(table->firstBody(), true);
@@ -113,42 +113,42 @@ AccessibilityObject* AccessibilityTableColumn::headerObjectForSection(RenderTabl
{
if (!section)
return 0;
-
+
unsigned numCols = section->numColumns();
if (m_columnIndex >= numCols)
return 0;
-
+
if (!section->numRows())
return 0;
-
+
RenderTableCell* cell = 0;
// also account for cells that have a span
for (int testCol = m_columnIndex; testCol >= 0; --testCol) {
RenderTableCell* testCell = section->primaryCellAt(0, testCol);
if (!testCell)
continue;
-
- // we've reached a cell that doesn't even overlap our column
+
+ // we've reached a cell that doesn't even overlap our column
// it can't be our header
if ((testCell->col() + (testCell->colSpan()-1)) < m_columnIndex)
break;
-
+
Node* node = testCell->node();
if (!node)
continue;
-
+
if (thTagRequired && !node->hasTagName(thTag))
continue;
-
+
cell = testCell;
}
-
+
if (!cell)
return 0;
return axObjectCache()->getOrCreate(cell);
}
-
+
bool AccessibilityTableColumn::computeAccessibilityIsIgnored() const
{
if (!m_parent)
@@ -156,30 +156,30 @@ bool AccessibilityTableColumn::computeAccessibilityIsIgnored() const
return m_parent->accessibilityIsIgnored();
}
-
+
void AccessibilityTableColumn::addChildren()
{
- ASSERT(!m_haveChildren);
-
+ ASSERT(!m_haveChildren);
+
m_haveChildren = true;
if (!m_parent || !m_parent->isAccessibilityTable())
return;
-
+
AccessibilityTable* parentTable = toAccessibilityTable(m_parent);
int numRows = parentTable->rowCount();
-
+
for (int i = 0; i < numRows; i++) {
AccessibilityTableCell* cell = parentTable->cellForColumnAndRow(m_columnIndex, i);
if (!cell)
continue;
-
+
// make sure the last one isn't the same as this one (rowspan cells)
if (m_children.size() > 0 && m_children.last() == cell)
continue;
-
+
m_children.append(cell);
m_columnRect.unite(cell->elementRect());
}
}
-
+
} // namespace WebCore
« no previous file with comments | « Source/core/accessibility/AccessibilityTableCell.cpp ('k') | Source/core/accessibility/AccessibilityTableHeaderContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698