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

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

Issue 1070143002: [Alignment] Single class for holding the alignment data. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adjusting the StyleRareNonIheritedData class size. Created 5 years, 8 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
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 2109 matching lines...) Expand 10 before | Expand all | Expand 10 after
2120 } 2120 }
2121 2121
2122 static bool columnFlexItemHasStretchAlignment(const LayoutObject* flexitem) 2122 static bool columnFlexItemHasStretchAlignment(const LayoutObject* flexitem)
2123 { 2123 {
2124 LayoutObject* parent = flexitem->parent(); 2124 LayoutObject* parent = flexitem->parent();
2125 // auto margins mean we don't stretch. Note that this function will only be used for 2125 // auto margins mean we don't stretch. Note that this function will only be used for
2126 // widths, so we don't have to check marginBefore/marginAfter. 2126 // widths, so we don't have to check marginBefore/marginAfter.
2127 ASSERT(parent->style()->isColumnFlexDirection()); 2127 ASSERT(parent->style()->isColumnFlexDirection());
2128 if (flexitem->style()->marginStart().isAuto() || flexitem->style()->marginEn d().isAuto()) 2128 if (flexitem->style()->marginStart().isAuto() || flexitem->style()->marginEn d().isAuto())
2129 return false; 2129 return false;
2130 return flexitem->style()->alignSelf() == ItemPositionStretch || (flexitem->s tyle()->alignSelf() == ItemPositionAuto && parent->style()->alignItems() == Item PositionStretch); 2130 return flexitem->style()->alignSelfPosition() == ItemPositionStretch || (fle xitem->style()->alignSelfPosition() == ItemPositionAuto && parent->style()->alig nItemsPosition() == ItemPositionStretch);
2131 } 2131 }
2132 2132
2133 static bool isStretchingColumnFlexItem(const LayoutObject* flexitem) 2133 static bool isStretchingColumnFlexItem(const LayoutObject* flexitem)
2134 { 2134 {
2135 LayoutObject* parent = flexitem->parent(); 2135 LayoutObject* parent = flexitem->parent();
2136 if (parent->isDeprecatedFlexibleBox() && parent->style()->boxOrient() == VER TICAL && parent->style()->boxAlign() == BSTRETCH) 2136 if (parent->isDeprecatedFlexibleBox() && parent->style()->boxOrient() == VER TICAL && parent->style()->boxAlign() == BSTRETCH)
2137 return true; 2137 return true;
2138 2138
2139 // We don't stretch multiline flexboxes because they need to apply line spac ing (align-content) first. 2139 // We don't stretch multiline flexboxes because they need to apply line spac ing (align-content) first.
2140 if (parent->isFlexibleBox() && parent->style()->flexWrap() == FlexNoWrap && parent->style()->isColumnFlexDirection() && columnFlexItemHasStretchAlignment(fl exitem)) 2140 if (parent->isFlexibleBox() && parent->style()->flexWrap() == FlexNoWrap && parent->style()->isColumnFlexDirection() && columnFlexItemHasStretchAlignment(fl exitem))
(...skipping 2539 matching lines...) Expand 10 before | Expand all | Expand 10 after
4680 computedValues.m_margins.m_end = marginEnd(); 4680 computedValues.m_margins.m_end = marginEnd();
4681 4681
4682 setLogicalTop(oldLogicalTop); 4682 setLogicalTop(oldLogicalTop);
4683 setLogicalWidth(oldLogicalWidth); 4683 setLogicalWidth(oldLogicalWidth);
4684 setLogicalLeft(oldLogicalLeft); 4684 setLogicalLeft(oldLogicalLeft);
4685 setMarginLeft(oldMarginLeft); 4685 setMarginLeft(oldMarginLeft);
4686 setMarginRight(oldMarginRight); 4686 setMarginRight(oldMarginRight);
4687 } 4687 }
4688 4688
4689 } // namespace blink 4689 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698