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

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

Issue 1420303002: Remove support for intrinsic and min-intrinsic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
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 2178 matching lines...) Expand 10 before | Expand all | Expand 10 after
2189 if (parent->isFlexibleBox() && parent->style()->flexWrap() == FlexNoWrap && parent->style()->isColumnFlexDirection() && columnFlexItemHasStretchAlignment(fl exitem)) 2189 if (parent->isFlexibleBox() && parent->style()->flexWrap() == FlexNoWrap && parent->style()->isColumnFlexDirection() && columnFlexItemHasStretchAlignment(fl exitem))
2190 return true; 2190 return true;
2191 return false; 2191 return false;
2192 } 2192 }
2193 2193
2194 bool LayoutBox::sizesLogicalWidthToFitContent(const Length& logicalWidth) const 2194 bool LayoutBox::sizesLogicalWidthToFitContent(const Length& logicalWidth) const
2195 { 2195 {
2196 if (isFloating() || isInlineBlockOrInlineTable()) 2196 if (isFloating() || isInlineBlockOrInlineTable())
2197 return true; 2197 return true;
2198 2198
2199 if (logicalWidth.type() == Intrinsic)
2200 return true;
2201
2202 // Flexible box items should shrink wrap, so we lay them out at their intrin sic widths. 2199 // Flexible box items should shrink wrap, so we lay them out at their intrin sic widths.
2203 // In the case of columns that have a stretch alignment, we go ahead and lay out at the 2200 // In the case of columns that have a stretch alignment, we go ahead and lay out at the
2204 // stretched size to avoid an extra layout when applying alignment. 2201 // stretched size to avoid an extra layout when applying alignment.
2205 if (parent()->isFlexibleBox()) { 2202 if (parent()->isFlexibleBox()) {
2206 // For multiline columns, we need to apply align-content first, so we ca n't stretch now. 2203 // For multiline columns, we need to apply align-content first, so we ca n't stretch now.
2207 if (!parent()->style()->isColumnFlexDirection() || parent()->style()->fl exWrap() != FlexNoWrap) 2204 if (!parent()->style()->isColumnFlexDirection() || parent()->style()->fl exWrap() != FlexNoWrap)
2208 return true; 2205 return true;
2209 if (!columnFlexItemHasStretchAlignment(this)) 2206 if (!columnFlexItemHasStretchAlignment(this))
2210 return true; 2207 return true;
2211 } 2208 }
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
2650 const LayoutUnit cw = isOutOfFlowPositioned() ? containingBlockLogicalWi dthForPositioned(toLayoutBoxModelObject(container())) : containingBlockLogicalWi dthForContent(); 2647 const LayoutUnit cw = isOutOfFlowPositioned() ? containingBlockLogicalWi dthForPositioned(toLayoutBoxModelObject(container())) : containingBlockLogicalWi dthForContent();
2651 Length containerLogicalWidth = containingBlock()->style()->logicalWidth( ); 2648 Length containerLogicalWidth = containingBlock()->style()->logicalWidth( );
2652 // FIXME: Handle cases when containing block width is calculated or view port percent. 2649 // FIXME: Handle cases when containing block width is calculated or view port percent.
2653 // https://bugs.webkit.org/show_bug.cgi?id=91071 2650 // https://bugs.webkit.org/show_bug.cgi?id=91071
2654 if (logicalWidth.isIntrinsic()) 2651 if (logicalWidth.isIntrinsic())
2655 return computeIntrinsicLogicalWidthUsing(logicalWidth, cw, borderAnd PaddingLogicalWidth()) - borderAndPaddingLogicalWidth(); 2652 return computeIntrinsicLogicalWidthUsing(logicalWidth, cw, borderAnd PaddingLogicalWidth()) - borderAndPaddingLogicalWidth();
2656 if (cw > 0 || (!cw && (containerLogicalWidth.isFixed() || containerLogic alWidth.hasPercent()))) 2653 if (cw > 0 || (!cw && (containerLogicalWidth.isFixed() || containerLogic alWidth.hasPercent())))
2657 return adjustContentBoxLogicalWidthForBoxSizing(minimumValueForLengt h(logicalWidth, cw)); 2654 return adjustContentBoxLogicalWidthForBoxSizing(minimumValueForLengt h(logicalWidth, cw));
2658 return LayoutUnit(); 2655 return LayoutUnit();
2659 } 2656 }
2660 case Intrinsic:
2661 case MinIntrinsic:
2662 case Auto: 2657 case Auto:
2663 case MaxSizeNone: 2658 case MaxSizeNone:
2664 return intrinsicLogicalWidth(); 2659 return intrinsicLogicalWidth();
2665 case ExtendToZoom: 2660 case ExtendToZoom:
2666 case DeviceWidth: 2661 case DeviceWidth:
2667 case DeviceHeight: 2662 case DeviceHeight:
2668 break; 2663 break;
2669 } 2664 }
2670 2665
2671 ASSERT_NOT_REACHED(); 2666 ASSERT_NOT_REACHED();
(...skipping 2164 matching lines...) Expand 10 before | Expand all | Expand 10 after
4836 StyleImage* borderImage = style()->borderImage().image(); 4831 StyleImage* borderImage = style()->borderImage().image();
4837 return borderImage && borderImage->canRender(*this, style()->effectiveZoom() ) && borderImage->isLoaded(); 4832 return borderImage && borderImage->canRender(*this, style()->effectiveZoom() ) && borderImage->isLoaded();
4838 } 4833 }
4839 4834
4840 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const 4835 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const
4841 { 4836 {
4842 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this) : nullptr; 4837 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this) : nullptr;
4843 } 4838 }
4844 4839
4845 } // namespace blink 4840 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698