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

Side by Side Diff: Source/core/rendering/RenderTable.cpp

Issue 294783004: Use tighter typing in table rendering code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix typo / bug and update copyrights Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Library General Public 11 * modify it under the terms of the GNU Library General Public
12 * License as published by the Free Software Foundation; either 12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version. 13 * version 2 of the License, or (at your option) any later version.
14 * 14 *
15 * This library is distributed in the hope that it will be useful, 15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 // Collect all the unique border values that we want to paint in a sorted list. 595 // Collect all the unique border values that we want to paint in a sorted list.
596 void RenderTable::recalcCollapsedBorders() 596 void RenderTable::recalcCollapsedBorders()
597 { 597 {
598 if (m_collapsedBordersValid) 598 if (m_collapsedBordersValid)
599 return; 599 return;
600 m_collapsedBordersValid = true; 600 m_collapsedBordersValid = true;
601 m_collapsedBorders.clear(); 601 m_collapsedBorders.clear();
602 for (RenderObject* section = firstChild(); section; section = section->nextS ibling()) { 602 for (RenderObject* section = firstChild(); section; section = section->nextS ibling()) {
603 if (!section->isTableSection()) 603 if (!section->isTableSection())
604 continue; 604 continue;
605 for (RenderObject* row = toRenderTableSection(section)->firstChild(); ro w; row = row->nextSibling()) { 605 for (RenderTableRow* row = toRenderTableSection(section)->firstRow(); ro w; row = row->nextRow()) {
606 if (!row->isTableRow()) 606 for (RenderTableCell* cell = row->firstCell(); cell; cell = cell->ne xtCell()) {
607 continue; 607 ASSERT(cell->table() == this);
608 for (RenderObject* cell = toRenderTableRow(row)->firstChild(); cell; cell = cell->nextSibling()) { 608 cell->collectBorderValues(m_collapsedBorders);
609 if (!cell->isTableCell())
610 continue;
611 ASSERT(toRenderTableCell(cell)->table() == this);
612 toRenderTableCell(cell)->collectBorderValues(m_collapsedBorders) ;
613 } 609 }
614 } 610 }
615 } 611 }
616 RenderTableCell::sortBorderValues(m_collapsedBorders); 612 RenderTableCell::sortBorderValues(m_collapsedBorders);
617 } 613 }
618 614
619 615
620 void RenderTable::addOverflowFromChildren() 616 void RenderTable::addOverflowFromChildren()
621 { 617 {
622 // Add overflow from borders. 618 // Add overflow from borders.
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel l* cell) const 1453 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel l* cell) const
1458 { 1454 {
1459 ASSERT(cell->isFirstOrLastCellInRow()); 1455 ASSERT(cell->isFirstOrLastCellInRow());
1460 if (hasSameDirectionAs(cell->row())) 1456 if (hasSameDirectionAs(cell->row()))
1461 return style()->borderEnd(); 1457 return style()->borderEnd();
1462 1458
1463 return style()->borderStart(); 1459 return style()->borderStart();
1464 } 1460 }
1465 1461
1466 } 1462 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698