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

Side by Side Diff: Source/core/css/resolver/StyleBuilderCustom.cpp

Issue 636993002: [CSS Grid Layout] Upgrade justify-content parsing to CSS3 Box Alignment spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebaseline some tests expectations. Created 6 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
« no previous file with comments | « Source/core/css/resolver/StyleAdjuster.cpp ('k') | Source/core/rendering/RenderFlexibleBox.cpp » ('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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
(...skipping 25 matching lines...) Expand all
36 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 */ 37 */
38 38
39 #include "config.h" 39 #include "config.h"
40 40
41 #include "core/CSSPropertyNames.h" 41 #include "core/CSSPropertyNames.h"
42 #include "core/CSSValueKeywords.h" 42 #include "core/CSSValueKeywords.h"
43 #include "core/StyleBuilderFunctions.h" 43 #include "core/StyleBuilderFunctions.h"
44 #include "core/StylePropertyShorthand.h" 44 #include "core/StylePropertyShorthand.h"
45 #include "core/css/BasicShapeFunctions.h" 45 #include "core/css/BasicShapeFunctions.h"
46 #include "core/css/CSSContentDistributionValue.h"
46 #include "core/css/CSSCursorImageValue.h" 47 #include "core/css/CSSCursorImageValue.h"
47 #include "core/css/CSSFontValue.h" 48 #include "core/css/CSSFontValue.h"
48 #include "core/css/CSSGradientValue.h" 49 #include "core/css/CSSGradientValue.h"
49 #include "core/css/CSSGridTemplateAreasValue.h" 50 #include "core/css/CSSGridTemplateAreasValue.h"
50 #include "core/css/CSSHelper.h" 51 #include "core/css/CSSHelper.h"
51 #include "core/css/CSSImageSetValue.h" 52 #include "core/css/CSSImageSetValue.h"
52 #include "core/css/CSSLineBoxContainValue.h" 53 #include "core/css/CSSLineBoxContainValue.h"
53 #include "core/css/CSSPrimitiveValueMappings.h" 54 #include "core/css/CSSPrimitiveValueMappings.h"
54 #include "core/css/CSSPropertyMetadata.h" 55 #include "core/css/CSSPropertyMetadata.h"
55 #include "core/css/Counter.h" 56 #include "core/css/Counter.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 state.style()->setJustifyItems(*pairValue->second()); 182 state.style()->setJustifyItems(*pairValue->second());
182 } else { 183 } else {
183 state.style()->setJustifyItems(*pairValue->first()); 184 state.style()->setJustifyItems(*pairValue->first());
184 state.style()->setJustifyItemsOverflowAlignment(*pairValue->second() ); 185 state.style()->setJustifyItemsOverflowAlignment(*pairValue->second() );
185 } 186 }
186 } else { 187 } else {
187 state.style()->setJustifyItems(*primitiveValue); 188 state.style()->setJustifyItems(*primitiveValue);
188 } 189 }
189 } 190 }
190 191
192 void StyleBuilderFunctions::applyInitialCSSPropertyJustifyContent(StyleResolverS tate& state)
193 {
194 state.style()->setJustifyContent(RenderStyle::initialJustifyContent());
195 state.style()->setJustifyContentOverflowAlignment(RenderStyle::initialJustif yContentOverflowAlignment());
196 state.style()->setJustifyContentDistribution(RenderStyle::initialJustifyCont entDistribution());
197 }
198
199 void StyleBuilderFunctions::applyInheritCSSPropertyJustifyContent(StyleResolverS tate& state)
200 {
201 state.style()->setJustifyContent(state.parentStyle()->justifyContent());
202 state.style()->setJustifyContentOverflowAlignment(state.parentStyle()->justi fyContentOverflowAlignment());
203 state.style()->setJustifyContentDistribution(state.parentStyle()->justifyCon tentDistribution());
204 }
205
206 void StyleBuilderFunctions::applyValueCSSPropertyJustifyContent(StyleResolverSta te& state, CSSValue* value)
207 {
208 CSSContentDistributionValue* contentValue = toCSSContentDistributionValue(va lue);
209 if (contentValue->distribution()->getValueID() != CSSValueInvalid)
210 state.style()->setJustifyContentDistribution(*contentValue->distribution ());
211 if (contentValue->position()->getValueID() != CSSValueInvalid)
212 state.style()->setJustifyContent(*contentValue->position());
213 if (contentValue->overflow()->getValueID() != CSSValueInvalid)
214 state.style()->setJustifyContentOverflowAlignment(*contentValue->overflo w());
215 }
216
191 void StyleBuilderFunctions::applyInitialCSSPropertyCursor(StyleResolverState& st ate) 217 void StyleBuilderFunctions::applyInitialCSSPropertyCursor(StyleResolverState& st ate)
192 { 218 {
193 state.style()->clearCursorList(); 219 state.style()->clearCursorList();
194 state.style()->setCursor(RenderStyle::initialCursor()); 220 state.style()->setCursor(RenderStyle::initialCursor());
195 } 221 }
196 222
197 void StyleBuilderFunctions::applyInheritCSSPropertyCursor(StyleResolverState& st ate) 223 void StyleBuilderFunctions::applyInheritCSSPropertyCursor(StyleResolverState& st ate)
198 { 224 {
199 state.style()->setCursor(state.parentStyle()->cursor()); 225 state.style()->setCursor(state.parentStyle()->cursor());
200 state.style()->setCursorList(state.parentStyle()->cursors()); 226 state.style()->setCursorList(state.parentStyle()->cursors());
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 return; 965 return;
940 case CSSValueSuper: 966 case CSSValueSuper:
941 svgStyle.setBaselineShift(BS_SUPER); 967 svgStyle.setBaselineShift(BS_SUPER);
942 return; 968 return;
943 default: 969 default:
944 ASSERT_NOT_REACHED(); 970 ASSERT_NOT_REACHED();
945 } 971 }
946 } 972 }
947 973
948 } // namespace blink 974 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleAdjuster.cpp ('k') | Source/core/rendering/RenderFlexibleBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698