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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 1912 matching lines...) Expand 10 before | Expand all | Expand 10 after
1923 } else { 1923 } else {
1924 // Our object was a block originally, so we make our normal flow pos ition be 1924 // Our object was a block originally, so we make our normal flow pos ition be
1925 // just below the line box (as though all the inlines that came befo re us got 1925 // just below the line box (as though all the inlines that came befo re us got
1926 // wrapped in an anonymous block, which is what would have happened had we been 1926 // wrapped in an anonymous block, which is what would have happened had we been
1927 // in flow). This value was cached in the y() of the box. 1927 // in flow). This value was cached in the y() of the box.
1928 layer()->setStaticBlockPosition(box->logicalTop()); 1928 layer()->setStaticBlockPosition(box->logicalTop());
1929 if (style()->hasStaticBlockPosition(box->isHorizontal())) 1929 if (style()->hasStaticBlockPosition(box->isHorizontal()))
1930 setChildNeedsLayout(MarkOnlyThis); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly. 1930 setChildNeedsLayout(MarkOnlyThis); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
1931 } 1931 }
1932 1932
1933 if (container()->isRenderInline())
1934 moveWithEdgeOfInlineContainerIfNecessary(box->isHorizontal());
1935
1933 // Nuke the box. 1936 // Nuke the box.
1934 box->remove(DontMarkLineBoxes); 1937 box->remove(DontMarkLineBoxes);
1935 box->destroy(); 1938 box->destroy();
1936 } else if (isReplaced()) { 1939 } else if (isReplaced()) {
1937 setLocation(roundedLayoutPoint(box->topLeft())); 1940 setLocation(roundedLayoutPoint(box->topLeft()));
1938 setInlineBoxWrapper(box); 1941 setInlineBoxWrapper(box);
1939 } 1942 }
1940 } 1943 }
1941 1944
1945 void RenderBox::moveWithEdgeOfInlineContainerIfNecessary(bool isHorizontal)
1946 {
1947 ASSERT(isOutOfFlowPositioned() && container()->isRenderInline() && container ()->isRelPositioned());
1948 // If this object is inside a relative positioned inline and its inline posi tion is an explicit offset from the edge of its container
1949 // then it will need to move if its inline container has changed width. We d o not track if the width has changed
1950 // 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
1951 // move to the new offset created by the new width.
1952 if (!normalChildNeedsLayout() && !style()->hasStaticInlinePosition(isHorizon tal))
1953 setChildNeedsLayout(MarkOnlyThis);
1954 }
1955
1942 void RenderBox::deleteLineBoxWrapper() 1956 void RenderBox::deleteLineBoxWrapper()
1943 { 1957 {
1944 if (inlineBoxWrapper()) { 1958 if (inlineBoxWrapper()) {
1945 if (!documentBeingDestroyed()) 1959 if (!documentBeingDestroyed())
1946 inlineBoxWrapper()->remove(); 1960 inlineBoxWrapper()->remove();
1947 inlineBoxWrapper()->destroy(); 1961 inlineBoxWrapper()->destroy();
1948 ASSERT(m_rareData); 1962 ASSERT(m_rareData);
1949 m_rareData->m_inlineBoxWrapper = 0; 1963 m_rareData->m_inlineBoxWrapper = 0;
1950 } 1964 }
1951 } 1965 }
(...skipping 2717 matching lines...) Expand 10 before | Expand all | Expand 10 after
4669 4683
4670 // We need the old border box size only when the box has background or b ox decorations. 4684 // We need the old border box size only when the box has background or b ox decorations.
4671 if (!style()->hasBackground() && !style()->hasBoxDecorations()) 4685 if (!style()->hasBackground() && !style()->hasBoxDecorations())
4672 return; 4686 return;
4673 } 4687 }
4674 4688
4675 ensureRareData().m_previousBorderBoxSize = size(); 4689 ensureRareData().m_previousBorderBoxSize = size();
4676 } 4690 }
4677 4691
4678 } // namespace blink 4692 } // namespace blink
OLDNEW
« 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