Index: Source/core/layout/LayoutBlock.cpp |
diff --git a/Source/core/layout/LayoutBlock.cpp b/Source/core/layout/LayoutBlock.cpp |
index dd9facbf773689c89c04a2fa25bf0158e740a832..10eb36fe5e9cce8a0d519d85c7da9a1b63a9c2b3 100644 |
--- a/Source/core/layout/LayoutBlock.cpp |
+++ b/Source/core/layout/LayoutBlock.cpp |
@@ -281,20 +281,11 @@ void LayoutBlock::styleWillChange(StyleDifference diff, const ComputedStyle& new |
// Clear our positioned objects list. Our absolutely positioned descendants will be |
// inserted into our containing block's positioned objects list during layout. |
removePositionedObjects(0, NewContainingBlock); |
- } else if (!oldStyleIsContainer && newStyleIsContainer) { |
+ } else if ((!oldStyleIsContainer || oldStyle->position() != newStyle.position()) && newStyleIsContainer) { |
// Remove our absolutely positioned descendants from their current containing block. |
mstensho (USE GERRIT)
2015/06/15 10:02:55
This comment is now inaccurate. We're removing pos
|
// They will be inserted into our positioned objects list during layout. |
- LayoutObject* cb = parent(); |
- while (cb && (cb->style()->position() == StaticPosition || (cb->isInline() && !cb->isReplaced())) && !cb->isLayoutView()) { |
- if (cb->style()->position() == RelativePosition && cb->isInline() && !cb->isReplaced()) { |
- cb = cb->containingBlock(); |
- break; |
- } |
- cb = cb->parent(); |
- } |
- |
- if (cb->isLayoutBlock()) |
- toLayoutBlock(cb)->removePositionedObjects(this, NewContainingBlock); |
+ if (LayoutBlock* cb = containingBlock(&newStyle)) |
mstensho (USE GERRIT)
2015/06/15 10:02:54
Why not do this in styleDidChange() instead of sty
|
+ cb->removePositionedObjects(this, NewContainingBlock); |
} |
} |