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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTableSection.cpp

Issue 2358663003: [css-tables] Set needsLayout on cells when table border width changes (Closed)
Patch Set: refactor some code into LayoutTable::markAllCellsWidthsDirty... Created 4 years, 2 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
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 return; 129 return;
130 130
131 LayoutTable* table = this->table(); 131 LayoutTable* table = this->table();
132 if (!table) 132 if (!table)
133 return; 133 return;
134 134
135 if (!table->selfNeedsLayout() && !table->normalChildNeedsLayout() && oldStyl e->border() != style()->border()) 135 if (!table->selfNeedsLayout() && !table->normalChildNeedsLayout() && oldStyl e->border() != style()->border())
136 table->invalidateCollapsedBorders(); 136 table->invalidateCollapsedBorders();
137 137
138 if (LayoutTableBoxComponent::doCellsHaveDirtyWidth(*this, *table, diff, *old Style)) 138 if (LayoutTableBoxComponent::doCellsHaveDirtyWidth(*this, *table, diff, *old Style))
139 markAllCellsWidthsDirtyAndOrNeedsLayout(MarkDirtyAndNeedsLayout); 139 markAllCellsWidthsDirtyAndOrNeedsLayout(LayoutTable::MarkDirtyAndNeedsLa yout);
140 } 140 }
141 141
142 void LayoutTableSection::willBeRemovedFromTree() 142 void LayoutTableSection::willBeRemovedFromTree()
143 { 143 {
144 LayoutTableBoxComponent::willBeRemovedFromTree(); 144 LayoutTableBoxComponent::willBeRemovedFromTree();
145 145
146 // Preventively invalidate our cells as we may be re-inserted into 146 // Preventively invalidate our cells as we may be re-inserted into
147 // a new table which would require us to rebuild our structure. 147 // a new table which would require us to rebuild our structure.
148 setNeedsCellRecalc(); 148 setNeedsCellRecalc();
149 } 149 }
(...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 if (rowChildrenOverflowChanged) 1231 if (rowChildrenOverflowChanged)
1232 rowLayouter->computeOverflow(); 1232 rowLayouter->computeOverflow();
1233 childrenOverflowChanged |= rowChildrenOverflowChanged; 1233 childrenOverflowChanged |= rowChildrenOverflowChanged;
1234 } 1234 }
1235 // TODO(crbug.com/604136): Add visual overflow from rows too. 1235 // TODO(crbug.com/604136): Add visual overflow from rows too.
1236 if (childrenOverflowChanged) 1236 if (childrenOverflowChanged)
1237 computeOverflowFromCells(totalRows, numEffCols); 1237 computeOverflowFromCells(totalRows, numEffCols);
1238 return childrenOverflowChanged; 1238 return childrenOverflowChanged;
1239 } 1239 }
1240 1240
1241 void LayoutTableSection::markAllCellsWidthsDirtyAndOrNeedsLayout(WhatToMarkAllCe lls whatToMark) 1241 void LayoutTableSection::markAllCellsWidthsDirtyAndOrNeedsLayout(LayoutTable::Wh atToMarkAllCells whatToMark)
1242 { 1242 {
1243 for (LayoutTableRow* row = firstRow(); row; row = row->nextRow()) { 1243 for (LayoutTableRow* row = firstRow(); row; row = row->nextRow()) {
1244 for (LayoutTableCell* cell = row->firstCell(); cell; cell = cell->nextCe ll()) { 1244 for (LayoutTableCell* cell = row->firstCell(); cell; cell = cell->nextCe ll()) {
1245 cell->setPreferredLogicalWidthsDirty(); 1245 cell->setPreferredLogicalWidthsDirty();
1246 if (whatToMark == MarkDirtyAndNeedsLayout) 1246 if (whatToMark == LayoutTable::MarkDirtyAndNeedsLayout)
1247 cell->setChildNeedsLayout(); 1247 cell->setChildNeedsLayout();
1248 } 1248 }
1249 } 1249 }
1250 } 1250 }
1251 1251
1252 int LayoutTableSection::calcBlockDirectionOuterBorder(BlockBorderSide side) cons t 1252 int LayoutTableSection::calcBlockDirectionOuterBorder(BlockBorderSide side) cons t
1253 { 1253 {
1254 unsigned totalCols = table()->numEffectiveColumns(); 1254 unsigned totalCols = table()->numEffectiveColumns();
1255 if (!m_grid.size() || !totalCols) 1255 if (!m_grid.size() || !totalCols)
1256 return 0; 1256 return 0;
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1748 // Repeating table headers are painted once per fragmentation page/column. T his does not go through the regular fragmentation machinery, 1748 // Repeating table headers are painted once per fragmentation page/column. T his does not go through the regular fragmentation machinery,
1749 // so we need special code to expand the invalidation rect to contain all po sitions of the header in all columns. 1749 // so we need special code to expand the invalidation rect to contain all po sitions of the header in all columns.
1750 // Note that this is in flow thread coordinates, not visual coordinates. The enclosing LayoutFlowThread will convert to visual coordinates. 1750 // Note that this is in flow thread coordinates, not visual coordinates. The enclosing LayoutFlowThread will convert to visual coordinates.
1751 if (table()->header() == this && hasRepeatingHeaderGroup()) 1751 if (table()->header() == this && hasRepeatingHeaderGroup())
1752 rect.setHeight(table()->logicalHeight()); 1752 rect.setHeight(table()->logicalHeight());
1753 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpace(ancestor, rec t, flags); 1753 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpace(ancestor, rec t, flags);
1754 } 1754 }
1755 1755
1756 1756
1757 } // namespace blink 1757 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698