Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutTableRow.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp b/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp |
| index 39bdbe41f383311d058cea2b39f8bacc7c4cd6db..73453296b50f97a87f52c1eaa4e88b2087e4ca75 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp |
| @@ -153,8 +153,21 @@ void LayoutTableRow::addChild(LayoutObject* child, LayoutObject* beforeChild) |
| LayoutTableBoxComponent::addChild(cell, beforeChild); |
| // Generated content can result in us having a null section so make sure to null check our parent. |
| - if (parent()) |
| + if (parent()) { |
| section()->addCell(cell, this); |
| + // When borders collapse, adding a cell can affect the the width of neighboring cells. |
| + LayoutTable* enclosingTable = table(); |
| + if (enclosingTable && enclosingTable->collapseBorders()) { |
| + if (cell->previousCell()) { |
|
mstensho (USE GERRIT)
2016/08/29 09:07:17
Might as well write "if (LayoutTableCell* previous
dgrogan
2016/08/31 21:42:19
Done.
|
| + cell->previousCell()->setNeedsLayout(LayoutInvalidationReason::TableChanged); |
|
mstensho (USE GERRIT)
2016/08/29 09:07:17
Can use setNeedsLayoutAndPrefWidthsRecalc() instea
dgrogan
2016/08/31 21:42:19
Done.
|
| + cell->previousCell()->setPreferredLogicalWidthsDirty(); |
| + } |
| + if (cell->nextCell()) { |
|
mstensho (USE GERRIT)
2016/08/29 09:07:17
Ditto 1.
dgrogan
2016/08/31 21:42:19
Done.
|
| + cell->nextCell()->setNeedsLayout(LayoutInvalidationReason::TableChanged); |
|
mstensho (USE GERRIT)
2016/08/29 09:07:17
Ditto 2.
dgrogan
2016/08/31 21:42:18
Done.
|
| + cell->nextCell()->setPreferredLogicalWidthsDirty(); |
| + } |
| + } |
| + } |
| if (beforeChild || nextRow()) |
| section()->setNeedsCellRecalc(); |