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

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

Issue 1186833003: Split up CSSPrimitiveValue::isString into isString and isCustomIdent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | Source/core/css/FontFace.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 * (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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 bool isAngle() const 163 bool isAngle() const
164 { 164 {
165 return m_primitiveUnitType == CSS_DEG 165 return m_primitiveUnitType == CSS_DEG
166 || m_primitiveUnitType == CSS_RAD 166 || m_primitiveUnitType == CSS_RAD
167 || m_primitiveUnitType == CSS_GRAD 167 || m_primitiveUnitType == CSS_GRAD
168 || m_primitiveUnitType == CSS_TURN; 168 || m_primitiveUnitType == CSS_TURN;
169 } 169 }
170 bool isAttr() const { return m_primitiveUnitType == CSS_ATTR; } 170 bool isAttr() const { return m_primitiveUnitType == CSS_ATTR; }
171 bool isCounter() const { return m_primitiveUnitType == CSS_COUNTER; } 171 bool isCounter() const { return m_primitiveUnitType == CSS_COUNTER; }
172 bool isCustomIdent() const { return m_primitiveUnitType == CSS_CUSTOM_IDENT; }
172 bool isFontRelativeLength() const 173 bool isFontRelativeLength() const
173 { 174 {
174 return m_primitiveUnitType == CSS_EMS 175 return m_primitiveUnitType == CSS_EMS
175 || m_primitiveUnitType == CSS_EXS 176 || m_primitiveUnitType == CSS_EXS
176 || m_primitiveUnitType == CSS_REMS 177 || m_primitiveUnitType == CSS_REMS
177 || m_primitiveUnitType == CSS_CHS; 178 || m_primitiveUnitType == CSS_CHS;
178 } 179 }
179 bool isViewportPercentageLength() const { return isViewportPercentageLength( static_cast<UnitType>(m_primitiveUnitType)); } 180 bool isViewportPercentageLength() const { return isViewportPercentageLength( static_cast<UnitType>(m_primitiveUnitType)); }
180 static bool isViewportPercentageLength(UnitType type) { return type >= CSS_V W && type <= CSS_VMAX; } 181 static bool isViewportPercentageLength(UnitType type) { return type >= CSS_V W && type <= CSS_VMAX; }
181 static bool isLength(UnitType type) 182 static bool isLength(UnitType type)
182 { 183 {
183 return (type >= CSS_EMS && type <= CSS_PC) || type == CSS_REMS || type = = CSS_CHS || isViewportPercentageLength(type); 184 return (type >= CSS_EMS && type <= CSS_PC) || type == CSS_REMS || type = = CSS_CHS || isViewportPercentageLength(type);
184 } 185 }
185 bool isLength() const { return isLength(primitiveType()); } 186 bool isLength() const { return isLength(primitiveType()); }
186 bool isNumber() const { return primitiveType() == CSS_NUMBER; } 187 bool isNumber() const { return primitiveType() == CSS_NUMBER; }
187 bool isPercentage() const { return primitiveType() == CSS_PERCENTAGE; } 188 bool isPercentage() const { return primitiveType() == CSS_PERCENTAGE; }
188 bool isPx() const { return primitiveType() == CSS_PX; } 189 bool isPx() const { return primitiveType() == CSS_PX; }
189 bool isRect() const { return m_primitiveUnitType == CSS_RECT; } 190 bool isRect() const { return m_primitiveUnitType == CSS_RECT; }
190 bool isRGBColor() const { return m_primitiveUnitType == CSS_RGBCOLOR; } 191 bool isRGBColor() const { return m_primitiveUnitType == CSS_RGBCOLOR; }
191 bool isShape() const { return m_primitiveUnitType == CSS_SHAPE; } 192 bool isShape() const { return m_primitiveUnitType == CSS_SHAPE; }
192 bool isString() const { return m_primitiveUnitType == CSS_CUSTOM_IDENT || m_ primitiveUnitType == CSS_STRING; } 193 bool isString() const { return m_primitiveUnitType == CSS_STRING; }
193 bool isTime() const { return m_primitiveUnitType == CSS_S || m_primitiveUnit Type == CSS_MS; } 194 bool isTime() const { return m_primitiveUnitType == CSS_S || m_primitiveUnit Type == CSS_MS; }
194 bool isURI() const { return m_primitiveUnitType == CSS_URI; } 195 bool isURI() const { return m_primitiveUnitType == CSS_URI; }
195 bool isCalculated() const { return m_primitiveUnitType == CSS_CALC; } 196 bool isCalculated() const { return m_primitiveUnitType == CSS_CALC; }
196 bool isCalculatedPercentageWithNumber() const { return primitiveType() == CS S_CALC_PERCENTAGE_WITH_NUMBER; } 197 bool isCalculatedPercentageWithNumber() const { return primitiveType() == CS S_CALC_PERCENTAGE_WITH_NUMBER; }
197 bool isCalculatedPercentageWithLength() const { return primitiveType() == CS S_CALC_PERCENTAGE_WITH_LENGTH; } 198 bool isCalculatedPercentageWithLength() const { return primitiveType() == CS S_CALC_PERCENTAGE_WITH_LENGTH; }
198 static bool isDotsPerInch(UnitType type) { return type == CSS_DPI; } 199 static bool isDotsPerInch(UnitType type) { return type == CSS_DPI; }
199 static bool isDotsPerPixel(UnitType type) { return type == CSS_DPPX; } 200 static bool isDotsPerPixel(UnitType type) { return type == CSS_DPPX; }
200 static bool isDotsPerCentimeter(UnitType type) { return type == CSS_DPCM; } 201 static bool isDotsPerCentimeter(UnitType type) { return type == CSS_DPCM; }
201 static bool isResolution(UnitType type) { return type >= CSS_DPPX && type <= CSS_DPCM; } 202 static bool isResolution(UnitType type) { return type >= CSS_DPPX && type <= CSS_DPCM; }
202 bool isFlex() const { return primitiveType() == CSS_FR; } 203 bool isFlex() const { return primitiveType() == CSS_FR; }
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 }; 359 };
359 360
360 typedef CSSPrimitiveValue::CSSLengthArray CSSLengthArray; 361 typedef CSSPrimitiveValue::CSSLengthArray CSSLengthArray;
361 typedef CSSPrimitiveValue::CSSLengthTypeArray CSSLengthTypeArray; 362 typedef CSSPrimitiveValue::CSSLengthTypeArray CSSLengthTypeArray;
362 363
363 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); 364 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue());
364 365
365 } // namespace blink 366 } // namespace blink
366 367
367 #endif // CSSPrimitiveValue_h 368 #endif // CSSPrimitiveValue_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/FontFace.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698