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

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

Issue 2166393002: [css-grid] grid-auto-flow|row should take a <track-size>+ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing v2 Created 4 years, 4 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) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
7 * Copyright (C) 2015 Google Inc. All rights reserved. 7 * Copyright (C) 2015 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public 10 * modify it under the terms of the GNU Lesser General Public
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 { 811 {
812 if (collector.isEmpty()) 812 if (collector.isEmpty())
813 return; 813 return;
814 814
815 CSSGridLineNamesValue* lineNames = CSSGridLineNamesValue::create(); 815 CSSGridLineNamesValue* lineNames = CSSGridLineNamesValue::create();
816 collector.collectLineNamesForIndex(*lineNames, i); 816 collector.collectLineNamesForIndex(*lineNames, i);
817 if (lineNames->length()) 817 if (lineNames->length())
818 list.append(*lineNames); 818 list.append(*lineNames);
819 } 819 }
820 820
821 static CSSValue* valueForGridTrackSizeList(GridTrackSizingDirection direction, c onst ComputedStyle& style)
822 {
823 const Vector<GridTrackSize>& autoTrackSizes = direction == ForColumns ? styl e.gridAutoColumns() : style.gridAutoRows();
824
825 CSSValueList* list = CSSValueList::createSpaceSeparated();
826 for (auto& trackSize : autoTrackSizes)
827 list->append(*specifiedValueForGridTrackSize(trackSize, style));
828 return list;
829 }
830
821 static CSSValue* valueForGridTrackList(GridTrackSizingDirection direction, const LayoutObject* layoutObject, const ComputedStyle& style) 831 static CSSValue* valueForGridTrackList(GridTrackSizingDirection direction, const LayoutObject* layoutObject, const ComputedStyle& style)
822 { 832 {
823 bool isRowAxis = direction == ForColumns; 833 bool isRowAxis = direction == ForColumns;
824 const Vector<GridTrackSize>& trackSizes = isRowAxis ? style.gridTemplateColu mns() : style.gridTemplateRows(); 834 const Vector<GridTrackSize>& trackSizes = isRowAxis ? style.gridTemplateColu mns() : style.gridTemplateRows();
825 const Vector<GridTrackSize>& autoRepeatTrackSizes = isRowAxis ? style.gridAu toRepeatColumns() : style.gridAutoRepeatRows(); 835 const Vector<GridTrackSize>& autoRepeatTrackSizes = isRowAxis ? style.gridAu toRepeatColumns() : style.gridAutoRepeatRows();
826 bool isLayoutGrid = layoutObject && layoutObject->isLayoutGrid(); 836 bool isLayoutGrid = layoutObject && layoutObject->isLayoutGrid();
827 837
828 // Handle the 'none' case. 838 // Handle the 'none' case.
829 bool trackListIsEmpty = trackSizes.isEmpty() && autoRepeatTrackSizes.isEmpty (); 839 bool trackListIsEmpty = trackSizes.isEmpty() && autoRepeatTrackSizes.isEmpty ();
830 if (isLayoutGrid && trackListIsEmpty) { 840 if (isLayoutGrid && trackListIsEmpty) {
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1960 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueDense)); 1970 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueDense));
1961 break; 1971 break;
1962 default: 1972 default:
1963 // Do nothing. 1973 // Do nothing.
1964 break; 1974 break;
1965 } 1975 }
1966 1976
1967 return list; 1977 return list;
1968 } 1978 }
1969 // Specs mention that getComputedStyle() should return the used value of the property instead of the computed 1979 // Specs mention that getComputedStyle() should return the used value of the property instead of the computed
1970 // one for grid-definition-{rows|columns} but not for the grid-auto-{rows|co lumns} as things like 1980 // one for grid-template-{rows|columns} but not for the grid-auto-{rows|colu mns} as things like
1971 // grid-auto-columns: 2fr; cannot be resolved to a value in pixels as the '2 fr' means very different things 1981 // grid-auto-columns: 2fr; cannot be resolved to a value in pixels as the '2 fr' means very different things
1972 // depending on the size of the explicit grid or the number of implicit trac ks added to the grid. See 1982 // depending on the size of the explicit grid or the number of implicit trac ks added to the grid. See
1973 // http://lists.w3.org/Archives/Public/www-style/2013Nov/0014.html 1983 // http://lists.w3.org/Archives/Public/www-style/2013Nov/0014.html
1974 case CSSPropertyGridAutoColumns: 1984 case CSSPropertyGridAutoColumns:
1975 return specifiedValueForGridTrackSize(style.gridAutoColumns(), style); 1985 return valueForGridTrackSizeList(ForColumns, style);
1976 case CSSPropertyGridAutoRows: 1986 case CSSPropertyGridAutoRows:
1977 return specifiedValueForGridTrackSize(style.gridAutoRows(), style); 1987 return valueForGridTrackSizeList(ForRows, style);
1978 1988
1979 case CSSPropertyGridTemplateColumns: 1989 case CSSPropertyGridTemplateColumns:
1980 return valueForGridTrackList(ForColumns, layoutObject, style); 1990 return valueForGridTrackList(ForColumns, layoutObject, style);
1981 case CSSPropertyGridTemplateRows: 1991 case CSSPropertyGridTemplateRows:
1982 return valueForGridTrackList(ForRows, layoutObject, style); 1992 return valueForGridTrackList(ForRows, layoutObject, style);
1983 1993
1984 case CSSPropertyGridColumnStart: 1994 case CSSPropertyGridColumnStart:
1985 return valueForGridPosition(style.gridColumnStart()); 1995 return valueForGridPosition(style.gridColumnStart());
1986 case CSSPropertyGridColumnEnd: 1996 case CSSPropertyGridColumnEnd:
1987 return valueForGridPosition(style.gridColumnEnd()); 1997 return valueForGridPosition(style.gridColumnEnd());
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
3006 case CSSPropertyAll: 3016 case CSSPropertyAll:
3007 return nullptr; 3017 return nullptr;
3008 default: 3018 default:
3009 break; 3019 break;
3010 } 3020 }
3011 ASSERT_NOT_REACHED(); 3021 ASSERT_NOT_REACHED();
3012 return nullptr; 3022 return nullptr;
3013 } 3023 }
3014 3024
3015 } // namespace blink 3025 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSProperties.in ('k') | third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698