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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp

Issue 2287113004: [css-grid] Implement fit-content track size (Closed)
Patch Set: Created 4 years, 3 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 * 3 *
4 * * Redistributions of source code must retain the above copyright 4 * * Redistributions of source code must retain the above copyright
5 * notice, this list of conditions and the following disclaimer. 5 * notice, this list of conditions and the following disclaimer.
6 * * Redistributions in binary form must reproduce the above 6 * * Redistributions in binary form must reproduce the above
7 * copyright notice, this list of conditions and the following disclaimer 7 * copyright notice, this list of conditions and the following disclaimer
8 * in the documentation and/or other materials provided with the 8 * in the documentation and/or other materials provided with the
9 * distribution. 9 * distribution.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 position.setExplicitPosition(gridLineNumber, gridLineName); 532 position.setExplicitPosition(gridLineNumber, gridLineName);
533 533
534 return position; 534 return position;
535 } 535 }
536 536
537 GridTrackSize StyleBuilderConverter::convertGridTrackSize(StyleResolverState& st ate, const CSSValue& value) 537 GridTrackSize StyleBuilderConverter::convertGridTrackSize(StyleResolverState& st ate, const CSSValue& value)
538 { 538 {
539 if (value.isPrimitiveValue()) 539 if (value.isPrimitiveValue())
540 return GridTrackSize(convertGridTrackBreadth(state, toCSSPrimitiveValue( value))); 540 return GridTrackSize(convertGridTrackBreadth(state, toCSSPrimitiveValue( value)));
541 541
542 const CSSFunctionValue& minmaxFunction = toCSSFunctionValue(value); 542 auto& function = toCSSFunctionValue(value);
543 ASSERT_WITH_SECURITY_IMPLICATION(minmaxFunction.length() == 2); 543 if (function.functionType() == CSSValueFitContent)
Manuel Rego 2016/08/31 07:24:29 Probably would be nice to add an assert to verify
svillar 2016/08/31 09:50:04 Acknowledged.
544 GridLength minTrackBreadth(convertGridTrackBreadth(state, toCSSPrimitiveValu e(minmaxFunction.item(0)))); 544 return GridTrackSize(convertGridTrackBreadth(state, toCSSPrimitiveValue( function.item(0))), FitContentTrackSizing);
545 GridLength maxTrackBreadth(convertGridTrackBreadth(state, toCSSPrimitiveValu e(minmaxFunction.item(1)))); 545
546 SECURITY_DCHECK(function.length() == 2);
547 GridLength minTrackBreadth(convertGridTrackBreadth(state, toCSSPrimitiveValu e(function.item(0))));
548 GridLength maxTrackBreadth(convertGridTrackBreadth(state, toCSSPrimitiveValu e(function.item(1))));
546 return GridTrackSize(minTrackBreadth, maxTrackBreadth); 549 return GridTrackSize(minTrackBreadth, maxTrackBreadth);
547 } 550 }
548 551
549 static void convertGridLineNamesList(const CSSValue& value, size_t currentNamedG ridLine, NamedGridLinesMap& namedGridLines, OrderedNamedGridLines& orderedNamedG ridLines) 552 static void convertGridLineNamesList(const CSSValue& value, size_t currentNamedG ridLine, NamedGridLinesMap& namedGridLines, OrderedNamedGridLines& orderedNamedG ridLines)
550 { 553 {
551 ASSERT(value.isGridLineNamesValue()); 554 ASSERT(value.isGridLineNamesValue());
552 555
553 for (auto& namedGridLineValue : toCSSValueList(value)) { 556 for (auto& namedGridLineValue : toCSSValueList(value)) {
554 String namedGridLine = toCSSCustomIdentValue(*namedGridLineValue).value( ); 557 String namedGridLine = toCSSCustomIdentValue(*namedGridLineValue).value( );
555 NamedGridLinesMap::AddResult result = namedGridLines.add(namedGridLine, Vector<size_t>()); 558 NamedGridLinesMap::AddResult result = namedGridLines.add(namedGridLine, Vector<size_t>());
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 1093
1091 PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat e& state, const CSSValue& value) 1094 PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat e& state, const CSSValue& value)
1092 { 1095 {
1093 if (value.isPathValue()) 1096 if (value.isPathValue())
1094 return toCSSPathValue(value).stylePath(); 1097 return toCSSPathValue(value).stylePath();
1095 ASSERT(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() = = CSSValueNone); 1098 ASSERT(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() = = CSSValueNone);
1096 return nullptr; 1099 return nullptr;
1097 } 1100 }
1098 1101
1099 } // namespace blink 1102 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698