Chromium Code Reviews| Index: Source/core/rendering/RenderBlock.cpp |
| diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp |
| index a95ad9ee2a5fb8d4cc81f71a43687feab0881aa4..5996b7b4811bb89f3ac5c95eaed51e1fbe3078fc 100644 |
| --- a/Source/core/rendering/RenderBlock.cpp |
| +++ b/Source/core/rendering/RenderBlock.cpp |
| @@ -365,15 +365,19 @@ void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldSty |
| void RenderBlock::repaintTreeAfterLayout(const RenderLayerModelObject& repaintContainer) |
| { |
| - if (!shouldCheckForInvalidationAfterLayout()) |
| - return; |
| + // Note, we don't want to early out here using shouldCheckForInvalidationAfterLayout as |
| + // we have to make sure we go through any positioned objects as they won't be seen in |
| + // the normal tree walk. |
| - RenderBox::repaintTreeAfterLayout(repaintContainer); |
| + if (shouldCheckForInvalidationAfterLayout()) |
| + RenderBox::repaintTreeAfterLayout(repaintContainer); |
| // Take care of positioned objects. This is required as LayoutState keeps a single clip rect. |
| if (TrackedRendererListHashSet* positionedObjects = this->positionedObjects()) { |
| TrackedRendererListHashSet::iterator end = positionedObjects->end(); |
| LayoutStateMaintainer statePusher(*this, isTableRow() ? LayoutSize() : locationOffset()); |
| + |
| + bool isFloatingOrRelPositioned = isFloating() || isRelPositioned(); |
|
leviw_travelin_and_unemployed
2014/05/27 17:27:57
Can this not be an issue with absPos as well? Can
|
| for (TrackedRendererListHashSet::iterator it = positionedObjects->begin(); it != end; ++it) { |
| RenderBox* box = *it; |
| @@ -381,6 +385,17 @@ void RenderBlock::repaintTreeAfterLayout(const RenderLayerModelObject& repaintCo |
| // so we can't pass our own repaint container along. |
| const RenderLayerModelObject& repaintContainerForChild = *box->containerForRepaint(); |
| + // When a floating object is moved the children do not get layout but they get a new position. |
| + // We have to make sure we invalidate the children if a floating parent container moves. |
| + if (isFloatingOrRelPositioned) { |
| + if (box->previousPositionFromRepaintContainer() != box->positionFromRepaintContainer(&repaintContainerForChild)) { |
| + // Note, this has to be non-recursive. If we walk up the tree we'll end up setting |
| + // the flag on our parent who has already cleared their flags for this invalidation |
| + // walk. We also don't have to force them to walk as we're already there. |
| + box->setSelfMayNeedInvalidation(true); |
| + } |
| + } |
| + |
| // If the positioned renderer is absolutely positioned and it is inside |
| // a relatively positioend inline element, we need to account for |
| // the inline elements position in LayoutState. |