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

Side by Side Diff: Source/core/css/CSSComputedStyleDeclaration.cpp

Issue 146773002: [CSS Grid Layout] Rename grid-definition-{columns|rows} to match the new syntax (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed renaming issues with some tests. Created 6 years, 10 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 | « PerformanceTests/Layout/fixed-grid-lots-of-data.html ('k') | Source/core/css/CSSProperty.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) 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 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 CSSPropertyFlexDirection, 263 CSSPropertyFlexDirection,
264 CSSPropertyFlexWrap, 264 CSSPropertyFlexWrap,
265 CSSPropertyJustifyContent, 265 CSSPropertyJustifyContent,
266 CSSPropertyWebkitFontSmoothing, 266 CSSPropertyWebkitFontSmoothing,
267 CSSPropertyWebkitFontVariantLigatures, 267 CSSPropertyWebkitFontVariantLigatures,
268 CSSPropertyGridAutoColumns, 268 CSSPropertyGridAutoColumns,
269 CSSPropertyGridAutoFlow, 269 CSSPropertyGridAutoFlow,
270 CSSPropertyGridAutoRows, 270 CSSPropertyGridAutoRows,
271 CSSPropertyGridColumnEnd, 271 CSSPropertyGridColumnEnd,
272 CSSPropertyGridColumnStart, 272 CSSPropertyGridColumnStart,
273 CSSPropertyGridDefinitionColumns, 273 CSSPropertyGridTemplateColumns,
274 CSSPropertyGridDefinitionRows, 274 CSSPropertyGridTemplateRows,
275 CSSPropertyGridRowEnd, 275 CSSPropertyGridRowEnd,
276 CSSPropertyGridRowStart, 276 CSSPropertyGridRowStart,
277 CSSPropertyWebkitHighlight, 277 CSSPropertyWebkitHighlight,
278 CSSPropertyWebkitHyphenateCharacter, 278 CSSPropertyWebkitHyphenateCharacter,
279 CSSPropertyWebkitLineAlign, 279 CSSPropertyWebkitLineAlign,
280 CSSPropertyWebkitLineBoxContain, 280 CSSPropertyWebkitLineBoxContain,
281 CSSPropertyWebkitLineBreak, 281 CSSPropertyWebkitLineBreak,
282 CSSPropertyWebkitLineClamp, 282 CSSPropertyWebkitLineClamp,
283 CSSPropertyWebkitLineGrid, 283 CSSPropertyWebkitLineGrid,
284 CSSPropertyWebkitLineSnap, 284 CSSPropertyWebkitLineSnap,
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 return; 887 return;
888 888
889 RefPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue::create(); 889 RefPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue::create();
890 for (size_t j = 0; j < namedGridLines.size(); ++j) 890 for (size_t j = 0; j < namedGridLines.size(); ++j)
891 lineNames->append(cssValuePool().createValue(namedGridLines[j], CSSPrimi tiveValue::CSS_STRING)); 891 lineNames->append(cssValuePool().createValue(namedGridLines[j], CSSPrimi tiveValue::CSS_STRING));
892 list.append(lineNames.release()); 892 list.append(lineNames.release());
893 } 893 }
894 894
895 static PassRefPtr<CSSValue> valueForGridTrackList(GridTrackSizingDirection direc tion, RenderObject* renderer, const RenderStyle& style) 895 static PassRefPtr<CSSValue> valueForGridTrackList(GridTrackSizingDirection direc tion, RenderObject* renderer, const RenderStyle& style)
896 { 896 {
897 const Vector<GridTrackSize>& trackSizes = direction == ForColumns ? style.gr idDefinitionColumns() : style.gridDefinitionRows(); 897 const Vector<GridTrackSize>& trackSizes = direction == ForColumns ? style.gr idTemplateColumns() : style.gridTemplateRows();
898 const OrderedNamedGridLines& orderedNamedGridLines = direction == ForColumns ? style.orderedNamedGridColumnLines() : style.orderedNamedGridRowLines(); 898 const OrderedNamedGridLines& orderedNamedGridLines = direction == ForColumns ? style.orderedNamedGridColumnLines() : style.orderedNamedGridRowLines();
899 899
900 // Handle the 'none' case here. 900 // Handle the 'none' case here.
901 if (!trackSizes.size()) { 901 if (!trackSizes.size()) {
902 ASSERT(orderedNamedGridLines.isEmpty()); 902 ASSERT(orderedNamedGridLines.isEmpty());
903 return cssValuePool().createIdentifierValue(CSSValueNone); 903 return cssValuePool().createIdentifierValue(CSSValueNone);
904 } 904 }
905 905
906 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 906 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
907 if (renderer && renderer->isRenderGrid()) { 907 if (renderer && renderer->isRenderGrid()) {
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
1447 1447
1448 static bool isLayoutDependent(CSSPropertyID propertyID, PassRefPtr<RenderStyle> style, RenderObject* renderer) 1448 static bool isLayoutDependent(CSSPropertyID propertyID, PassRefPtr<RenderStyle> style, RenderObject* renderer)
1449 { 1449 {
1450 // Some properties only depend on layout in certain conditions which 1450 // Some properties only depend on layout in certain conditions which
1451 // are specified in the main switch statement below. So we can avoid 1451 // are specified in the main switch statement below. So we can avoid
1452 // forcing layout in those conditions. The conditions in this switch 1452 // forcing layout in those conditions. The conditions in this switch
1453 // statement must remain in sync with the conditions in the main switch. 1453 // statement must remain in sync with the conditions in the main switch.
1454 // FIXME: Some of these cases could be narrowed down or optimized better. 1454 // FIXME: Some of these cases could be narrowed down or optimized better.
1455 switch (propertyID) { 1455 switch (propertyID) {
1456 case CSSPropertyBottom: 1456 case CSSPropertyBottom:
1457 case CSSPropertyGridDefinitionColumns: 1457 case CSSPropertyGridTemplateColumns:
1458 case CSSPropertyGridDefinitionRows: 1458 case CSSPropertyGridTemplateRows:
1459 case CSSPropertyHeight: 1459 case CSSPropertyHeight:
1460 case CSSPropertyLeft: 1460 case CSSPropertyLeft:
1461 case CSSPropertyRight: 1461 case CSSPropertyRight:
1462 case CSSPropertyTop: 1462 case CSSPropertyTop:
1463 case CSSPropertyWebkitPerspectiveOrigin: 1463 case CSSPropertyWebkitPerspectiveOrigin:
1464 case CSSPropertyWebkitTransform: 1464 case CSSPropertyWebkitTransform:
1465 case CSSPropertyWebkitTransformOrigin: 1465 case CSSPropertyWebkitTransformOrigin:
1466 case CSSPropertyWidth: 1466 case CSSPropertyWidth:
1467 case CSSPropertyWebkitFilter: 1467 case CSSPropertyWebkitFilter:
1468 return true; 1468 return true;
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
1941 // Specs mention that getComputedStyle() should return the used value of the property instead of the computed 1941 // Specs mention that getComputedStyle() should return the used value of the property instead of the computed
1942 // one for grid-definition-{rows|columns} but not for the grid-auto-{row s|columns} as things like 1942 // one for grid-definition-{rows|columns} but not for the grid-auto-{row s|columns} as things like
1943 // grid-auto-columns: 2fr; cannot be resolved to a value in pixels as th e '2fr' means very different things 1943 // grid-auto-columns: 2fr; cannot be resolved to a value in pixels as th e '2fr' means very different things
1944 // depending on the size of the explicit grid or the number of implicit tracks added to the grid. See 1944 // depending on the size of the explicit grid or the number of implicit tracks added to the grid. See
1945 // http://lists.w3.org/Archives/Public/www-style/2013Nov/0014.html 1945 // http://lists.w3.org/Archives/Public/www-style/2013Nov/0014.html
1946 case CSSPropertyGridAutoColumns: 1946 case CSSPropertyGridAutoColumns:
1947 return specifiedValueForGridTrackSize(style->gridAutoColumns(), *sty le); 1947 return specifiedValueForGridTrackSize(style->gridAutoColumns(), *sty le);
1948 case CSSPropertyGridAutoRows: 1948 case CSSPropertyGridAutoRows:
1949 return specifiedValueForGridTrackSize(style->gridAutoRows(), *style) ; 1949 return specifiedValueForGridTrackSize(style->gridAutoRows(), *style) ;
1950 1950
1951 case CSSPropertyGridDefinitionColumns: 1951 case CSSPropertyGridTemplateColumns:
1952 return valueForGridTrackList(ForColumns, renderer, *style); 1952 return valueForGridTrackList(ForColumns, renderer, *style);
1953 case CSSPropertyGridDefinitionRows: 1953 case CSSPropertyGridTemplateRows:
1954 return valueForGridTrackList(ForRows, renderer, *style); 1954 return valueForGridTrackList(ForRows, renderer, *style);
1955 1955
1956 case CSSPropertyGridColumnStart: 1956 case CSSPropertyGridColumnStart:
1957 return valueForGridPosition(style->gridColumnStart()); 1957 return valueForGridPosition(style->gridColumnStart());
1958 case CSSPropertyGridColumnEnd: 1958 case CSSPropertyGridColumnEnd:
1959 return valueForGridPosition(style->gridColumnEnd()); 1959 return valueForGridPosition(style->gridColumnEnd());
1960 case CSSPropertyGridRowStart: 1960 case CSSPropertyGridRowStart:
1961 return valueForGridPosition(style->gridRowStart()); 1961 return valueForGridPosition(style->gridRowStart());
1962 case CSSPropertyGridRowEnd: 1962 case CSSPropertyGridRowEnd:
1963 return valueForGridPosition(style->gridRowEnd()); 1963 return valueForGridPosition(style->gridRowEnd());
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after
3146 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, 3146 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin,
3147 CSSPropertyB ackgroundClip }; 3147 CSSPropertyB ackgroundClip };
3148 3148
3149 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); 3149 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
3150 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator)))); 3150 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator))));
3151 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator)))); 3151 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator))));
3152 return list.release(); 3152 return list.release();
3153 } 3153 }
3154 3154
3155 } // namespace WebCore 3155 } // namespace WebCore
OLDNEW
« no previous file with comments | « PerformanceTests/Layout/fixed-grid-lots-of-data.html ('k') | Source/core/css/CSSProperty.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698