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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 1583433002: [css-align] New CSS Value 'normal' for Content Alignment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed layout tests failing. Created 4 years, 10 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 return alignSelf(); 216 return alignSelf();
217 } 217 }
218 218
219 ItemPosition ComputedStyle::resolveJustification(const ComputedStyle& parentStyl e, const ComputedStyle& childStyle, ItemPosition resolvedAutoPositionForLayoutOb ject) 219 ItemPosition ComputedStyle::resolveJustification(const ComputedStyle& parentStyl e, const ComputedStyle& childStyle, ItemPosition resolvedAutoPositionForLayoutOb ject)
220 { 220 {
221 if (childStyle.justifySelfPosition() == ItemPositionAuto) 221 if (childStyle.justifySelfPosition() == ItemPositionAuto)
222 return (parentStyle.justifyItemsPosition() == ItemPositionAuto) ? resolv edAutoPositionForLayoutObject : parentStyle.justifyItemsPosition(); 222 return (parentStyle.justifyItemsPosition() == ItemPositionAuto) ? resolv edAutoPositionForLayoutObject : parentStyle.justifyItemsPosition();
223 return childStyle.justifySelfPosition(); 223 return childStyle.justifySelfPosition();
224 } 224 }
225 225
226 static inline ContentPosition resolvedContentAlignmentPosition(const StyleConten tAlignmentData& value, const StyleContentAlignmentData& normalValueBehavior)
227 {
228 return (value.position() == ContentPositionNormal && value.distribution() == ContentDistributionDefault) ? normalValueBehavior.position() : value.position() ;
229 }
230
231 static inline ContentDistributionType resolvedContentAlignmentDistribution(const StyleContentAlignmentData& value, const StyleContentAlignmentData& normalValueB ehavior)
232 {
233 return (value.position() == ContentPositionNormal && value.distribution() == ContentDistributionDefault) ? normalValueBehavior.distribution() : value.distri bution();
234 }
235
236 ContentPosition ComputedStyle::resolvedJustifyContentPosition(const StyleContent AlignmentData& normalValueBehavior) const
237 {
238 return resolvedContentAlignmentPosition(justifyContent(), normalValueBehavio r);
239 }
240
241 ContentDistributionType ComputedStyle::resolvedJustifyContentDistribution(const StyleContentAlignmentData& normalValueBehavior) const
242 {
243 return resolvedContentAlignmentDistribution(justifyContent(), normalValueBeh avior);
244 }
245
246 ContentPosition ComputedStyle::resolvedAlignContentPosition(const StyleContentAl ignmentData& normalValueBehavior) const
247 {
248 return resolvedContentAlignmentPosition(alignContent(), normalValueBehavior) ;
249 }
250
251 ContentDistributionType ComputedStyle::resolvedAlignContentDistribution(const St yleContentAlignmentData& normalValueBehavior) const
252 {
253 return resolvedContentAlignmentDistribution(alignContent(), normalValueBehav ior);
254 }
255
226 void ComputedStyle::inheritFrom(const ComputedStyle& inheritParent, IsAtShadowBo undary isAtShadowBoundary) 256 void ComputedStyle::inheritFrom(const ComputedStyle& inheritParent, IsAtShadowBo undary isAtShadowBoundary)
227 { 257 {
228 if (isAtShadowBoundary == AtShadowBoundary) { 258 if (isAtShadowBoundary == AtShadowBoundary) {
229 // Even if surrounding content is user-editable, shadow DOM should act a s a single unit, and not necessarily be editable 259 // Even if surrounding content is user-editable, shadow DOM should act a s a single unit, and not necessarily be editable
230 EUserModify currentUserModify = userModify(); 260 EUserModify currentUserModify = userModify();
231 rareInheritedData = inheritParent.rareInheritedData; 261 rareInheritedData = inheritParent.rareInheritedData;
232 setUserModify(currentUserModify); 262 setUserModify(currentUserModify);
233 } else { 263 } else {
234 rareInheritedData = inheritParent.rareInheritedData; 264 rareInheritedData = inheritParent.rareInheritedData;
235 } 265 }
(...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after
1844 if (!shadowList) 1874 if (!shadowList)
1845 return false; 1875 return false;
1846 for (size_t i = shadowList->shadows().size(); i--; ) { 1876 for (size_t i = shadowList->shadows().size(); i--; ) {
1847 if (shadowList->shadows()[i].color().isCurrentColor()) 1877 if (shadowList->shadows()[i].color().isCurrentColor())
1848 return true; 1878 return true;
1849 } 1879 }
1850 return false; 1880 return false;
1851 } 1881 }
1852 1882
1853 } // namespace blink 1883 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | third_party/WebKit/Source/core/style/ComputedStyleConstants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698