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

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

Issue 532513002: Don't use rowIndex() if needsCellRecalc(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: NULL check in assertion, to avoid crash in unit tests. Created 6 years, 3 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
« no previous file with comments | « Source/core/rendering/RenderTableSection.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, 2008, 2009, 2010, 2013 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc. All r ights 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
(...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after
1564 1564
1565 for (RenderTableCell* cell = row->firstCell(); cell; cell = cell->nextCe ll()) 1565 for (RenderTableCell* cell = row->firstCell(); cell; cell = cell->nextCe ll())
1566 addCell(cell, row); 1566 addCell(cell, row);
1567 } 1567 }
1568 1568
1569 m_grid.shrinkToFit(); 1569 m_grid.shrinkToFit();
1570 setNeedsLayoutAndFullPaintInvalidation(); 1570 setNeedsLayoutAndFullPaintInvalidation();
1571 } 1571 }
1572 1572
1573 // FIXME: This function could be made O(1) in certain cases (like for the non-mo st-constrainive cells' case). 1573 // FIXME: This function could be made O(1) in certain cases (like for the non-mo st-constrainive cells' case).
1574 void RenderTableSection::rowLogicalHeightChanged(unsigned rowIndex) 1574 void RenderTableSection::rowLogicalHeightChanged(RenderTableRow* row)
1575 { 1575 {
1576 if (needsCellRecalc()) 1576 if (needsCellRecalc())
1577 return; 1577 return;
1578 1578
1579 unsigned rowIndex = row->rowIndex();
1579 setRowLogicalHeightToRowStyleLogicalHeight(m_grid[rowIndex]); 1580 setRowLogicalHeightToRowStyleLogicalHeight(m_grid[rowIndex]);
1580 1581
1581 for (RenderTableCell* cell = m_grid[rowIndex].rowRenderer->firstCell(); cell ; cell = cell->nextCell()) 1582 for (RenderTableCell* cell = m_grid[rowIndex].rowRenderer->firstCell(); cell ; cell = cell->nextCell())
1582 updateLogicalHeightForCell(m_grid[rowIndex], cell); 1583 updateLogicalHeightForCell(m_grid[rowIndex], cell);
1583 } 1584 }
1584 1585
1585 void RenderTableSection::setNeedsCellRecalc() 1586 void RenderTableSection::setNeedsCellRecalc()
1586 { 1587 {
1587 m_needsCellRecalc = true; 1588 m_needsCellRecalc = true;
1588 if (RenderTable* t = table()) 1589 if (RenderTable* t = table())
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1769 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691). 1770 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691).
1770 if (!style()->isLeftToRightDirection()) 1771 if (!style()->isLeftToRightDirection())
1771 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); 1772 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing);
1772 else 1773 else
1773 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); 1774 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing);
1774 1775
1775 cell->setLogicalLocation(cellLocation); 1776 cell->setLogicalLocation(cellLocation);
1776 } 1777 }
1777 1778
1778 } // namespace blink 1779 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderTableSection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698