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

Unified Diff: Source/core/rendering/RenderTableSection.h

Issue 208263013: Col width is not honored when dynamically updated and it would not make table narrower (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Merged https://codereview.chromium.org/208263012/ to this patch. 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/rendering/RenderTableSection.h
diff --git a/Source/core/rendering/RenderTableSection.h b/Source/core/rendering/RenderTableSection.h
index f8d476f6a3b92e70015b00226857fd2c5597c488..89b9215448930a3dc8a23b64bfac9b6a3019cc7c 100644
--- a/Source/core/rendering/RenderTableSection.h
+++ b/Source/core/rendering/RenderTableSection.h
@@ -161,15 +161,29 @@ public:
const RenderTableCell* firstRowCellAdjoiningTableStart() const;
const RenderTableCell* firstRowCellAdjoiningTableEnd() const;
- CellStruct& cellAt(unsigned row, unsigned col) { return m_grid[row].row[col]; }
- const CellStruct& cellAt(unsigned row, unsigned col) const { return m_grid[row].row[col]; }
+ CellStruct& cellAt(unsigned row, unsigned col)
+ {
+ recalcCellsIfNeeded();
+ return m_grid[row].row[col];
+ }
+
+ const CellStruct& cellAt(unsigned row, unsigned col) const
+ {
+ ASSERT(!m_needsCellRecalc);
+ return m_grid[row].row[col];
+ }
RenderTableCell* primaryCellAt(unsigned row, unsigned col)
{
+ recalcCellsIfNeeded();
CellStruct& c = m_grid[row].row[col];
return c.primaryCell();
}
- RenderTableRow* rowRendererAt(unsigned row) const { return m_grid[row].rowRenderer; }
+ RenderTableRow* rowRendererAt(unsigned row) const
+ {
+ ASSERT(!m_needsCellRecalc);
+ return m_grid[row].rowRenderer;
+ }
void appendColumn(unsigned pos);
void splitColumn(unsigned pos, unsigned first);
@@ -185,7 +199,11 @@ public:
int outerBorderStart() const { return m_outerBorderStart; }
int outerBorderEnd() const { return m_outerBorderEnd; }
- unsigned numRows() const { return m_grid.size(); }
+ unsigned numRows() const
+ {
+ ASSERT(!m_needsCellRecalc);
+ return m_grid.size();
+ }
unsigned numColumns() const;
void recalcCells();
void recalcCellsIfNeeded()
@@ -197,7 +215,11 @@ public:
bool needsCellRecalc() const { return m_needsCellRecalc; }
void setNeedsCellRecalc();
- LayoutUnit rowBaseline(unsigned row) { return m_grid[row].baseline; }
+ LayoutUnit rowBaseline(unsigned row)
+ {
+ recalcCellsIfNeeded();
+ return m_grid[row].baseline;
+ }
void rowLogicalHeightChanged(unsigned rowIndex);
@@ -263,7 +285,11 @@ private:
bool hasOverflowingCell() const { return m_overflowingCells.size() || m_forceSlowPaintPathWithOverflowingCell; }
void computeOverflowFromCells(unsigned totalRows, unsigned nEffCols);
- CellSpan fullTableRowSpan() const { return CellSpan(0, m_grid.size()); }
+ CellSpan fullTableRowSpan() const
+ {
+ ASSERT(!m_needsCellRecalc);
+ return CellSpan(0, m_grid.size());
+ }
CellSpan fullTableColumnSpan() const { return CellSpan(0, table()->columns().size()); }
// Flip the rect so it aligns with the coordinates used by the rowPos and columnPos vectors.

Powered by Google App Engine
This is Rietveld 408576698