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

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

Issue 2047743002: [css-flexbox] logical widths are always definite. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutFlexibleBox.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 2236 matching lines...) Expand 10 before | Expand all | Expand 10 after
2247 containerWidthInInlineDirection = perpendicularContainingBlockLogicalHei ght(); 2247 containerWidthInInlineDirection = perpendicularContainingBlockLogicalHei ght();
2248 2248
2249 // Width calculations 2249 // Width calculations
2250 if (treatAsReplaced) { 2250 if (treatAsReplaced) {
2251 computedValues.m_extent = LayoutUnit(logicalWidthLength.value()) + borde rAndPaddingLogicalWidth(); 2251 computedValues.m_extent = LayoutUnit(logicalWidthLength.value()) + borde rAndPaddingLogicalWidth();
2252 } else if (parent()->isLayoutGrid() && style()->logicalWidth().isAuto() && s tyle()->logicalMinWidth().isAuto() && style()->overflowX() == OverflowVisible && containerWidthInInlineDirection < minPreferredLogicalWidth()) { 2252 } else if (parent()->isLayoutGrid() && style()->logicalWidth().isAuto() && s tyle()->logicalMinWidth().isAuto() && style()->overflowX() == OverflowVisible && containerWidthInInlineDirection < minPreferredLogicalWidth()) {
2253 // TODO (lajava) Move this logic to the LayoutGrid class. 2253 // TODO (lajava) Move this logic to the LayoutGrid class.
2254 // Implied minimum size of Grid items. 2254 // Implied minimum size of Grid items.
2255 computedValues.m_extent = constrainLogicalWidthByMinMax(minPreferredLogi calWidth(), containerWidthInInlineDirection, cb); 2255 computedValues.m_extent = constrainLogicalWidthByMinMax(minPreferredLogi calWidth(), containerWidthInInlineDirection, cb);
2256 } else { 2256 } else {
2257 if (!hasPerpendicularContainingBlock && cb->isFlexItem() && styleToUse.l ogicalWidth().hasPercent() && !isOutOfFlowPositioned()) {
2258 LayoutUnit stretchedWidth = toLayoutFlexibleBox(cb->parent())->child LogicalWidthForPercentageResolution(*cb);
2259 if (stretchedWidth != LayoutUnit(-1))
2260 containerWidthInInlineDirection = stretchedWidth;
2261 }
2262 LayoutUnit preferredWidth = computeLogicalWidthUsing(MainOrPreferredSize , styleToUse.logicalWidth(), containerWidthInInlineDirection, cb); 2257 LayoutUnit preferredWidth = computeLogicalWidthUsing(MainOrPreferredSize , styleToUse.logicalWidth(), containerWidthInInlineDirection, cb);
2263 computedValues.m_extent = constrainLogicalWidthByMinMax(preferredWidth, containerWidthInInlineDirection, cb); 2258 computedValues.m_extent = constrainLogicalWidthByMinMax(preferredWidth, containerWidthInInlineDirection, cb);
2264 } 2259 }
2265 2260
2266 // Margin calculations. 2261 // Margin calculations.
2267 computeMarginsForDirection(InlineDirection, cb, containerLogicalWidth, compu tedValues.m_extent, computedValues.m_margins.m_start, 2262 computeMarginsForDirection(InlineDirection, cb, containerLogicalWidth, compu tedValues.m_extent, computedValues.m_margins.m_start,
2268 computedValues.m_margins.m_end, style()->marginStart(), style()->marginE nd()); 2263 computedValues.m_margins.m_end, style()->marginStart(), style()->marginE nd());
2269 2264
2270 if (!hasPerpendicularContainingBlock && containerLogicalWidth && containerLo gicalWidth != (computedValues.m_extent + computedValues.m_margins.m_start + comp utedValues.m_margins.m_end) 2265 if (!hasPerpendicularContainingBlock && containerLogicalWidth && containerLo gicalWidth != (computedValues.m_extent + computedValues.m_margins.m_start + comp utedValues.m_margins.m_end)
2271 && !isFloating() && !isInline() && !cb->isFlexibleBoxIncludingDeprecated () && !cb->isLayoutGrid()) { 2266 && !isFloating() && !isInline() && !cb->isFlexibleBoxIncludingDeprecated () && !cb->isLayoutGrid()) {
(...skipping 2679 matching lines...) Expand 10 before | Expand all | Expand 10 after
4951 m_rareData->m_snapAreas->remove(&snapArea); 4946 m_rareData->m_snapAreas->remove(&snapArea);
4952 } 4947 }
4953 } 4948 }
4954 4949
4955 SnapAreaSet* LayoutBox::snapAreas() const 4950 SnapAreaSet* LayoutBox::snapAreas() const
4956 { 4951 {
4957 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; 4952 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr;
4958 } 4953 }
4959 4954
4960 } // namespace blink 4955 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutFlexibleBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698