 Chromium Code Reviews
 Chromium Code Reviews Issue 151993004:
  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
    
  
    Issue 151993004:
  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| Index: Source/core/rendering/RenderTableCol.cpp | 
| diff --git a/Source/core/rendering/RenderTableCol.cpp b/Source/core/rendering/RenderTableCol.cpp | 
| index 26c5935f97f1d3bd065cfbc31b1acc90e6fc6c8a..f56460c9385e6c868e91b965de5cdbc3e95847a8 100644 | 
| --- a/Source/core/rendering/RenderTableCol.cpp | 
| +++ b/Source/core/rendering/RenderTableCol.cpp | 
| @@ -51,8 +51,33 @@ 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()) { | 
| + unsigned nEffCols = table->numEffCols(); | 
| + unsigned currentColumn = 0; | 
| + RenderTableSection* section = 0; | 
| + for (RenderTableCol* column = table->firstColumn()->nextColumn(); column; column = column->nextColumn()) { | 
| + if (this == column) | 
| + break; | 
| + currentColumn += column->span(); | 
| + } | 
| + for (RenderObject* child = table->firstChild(); child; child = child->nextSibling()) { | 
| + if (child->isTableSection()) { | 
| + section = toRenderTableSection(child); | 
| + break; | 
| + } | 
| + } | 
| 
Julien - ping for review
2014/02/24 19:25:31
There is table->topSection() that will give you th
 
Gurpreet
2014/02/25 13:12:56
Done.
 | 
| + unsigned currentColSpan = currentColumn + span(); | 
| + for (unsigned j = currentColumn; j < currentColSpan && currentColSpan <= nEffCols; j++) { | 
| + for (unsigned i = 0; i < section->numRows(); i++) { | 
| + RenderTableCell* cell = section->primaryCellAt(i, j); | 
| + if (!cell) | 
| + continue; | 
| + cell->setPreferredLogicalWidthsDirty(); | 
| + } | 
| + } | 
| + } | 
| 
Julien - ping for review
2014/02/24 19:25:31
Again, you need to invalidate the whole column whi
 
Gurpreet
2014/02/25 13:12:56
Done.
 | 
| } | 
| } |