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

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

Issue 361113002: Properly managing overlfow-aligment for inherit and initial. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Applied suggested changes. Created 6 years, 5 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 | « Source/core/css/CSSProperties.in ('k') | Source/core/rendering/style/RenderStyle.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) 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 applyInheritCSSPropertyColor(state); 196 applyInheritCSSPropertyColor(state);
197 return; 197 return;
198 } 198 }
199 199
200 if (state.applyPropertyToRegularStyle()) 200 if (state.applyPropertyToRegularStyle())
201 state.style()->setColor(state.document().textLinkColors().colorFromPrimi tiveValue(primitiveValue, state.style()->color())); 201 state.style()->setColor(state.document().textLinkColors().colorFromPrimi tiveValue(primitiveValue, state.style()->color()));
202 if (state.applyPropertyToVisitedLinkStyle()) 202 if (state.applyPropertyToVisitedLinkStyle())
203 state.style()->setVisitedLinkColor(state.document().textLinkColors().col orFromPrimitiveValue(primitiveValue, state.style()->color(), true)); 203 state.style()->setVisitedLinkColor(state.document().textLinkColors().col orFromPrimitiveValue(primitiveValue, state.style()->color(), true));
204 } 204 }
205 205
206 void StyleBuilderFunctions::applyInitialCSSPropertyJustifyItems(StyleResolverSta te& state)
207 {
208 state.style()->setJustifyItems(RenderStyle::initialJustifyItems());
209 state.style()->setJustifyItemsOverflowAlignment(RenderStyle::initialJustifyI temsOverflowAlignment());
210 state.style()->setJustifyItemsPositionType(RenderStyle::initialJustifyItemsP ositionType());
211 }
212
213 void StyleBuilderFunctions::applyInheritCSSPropertyJustifyItems(StyleResolverSta te& state)
214 {
215 state.style()->setJustifyItems(state.parentStyle()->justifyItems());
216 state.style()->setJustifyItemsOverflowAlignment(state.parentStyle()->justify ItemsOverflowAlignment());
217 state.style()->setJustifyItemsPositionType(state.parentStyle()->justifyItems PositionType());
218 }
219
220 void StyleBuilderFunctions::applyValueCSSPropertyJustifyItems(StyleResolverState & state, CSSValue* value)
221 {
222
223 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
224 if (Pair* pairValue = primitiveValue->getPairValue()) {
225 if (pairValue->first()->getValueID() == CSSValueLegacy) {
226 state.style()->setJustifyItemsPositionType(LegacyPosition);
227 state.style()->setJustifyItems(*pairValue->second());
228 } else {
229 state.style()->setJustifyItems(*pairValue->first());
230 state.style()->setJustifyItemsOverflowAlignment(*pairValue->second() );
231 }
232 } else {
233 state.style()->setJustifyItems(*primitiveValue);
234 }
235 }
236
206 void StyleBuilderFunctions::applyInitialCSSPropertyCursor(StyleResolverState& st ate) 237 void StyleBuilderFunctions::applyInitialCSSPropertyCursor(StyleResolverState& st ate)
207 { 238 {
208 state.style()->clearCursorList(); 239 state.style()->clearCursorList();
209 state.style()->setCursor(RenderStyle::initialCursor()); 240 state.style()->setCursor(RenderStyle::initialCursor());
210 } 241 }
211 242
212 void StyleBuilderFunctions::applyInheritCSSPropertyCursor(StyleResolverState& st ate) 243 void StyleBuilderFunctions::applyInheritCSSPropertyCursor(StyleResolverState& st ate)
213 { 244 {
214 state.style()->setCursor(state.parentStyle()->cursor()); 245 state.style()->setCursor(state.parentStyle()->cursor());
215 state.style()->setCursorList(state.parentStyle()->cursors()); 246 state.style()->setCursorList(state.parentStyle()->cursors());
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 break; 1481 break;
1451 default: 1482 default:
1452 ASSERT_NOT_REACHED(); 1483 ASSERT_NOT_REACHED();
1453 break; 1484 break;
1454 } 1485 }
1455 1486
1456 state.style()->setGridAutoFlow(autoFlow); 1487 state.style()->setGridAutoFlow(autoFlow);
1457 } 1488 }
1458 1489
1459 } // namespace WebCore 1490 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/CSSProperties.in ('k') | Source/core/rendering/style/RenderStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698