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

Side by Side Diff: Source/core/layout/LayoutBox.cpp

Issue 1128713004: Don't mark a positioned object for layout when we've just laid it out. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 5 years, 7 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
« no previous file with comments | « Source/core/layout/LayoutBox.h ('k') | Source/core/layout/line/LineBreaker.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1695 matching lines...) Expand 10 before | Expand all | Expand 10 after
1706 // the inlines. 1706 // the inlines.
1707 RootInlineBox& root = box->root(); 1707 RootInlineBox& root = box->root();
1708 root.block().setStaticInlinePositionForChild(*this, LayoutUnit::from FloatRound(box->logicalLeft())); 1708 root.block().setStaticInlinePositionForChild(*this, LayoutUnit::from FloatRound(box->logicalLeft()));
1709 } else { 1709 } else {
1710 // Our object was a block originally, so we make our normal flow pos ition be 1710 // Our object was a block originally, so we make our normal flow pos ition be
1711 // just below the line box (as though all the inlines that came befo re us got 1711 // just below the line box (as though all the inlines that came befo re us got
1712 // wrapped in an anonymous block, which is what would have happened had we been 1712 // wrapped in an anonymous block, which is what would have happened had we been
1713 // in flow). This value was cached in the y() of the box. 1713 // in flow). This value was cached in the y() of the box.
1714 layer()->setStaticBlockPosition(box->logicalTop()); 1714 layer()->setStaticBlockPosition(box->logicalTop());
1715 } 1715 }
1716 markStaticPositionedBoxForLayout(box->isHorizontal(), originallyInline);
1717 1716
1718 if (container()->isLayoutInline()) 1717 if (container()->isLayoutInline())
1719 moveWithEdgeOfInlineContainerIfNecessary(box->isHorizontal()); 1718 moveWithEdgeOfInlineContainerIfNecessary(box->isHorizontal());
1720 1719
1721 // Nuke the box. 1720 // Nuke the box.
1722 box->remove(DontMarkLineBoxes); 1721 box->remove(DontMarkLineBoxes);
1723 box->destroy(); 1722 box->destroy();
1724 } else if (isReplaced()) { 1723 } else if (isReplaced()) {
1725 // FIXME: the call to roundedLayoutPoint() below is temporary and should be removed once 1724 // FIXME: the call to roundedLayoutPoint() below is temporary and should be removed once
1726 // the transition to LayoutUnit-based types is complete (crbug.com/32123 7) 1725 // the transition to LayoutUnit-based types is complete (crbug.com/32123 7)
1727 setLocationAndUpdateOverflowControlsIfNeeded(box->topLeft().roundedLayou tPoint()); 1726 setLocationAndUpdateOverflowControlsIfNeeded(box->topLeft().roundedLayou tPoint());
1728 setInlineBoxWrapper(box); 1727 setInlineBoxWrapper(box);
1729 } 1728 }
1730 } 1729 }
1731 1730
1732 void LayoutBox::markStaticPositionedBoxForLayout(bool isHorizontal, bool isInlin e)
1733 {
1734 ASSERT(isOutOfFlowPositioned());
1735 if (normalChildNeedsLayout())
1736 return;
1737 if (isInline ? style()->hasStaticInlinePosition(isHorizontal) : style()->has StaticBlockPosition(isHorizontal))
1738 setChildNeedsLayout(MarkOnlyThis);
1739 }
1740
1741 void LayoutBox::moveWithEdgeOfInlineContainerIfNecessary(bool isHorizontal) 1731 void LayoutBox::moveWithEdgeOfInlineContainerIfNecessary(bool isHorizontal)
1742 { 1732 {
1743 ASSERT(isOutOfFlowPositioned() && container()->isLayoutInline() && container ()->isRelPositioned()); 1733 ASSERT(isOutOfFlowPositioned() && container()->isLayoutInline() && container ()->isRelPositioned());
1744 // If this object is inside a relative positioned inline and its inline posi tion is an explicit offset from the edge of its container 1734 // If this object is inside a relative positioned inline and its inline posi tion is an explicit offset from the edge of its container
1745 // then it will need to move if its inline container has changed width. We d o not track if the width has changed 1735 // then it will need to move if its inline container has changed width. We d o not track if the width has changed
1746 // 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 1736 // 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
1747 // move to the new offset created by the new width. 1737 // move to the new offset created by the new width.
1748 if (!normalChildNeedsLayout() && !style()->hasStaticInlinePosition(isHorizon tal)) 1738 if (!normalChildNeedsLayout() && !style()->hasStaticInlinePosition(isHorizon tal))
1749 setChildNeedsLayout(MarkOnlyThis); 1739 setChildNeedsLayout(MarkOnlyThis);
1750 } 1740 }
(...skipping 3003 matching lines...) Expand 10 before | Expand all | Expand 10 after
4754 return true; 4744 return true;
4755 4745
4756 // Our fill layers are ok. Let's check border. 4746 // Our fill layers are ok. Let's check border.
4757 if (style()->hasBorder() && canRenderBorderImage()) 4747 if (style()->hasBorder() && canRenderBorderImage())
4758 return true; 4748 return true;
4759 4749
4760 return false; 4750 return false;
4761 } 4751 }
4762 4752
4763 } // namespace blink 4753 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutBox.h ('k') | Source/core/layout/line/LineBreaker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698