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

Side by Side Diff: Source/core/rendering/RenderBox.cpp

Issue 298913002: Revert of Refactor avoidsFloats() to reflect CSS2.1 spec more clearly (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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/rendering/RenderBox.h ('k') | Source/core/rendering/RenderFieldset.h » ('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 4083 matching lines...) Expand 10 before | Expand all | Expand 10 after
4094 // Floating objects don't shrink. Objects that don't avoid floats don't shr ink. Marquees don't shrink. 4094 // Floating objects don't shrink. Objects that don't avoid floats don't shr ink. Marquees don't shrink.
4095 if ((isInline() && !isMarquee()) || !avoidsFloats() || isFloating()) 4095 if ((isInline() && !isMarquee()) || !avoidsFloats() || isFloating())
4096 return false; 4096 return false;
4097 4097
4098 // Only auto width objects can possibly shrink to avoid floats. 4098 // Only auto width objects can possibly shrink to avoid floats.
4099 return style()->width().isAuto(); 4099 return style()->width().isAuto();
4100 } 4100 }
4101 4101
4102 bool RenderBox::avoidsFloats() const 4102 bool RenderBox::avoidsFloats() const
4103 { 4103 {
4104 // CSS2.1: "The border box of a table, a block-level replaced element, or an element in the normal flow that establishes a new block formatting 4104 return isReplaced() || hasOverflowClip() || isHR() || isLegend() || isWritin gModeRoot() || isFlexItemIncludingDeprecated();
4105 // context .. must not overlap the margin box of any floats in the same bloc k formatting context."
4106 // FIXME: The inclusion of horizontal rule and legend elements here isn't co vered by any spec.
4107 return isReplaced() || isHR() || isLegend() || isTable() || (!isFloatingOrOu tOfFlowPositioned() && createsBlockFormattingContext());
4108 }
4109
4110 bool RenderBox::createsBlockFormattingContext() const
4111 {
4112 return isInlineBlockOrInlineTable() || isFloatingOrOutOfFlowPositioned() || hasOverflowClip() || isFlexItemIncludingDeprecated()
4113 || style()->specifiesColumns() || isRenderFlowThread() || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot() || isDocumentElement( ) || style()->columnSpan();
4114 } 4105 }
4115 4106
4116 void RenderBox::markForPaginationRelayoutIfNeeded(SubtreeLayoutScope& layoutScop e) 4107 void RenderBox::markForPaginationRelayoutIfNeeded(SubtreeLayoutScope& layoutScop e)
4117 { 4108 {
4118 ASSERT(!needsLayout()); 4109 ASSERT(!needsLayout());
4119 // If fragmentation height has changed, we need to lay out. No need to enter the renderer if it 4110 // If fragmentation height has changed, we need to lay out. No need to enter the renderer if it
4120 // is childless, though. 4111 // is childless, though.
4121 if (view()->layoutState()->pageLogicalHeightChanged() && firstChild()) 4112 if (view()->layoutState()->pageLogicalHeightChanged() && firstChild())
4122 layoutScope.setChildNeedsLayout(this); 4113 layoutScope.setChildNeedsLayout(this);
4123 } 4114 }
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
4671 return 0; 4662 return 0;
4672 4663
4673 if (!layoutState && !flowThreadContainingBlock()) 4664 if (!layoutState && !flowThreadContainingBlock())
4674 return 0; 4665 return 0;
4675 4666
4676 RenderBlock* containerBlock = containingBlock(); 4667 RenderBlock* containerBlock = containingBlock();
4677 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); 4668 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop();
4678 } 4669 }
4679 4670
4680 } // namespace WebCore 4671 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderFieldset.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698