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..ea8d42c7dad74b6c18d0b76d606892304290f3e0 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/25 18:33:10
:(
Wouldn't container() work without needing this
Xianzhu
2014/11/25 20:17:12
This seems not the best because we'll set the flag
|
| + |
| +void RenderObject::markContainersForOverflowRecalc() |
|
Julien - ping for review
2014/11/25 18:33:10
If you put container in the name, I would have exp
|
| +{ |
| + 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(); |
| + markContainersForOverflowRecalc(); |
| } |
| 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(); |
| + markContainersForOverflowRecalc(); |
| if (diff.needsFullLayout()) |
| setNeedsLayoutAndPrefWidthsRecalc(); |