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

Side by Side Diff: Source/core/rendering/style/RenderStyle.cpp

Issue 613273002: [CSS Grid Layout] Stretch value for align and justify properties. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: resolveAlignment and resolveJustification now defined in RenderStyle. Created 6 years, 2 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 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 return diffPseudoStyles(oldStyle, newStyle); 191 return diffPseudoStyles(oldStyle, newStyle);
192 192
193 if (oldStyle->inheritedNotEqual(newStyle) 193 if (oldStyle->inheritedNotEqual(newStyle)
194 || oldStyle->hasExplicitlyInheritedProperties() 194 || oldStyle->hasExplicitlyInheritedProperties()
195 || newStyle->hasExplicitlyInheritedProperties()) 195 || newStyle->hasExplicitlyInheritedProperties())
196 return Inherit; 196 return Inherit;
197 197
198 return NoInherit; 198 return NoInherit;
199 } 199 }
200 200
201 ItemPosition RenderStyle::resolveAlignment(const RenderStyle* parentStyle, const RenderStyle* childStyle) 201 ItemPosition RenderStyle::resolveAlignment(const RenderStyle* parentStyle, const RenderStyle* childStyle, ItemPosition defaultPosition)
202 { 202 {
203 ItemPosition align = childStyle->alignSelf();
204 // The auto keyword computes to the parent's align-items computed value, or to "stretch", if not set or "auto". 203 // The auto keyword computes to the parent's align-items computed value, or to "stretch", if not set or "auto".
205 if (align == ItemPositionAuto) 204 if (childStyle->alignSelf() == ItemPositionAuto)
206 align = (parentStyle->alignItems() == ItemPositionAuto) ? ItemPositionSt retch : parentStyle->alignItems(); 205 return (parentStyle->alignItems() == ItemPositionAuto) ? defaultPosition : parentStyle->alignItems();
207 return align; 206 return childStyle->alignSelf();
207 }
208
209 ItemPosition RenderStyle::resolveJustification(const RenderStyle* parentStyle, c onst RenderStyle* childStyle, ItemPosition defaultPosition)
210 {
211 if (childStyle->justifySelf() == ItemPositionAuto)
212 return (parentStyle->justifyItems() == ItemPositionAuto) ? defaultPositi on : parentStyle->justifyItems();
213 return childStyle->justifySelf();
208 } 214 }
209 215
210 void RenderStyle::inheritFrom(const RenderStyle* inheritParent, IsAtShadowBounda ry isAtShadowBoundary) 216 void RenderStyle::inheritFrom(const RenderStyle* inheritParent, IsAtShadowBounda ry isAtShadowBoundary)
211 { 217 {
212 if (isAtShadowBoundary == AtShadowBoundary) { 218 if (isAtShadowBoundary == AtShadowBoundary) {
213 // Even if surrounding content is user-editable, shadow DOM should act a s a single unit, and not necessarily be editable 219 // Even if surrounding content is user-editable, shadow DOM should act a s a single unit, and not necessarily be editable
214 EUserModify currentUserModify = userModify(); 220 EUserModify currentUserModify = userModify();
215 rareInheritedData = inheritParent->rareInheritedData; 221 rareInheritedData = inheritParent->rareInheritedData;
216 setUserModify(currentUserModify); 222 setUserModify(currentUserModify);
217 } else 223 } else
(...skipping 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after
1755 horizontal || includeLogicalRightEdge); 1761 horizontal || includeLogicalRightEdge);
1756 1762
1757 edges[BSLeft] = BorderEdge(borderLeftWidth(), 1763 edges[BSLeft] = BorderEdge(borderLeftWidth(),
1758 visitedDependentColor(CSSPropertyBorderLeftColor), 1764 visitedDependentColor(CSSPropertyBorderLeftColor),
1759 borderLeftStyle(), 1765 borderLeftStyle(),
1760 borderLeftIsTransparent(), 1766 borderLeftIsTransparent(),
1761 !horizontal || includeLogicalLeftEdge); 1767 !horizontal || includeLogicalLeftEdge);
1762 } 1768 }
1763 1769
1764 } // namespace blink 1770 } // namespace blink
OLDNEW
« Source/core/rendering/style/RenderStyle.h ('K') | « Source/core/rendering/style/RenderStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698