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

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

Issue 333563003: [CSS Grid Layout] Update grid-auto-flow to the new syntax (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: New version 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
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 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after
1384 break; 1384 break;
1385 default: 1385 default:
1386 break; 1386 break;
1387 } 1387 }
1388 } else { 1388 } else {
1389 svgStyle->setBaselineShift(BS_LENGTH); 1389 svgStyle->setBaselineShift(BS_LENGTH);
1390 svgStyle->setBaselineShiftValue(SVGLength::fromCSSPrimitiveValue(primiti veValue)); 1390 svgStyle->setBaselineShiftValue(SVGLength::fromCSSPrimitiveValue(primiti veValue));
1391 } 1391 }
1392 } 1392 }
1393 1393
1394 void StyleBuilderFunctions::applyValueCSSPropertyGridAutoFlow(StyleResolverState & state, CSSValue* value)
1395 {
1396 ASSERT(value->isValueList());
1397 CSSValueList* list = toCSSValueList(value);
1398
1399 CSSPrimitiveValue* first = list->length() >= 1 ? toCSSPrimitiveValue(list->i tem(0)) : nullptr;
1400
1401 if (!first) {
1402 applyInitialCSSPropertyGridAutoFlow(state);
1403 return;
1404 }
1405
1406 CSSPrimitiveValue* second = list->length() == 2 ? toCSSPrimitiveValue(list-> item(1)) : nullptr;
1407
1408 GridAutoFlow autoFlow = RenderStyle::initialGridAutoFlow();
1409 switch (first->getValueID()) {
1410 case CSSValueRow:
1411 if (second) {
1412 if (second->getValueID() == CSSValueDense)
1413 autoFlow = AutoFlowRowDense;
1414 else
1415 autoFlow = AutoFlowStackRow;
1416 } else {
1417 autoFlow = AutoFlowRow;
1418 }
1419 break;
1420 case CSSValueColumn:
1421 if (second) {
1422 if (second->getValueID() == CSSValueDense)
1423 autoFlow = AutoFlowColumnDense;
1424 else
1425 autoFlow = AutoFlowStackColumn;
1426 } else {
1427 autoFlow = AutoFlowColumn;
1428 }
1429 break;
1430 case CSSValueDense:
1431 if (second && second->getValueID() == CSSValueColumn)
1432 autoFlow = AutoFlowColumnDense;
1433 else
1434 autoFlow = AutoFlowRowDense;
1435 break;
1436 case CSSValueStack:
1437 if (second && second->getValueID() == CSSValueColumn)
1438 autoFlow = AutoFlowStackColumn;
1439 else
1440 autoFlow = AutoFlowStackRow;
1441 break;
1442 default:
1443 ASSERT_NOT_REACHED();
1444 break;
1445 }
1446
1447 state.style()->setGridAutoFlow(autoFlow);
1448 }
1449
1394 } // namespace WebCore 1450 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698