Chromium Code Reviews| Index: Source/core/rendering/RenderObject.cpp |
| diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp |
| index ff25785b44017adb01740cf240ed9a6f6d028013..27138fa49def3ab6cb18fba38e3d40a837485441 100644 |
| --- a/Source/core/rendering/RenderObject.cpp |
| +++ b/Source/core/rendering/RenderObject.cpp |
| @@ -1614,18 +1614,26 @@ void RenderObject::setPseudoStyle(PassRefPtr<RenderStyle> pseudoStyle) |
| setStyle(pseudoStyle); |
| } |
| -void RenderObject::markContainingBlocksForOverflowRecalc() |
| +static RenderObject* containerForOverflowRecalc(const RenderObject* object) |
| { |
| - for (RenderBlock* container = containingBlock(); container && !container->childNeedsOverflowRecalcAfterStyleChange(); container = container->containingBlock()) |
| - container->setChildNeedsOverflowRecalcAfterStyleChange(true); |
| + // For table parts, we let the parent (e.g. RenderTableRow for RenderTableCell) |
| + // handle the childNeedsOverflowRecalcAfterStyleChange flag, because |
| + // RenderBlock::recalcChildOverflowAfterStyleChange() may not reach the table parts. |
| + return object->isTablePart() ? object->parent() : object->containingBlock(); |
|
Julien - ping for review
2014/11/26 19:23:33
You don't care about table caption so that check i
Xianzhu
2014/11/26 20:53:30
Avoided the containerForOverflowRecalc() with a sl
|
| +} |
| + |
| +void RenderObject::markContainersForOverflowRecalcIfNeeded() |
| +{ |
| + for (RenderObject* container = containerForOverflowRecalc(this); container && !container->childNeedsOverflowRecalcAfterStyleChange(); container = containerForOverflowRecalc(container)) |
| + container->setChildNeedsOverflowRecalcAfterStyleChange(); |
| } |
| void RenderObject::setNeedsOverflowRecalcAfterStyleChange() |
| { |
| bool neededRecalc = needsOverflowRecalcAfterStyleChange(); |
| - setSelfNeedsOverflowRecalcAfterStyleChange(true); |
| + setSelfNeedsOverflowRecalcAfterStyleChange(); |
| if (!neededRecalc) |
| - markContainingBlocksForOverflowRecalc(); |
| + markContainersForOverflowRecalcIfNeeded(); |
| } |
| void RenderObject::setStyle(PassRefPtr<RenderStyle> style) |
| @@ -1827,7 +1835,7 @@ void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldSt |
| // Ditto. |
| if (needsOverflowRecalcAfterStyleChange() && oldStyle->position() != m_style->position()) |
| - markContainingBlocksForOverflowRecalc(); |
| + markContainersForOverflowRecalcIfNeeded(); |
| if (diff.needsFullLayout()) |
| setNeedsLayoutAndPrefWidthsRecalc(); |