Chromium Code Reviews

Side by Side Diff: Source/core/css/CSSComputedStyleDeclaration.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: Small fix in add/removeChild to avoid dirtying the grid in stack Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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 1942 matching lines...)
1953 if (!featureSettings || !featureSettings->size()) 1953 if (!featureSettings || !featureSettings->size())
1954 return cssValuePool().createIdentifierValue(CSSValueNormal); 1954 return cssValuePool().createIdentifierValue(CSSValueNormal);
1955 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSep arated(); 1955 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSep arated();
1956 for (unsigned i = 0; i < featureSettings->size(); ++i) { 1956 for (unsigned i = 0; i < featureSettings->size(); ++i) {
1957 const FontFeature& feature = featureSettings->at(i); 1957 const FontFeature& feature = featureSettings->at(i);
1958 RefPtrWillBeRawPtr<CSSFontFeatureValue> featureValue = CSSFontFe atureValue::create(feature.tag(), feature.value()); 1958 RefPtrWillBeRawPtr<CSSFontFeatureValue> featureValue = CSSFontFe atureValue::create(feature.tag(), feature.value());
1959 list->append(featureValue.release()); 1959 list->append(featureValue.release());
1960 } 1960 }
1961 return list.release(); 1961 return list.release();
1962 } 1962 }
1963 case CSSPropertyGridAutoFlow: 1963 case CSSPropertyGridAutoFlow: {
1964 return cssValuePool().createValue(style->gridAutoFlow()); 1964 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSep arated();
1965 switch (style->gridAutoFlow()) {
1966 case AutoFlowRow:
1967 case AutoFlowRowDense:
1968 list->append(cssValuePool().createIdentifierValue(CSSValueRow));
1969 break;
1970 case AutoFlowColumn:
1971 case AutoFlowColumnDense:
1972 list->append(cssValuePool().createIdentifierValue(CSSValueColumn ));
1973 break;
1974 case AutoFlowStackRow:
1975 case AutoFlowStackColumn:
1976 list->append(cssValuePool().createIdentifierValue(CSSValueStack) );
1977 break;
1978 default:
1979 ASSERT_NOT_REACHED();
1980 }
1965 1981
1982 switch (style->gridAutoFlow()) {
1983 case AutoFlowRowDense:
1984 case AutoFlowColumnDense:
1985 list->append(cssValuePool().createIdentifierValue(CSSValueDense) );
1986 break;
1987 case AutoFlowStackRow:
1988 list->append(cssValuePool().createIdentifierValue(CSSValueRow));
1989 break;
1990 case AutoFlowStackColumn:
1991 list->append(cssValuePool().createIdentifierValue(CSSValueColumn ));
1992 break;
1993 default:
1994 // Do nothing.
1995 break;
1996 }
1997
1998 return list.release();
1999 }
1966 // Specs mention that getComputedStyle() should return the used value of the property instead of the computed 2000 // Specs mention that getComputedStyle() should return the used value of the property instead of the computed
1967 // one for grid-definition-{rows|columns} but not for the grid-auto-{row s|columns} as things like 2001 // one for grid-definition-{rows|columns} but not for the grid-auto-{row s|columns} as things like
1968 // grid-auto-columns: 2fr; cannot be resolved to a value in pixels as th e '2fr' means very different things 2002 // grid-auto-columns: 2fr; cannot be resolved to a value in pixels as th e '2fr' means very different things
1969 // depending on the size of the explicit grid or the number of implicit tracks added to the grid. See 2003 // depending on the size of the explicit grid or the number of implicit tracks added to the grid. See
1970 // http://lists.w3.org/Archives/Public/www-style/2013Nov/0014.html 2004 // http://lists.w3.org/Archives/Public/www-style/2013Nov/0014.html
1971 case CSSPropertyGridAutoColumns: 2005 case CSSPropertyGridAutoColumns:
1972 return specifiedValueForGridTrackSize(style->gridAutoColumns(), *sty le); 2006 return specifiedValueForGridTrackSize(style->gridAutoColumns(), *sty le);
1973 case CSSPropertyGridAutoRows: 2007 case CSSPropertyGridAutoRows:
1974 return specifiedValueForGridTrackSize(style->gridAutoRows(), *style) ; 2008 return specifiedValueForGridTrackSize(style->gridAutoRows(), *style) ;
1975 2009
(...skipping 1086 matching lines...)
3062 return list.release(); 3096 return list.release();
3063 } 3097 }
3064 3098
3065 void CSSComputedStyleDeclaration::trace(Visitor* visitor) 3099 void CSSComputedStyleDeclaration::trace(Visitor* visitor)
3066 { 3100 {
3067 visitor->trace(m_node); 3101 visitor->trace(m_node);
3068 CSSStyleDeclaration::trace(visitor); 3102 CSSStyleDeclaration::trace(visitor);
3069 } 3103 }
3070 3104
3071 } // namespace WebCore 3105 } // namespace WebCore
OLDNEW

Powered by Google App Engine