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

Unified Diff: Source/core/rendering/RenderTableCol.cpp

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: Created 5 years, 11 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
« no previous file with comments | « LayoutTests/fast/table/resize-table-width-using-multiple-col-span-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderTableCol.cpp
diff --git a/Source/core/rendering/RenderTableCol.cpp b/Source/core/rendering/RenderTableCol.cpp
index ea17126a73baff085f968bc15ccbfa1264e6e43f..7c60825d0b055adcae193d29ab469a40d85e99f6 100644
--- a/Source/core/rendering/RenderTableCol.cpp
+++ b/Source/core/rendering/RenderTableCol.cpp
@@ -57,8 +57,22 @@ void RenderTableCol::styleDidChange(StyleDifference diff, const RenderStyle* old
// If border was changed, notify table.
if (parent()) {
RenderTable* table = this->table();
- if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout() && oldStyle && oldStyle->border() != style()->border())
+ if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout() && oldStyle && oldStyle->border() != style()->border()) {
table->invalidateCollapsedBorders();
+ } else if (oldStyle && oldStyle->logicalWidth() != style()->logicalWidth()) {
+ // FIXME : setPreferredLogicalWidthsDirty is done for all cells as of now.
+ // Need to find a better way so that only the cells which are changed by
+ // the col width should have preferred logical widths recomputed.
+ for (RenderObject* child = table->children()->firstChild(); child; child = child->nextSibling()) {
+ if (!child->isTableSection())
+ continue;
+ RenderTableSection* section = toRenderTableSection(child);
+ for (RenderTableRow* row = section->firstRow(); row; row = row->nextRow()) {
+ for (RenderTableCell* cell = row->firstCell(); cell; cell = cell->nextCell())
+ cell->setPreferredLogicalWidthsDirty();
+ }
+ }
+ }
}
}
« no previous file with comments | « LayoutTests/fast/table/resize-table-width-using-multiple-col-span-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698