Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1223)

Unified Diff: Source/core/rendering/RenderBox.cpp

Issue 372023002: Abs-positioned objects should move with inline rel-positioned containers when the latter change wid… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/line/BreakingContextInlineHeaders.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index 15cd98ac30c21f3e2ecb887e0ce6c4913a814a9b..684ea44e8a82f993d6823fbf1b675b0eedb0e03f 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -1930,6 +1930,9 @@ void RenderBox::positionLineBox(InlineBox* box)
setChildNeedsLayout(MarkOnlyThis); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
}
+ if (container()->isRenderInline())
+ moveWithEdgeOfInlineContainerIfNecessary(box->isHorizontal());
+
// Nuke the box.
box->remove(DontMarkLineBoxes);
box->destroy();
@@ -1939,6 +1942,17 @@ void RenderBox::positionLineBox(InlineBox* box)
}
}
+void RenderBox::moveWithEdgeOfInlineContainerIfNecessary(bool isHorizontal)
+{
+ ASSERT(isOutOfFlowPositioned() && container()->isRenderInline() && container()->isRelPositioned());
+ // If this object is inside a relative positioned inline and its inline position is an explicit offset from the edge of its container
+ // then it will need to move if its inline container has changed width. We do not track if the width has changed
+ // but if we are here then we are laying out lines inside it, so it probably has - mark our object for layout so that it can
+ // move to the new offset created by the new width.
+ if (!normalChildNeedsLayout() && !style()->hasStaticInlinePosition(isHorizontal))
+ setChildNeedsLayout(MarkOnlyThis);
+}
+
void RenderBox::deleteLineBoxWrapper()
{
if (inlineBoxWrapper()) {
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/line/BreakingContextInlineHeaders.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698