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

Side by Side Diff: Source/core/css/CSSPrimitiveValue.h

Issue 636993002: [CSS Grid Layout] Upgrade justify-content parsing to CSS3 Box Alignment spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 bool isCalculatedPercentageWithNumber() const { return primitiveType() == CS S_CALC_PERCENTAGE_WITH_NUMBER; } 206 bool isCalculatedPercentageWithNumber() const { return primitiveType() == CS S_CALC_PERCENTAGE_WITH_NUMBER; }
207 bool isCalculatedPercentageWithLength() const { return primitiveType() == CS S_CALC_PERCENTAGE_WITH_LENGTH; } 207 bool isCalculatedPercentageWithLength() const { return primitiveType() == CS S_CALC_PERCENTAGE_WITH_LENGTH; }
208 static bool isDotsPerInch(UnitType type) { return type == CSS_DPI; } 208 static bool isDotsPerInch(UnitType type) { return type == CSS_DPI; }
209 static bool isDotsPerPixel(UnitType type) { return type == CSS_DPPX; } 209 static bool isDotsPerPixel(UnitType type) { return type == CSS_DPPX; }
210 static bool isDotsPerCentimeter(UnitType type) { return type == CSS_DPCM; } 210 static bool isDotsPerCentimeter(UnitType type) { return type == CSS_DPCM; }
211 static bool isResolution(UnitType type) { return type >= CSS_DPPX && type <= CSS_DPCM; } 211 static bool isResolution(UnitType type) { return type >= CSS_DPPX && type <= CSS_DPCM; }
212 bool isFlex() const { return primitiveType() == CSS_FR; } 212 bool isFlex() const { return primitiveType() == CSS_FR; }
213 bool isValueID() const { return m_primitiveUnitType == CSS_VALUE_ID; } 213 bool isValueID() const { return m_primitiveUnitType == CSS_VALUE_ID; }
214 bool colorIsDerivedFromElement() const; 214 bool colorIsDerivedFromElement() const;
215 215
216 static bool isContentDistributionKeyword(CSSValueID id)
217 {
218 return id == CSSValueSpaceBetween || id == CSSValueSpaceAround
219 || id == CSSValueSpaceEvenly || id == CSSValueStretch;
220 }
221
222 static bool isContentPositionKeyword(CSSValueID id)
223 {
224 return id == CSSValueStart || id == CSSValueEnd || id == CSSValueCenter
225 || id == CSSValueFlexStart || id == CSSValueFlexEnd
226 || id == CSSValueLeft || id == CSSValueRight;
227 }
228
216 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createIdentifier(CSSValueID valueID) 229 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createIdentifier(CSSValueID valueID)
217 { 230 {
218 return adoptRefWillBeNoop(new CSSPrimitiveValue(valueID)); 231 return adoptRefWillBeNoop(new CSSPrimitiveValue(valueID));
219 } 232 }
220 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createIdentifier(CSSPropert yID propertyID) 233 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createIdentifier(CSSPropert yID propertyID)
221 { 234 {
222 return adoptRefWillBeNoop(new CSSPrimitiveValue(propertyID)); 235 return adoptRefWillBeNoop(new CSSPrimitiveValue(propertyID));
223 } 236 }
224 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createColor(unsigned rgbVal ue) 237 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createColor(unsigned rgbVal ue)
225 { 238 {
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 } m_value; 415 } m_value;
403 }; 416 };
404 417
405 typedef CSSPrimitiveValue::CSSLengthArray CSSLengthArray; 418 typedef CSSPrimitiveValue::CSSLengthArray CSSLengthArray;
406 419
407 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); 420 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue());
408 421
409 } // namespace blink 422 } // namespace blink
410 423
411 #endif // CSSPrimitiveValue_h 424 #endif // CSSPrimitiveValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698