| Index: Source/core/rendering/RenderObject.cpp
|
| diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
|
| index 125225e68d42cbc446432ef57462f273d3e10bdc..bfc1391eaa8252f589d6155d61d341e8886cf5d3 100644
|
| --- a/Source/core/rendering/RenderObject.cpp
|
| +++ b/Source/core/rendering/RenderObject.cpp
|
| @@ -1609,18 +1609,25 @@ void RenderObject::setPseudoStyle(PassRefPtr<RenderStyle> pseudoStyle)
|
| setStyle(pseudoStyle);
|
| }
|
|
|
| -void RenderObject::markContainingBlocksForOverflowRecalc()
|
| +// FIXME: This will be markContainingBoxesForOverflowRecalc() when we make RenderBoxes recomputeOverflow-capable. crbug.com/437012.
|
| +void RenderObject::markContainersForOverflowRecalcIfNeeded()
|
| {
|
| - for (RenderBlock* container = containingBlock(); container && !container->childNeedsOverflowRecalcAfterStyleChange(); container = container->containingBlock())
|
| - container->setChildNeedsOverflowRecalcAfterStyleChange(true);
|
| + RenderObject* object = this;
|
| + do {
|
| + // Cell and row need to propagate the flag to their containing section and row as their containing block is the table wrapper.
|
| + // This enables us to only recompute overflow the modified sections / rows.
|
| + object = object->isTableCell() || object->isTableRow() ? object->parent() : object->containingBlock();
|
| + if (object)
|
| + object->setChildNeedsOverflowRecalcAfterStyleChange();
|
| + } while (object);
|
| }
|
|
|
| void RenderObject::setNeedsOverflowRecalcAfterStyleChange()
|
| {
|
| bool neededRecalc = needsOverflowRecalcAfterStyleChange();
|
| - setSelfNeedsOverflowRecalcAfterStyleChange(true);
|
| + setSelfNeedsOverflowRecalcAfterStyleChange();
|
| if (!neededRecalc)
|
| - markContainingBlocksForOverflowRecalc();
|
| + markContainersForOverflowRecalcIfNeeded();
|
| }
|
|
|
| void RenderObject::setStyle(PassRefPtr<RenderStyle> style)
|
| @@ -1822,7 +1829,7 @@ void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
|
|
|
| // Ditto.
|
| if (needsOverflowRecalcAfterStyleChange() && oldStyle->position() != m_style->position())
|
| - markContainingBlocksForOverflowRecalc();
|
| + markContainersForOverflowRecalcIfNeeded();
|
|
|
| if (diff.needsFullLayout())
|
| setNeedsLayoutAndPrefWidthsRecalc();
|
|
|