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

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

Issue 14408004: Fix incorrect evaluation of resolution media queries (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 8 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 bool isShape() const { return m_primitiveUnitType == CSS_SHAPE; } 175 bool isShape() const { return m_primitiveUnitType == CSS_SHAPE; }
176 bool isString() const { return m_primitiveUnitType == CSS_STRING; } 176 bool isString() const { return m_primitiveUnitType == CSS_STRING; }
177 bool isTime() const { return m_primitiveUnitType == CSS_S || m_primitiveUnit Type == CSS_MS; } 177 bool isTime() const { return m_primitiveUnitType == CSS_S || m_primitiveUnit Type == CSS_MS; }
178 bool isURI() const { return m_primitiveUnitType == CSS_URI; } 178 bool isURI() const { return m_primitiveUnitType == CSS_URI; }
179 bool isCalculated() const { return m_primitiveUnitType == CSS_CALC; } 179 bool isCalculated() const { return m_primitiveUnitType == CSS_CALC; }
180 bool isCalculatedPercentageWithNumber() const { return primitiveType() == CS S_CALC_PERCENTAGE_WITH_NUMBER; } 180 bool isCalculatedPercentageWithNumber() const { return primitiveType() == CS S_CALC_PERCENTAGE_WITH_NUMBER; }
181 bool isCalculatedPercentageWithLength() const { return primitiveType() == CS S_CALC_PERCENTAGE_WITH_LENGTH; } 181 bool isCalculatedPercentageWithLength() const { return primitiveType() == CS S_CALC_PERCENTAGE_WITH_LENGTH; }
182 bool isDotsPerInch() const { return primitiveType() == CSS_DPI; } 182 bool isDotsPerInch() const { return primitiveType() == CSS_DPI; }
183 bool isDotsPerPixel() const { return primitiveType() == CSS_DPPX; } 183 bool isDotsPerPixel() const { return primitiveType() == CSS_DPPX; }
184 bool isDotsPerCentimeter() const { return primitiveType() == CSS_DPCM; } 184 bool isDotsPerCentimeter() const { return primitiveType() == CSS_DPCM; }
185 bool isResolution() const
186 {
187 unsigned short type = primitiveType();
188 return type >= CSS_DPPX && type <= CSS_DPCM;
189 }
185 bool isVariableName() const { return primitiveType() == CSS_VARIABLE_NAME; } 190 bool isVariableName() const { return primitiveType() == CSS_VARIABLE_NAME; }
186 bool isViewportPercentageLength() const { return m_primitiveUnitType >= CSS_ VW && m_primitiveUnitType <= CSS_VMAX; } 191 bool isViewportPercentageLength() const { return m_primitiveUnitType >= CSS_ VW && m_primitiveUnitType <= CSS_VMAX; }
187 192
188 static PassRefPtr<CSSPrimitiveValue> createIdentifier(int identifier) { retu rn adoptRef(new CSSPrimitiveValue(identifier)); } 193 static PassRefPtr<CSSPrimitiveValue> createIdentifier(int identifier) { retu rn adoptRef(new CSSPrimitiveValue(identifier)); }
189 static PassRefPtr<CSSPrimitiveValue> createColor(unsigned rgbValue) { return adoptRef(new CSSPrimitiveValue(rgbValue)); } 194 static PassRefPtr<CSSPrimitiveValue> createColor(unsigned rgbValue) { return adoptRef(new CSSPrimitiveValue(rgbValue)); }
190 static PassRefPtr<CSSPrimitiveValue> create(double value, UnitTypes type) { return adoptRef(new CSSPrimitiveValue(value, type)); } 195 static PassRefPtr<CSSPrimitiveValue> create(double value, UnitTypes type) { return adoptRef(new CSSPrimitiveValue(value, type)); }
191 static PassRefPtr<CSSPrimitiveValue> create(const String& value, UnitTypes t ype) { return adoptRef(new CSSPrimitiveValue(value, type)); } 196 static PassRefPtr<CSSPrimitiveValue> create(const String& value, UnitTypes t ype) { return adoptRef(new CSSPrimitiveValue(value, type)); }
192 197
193 template<typename T> static PassRefPtr<CSSPrimitiveValue> create(T value) 198 template<typename T> static PassRefPtr<CSSPrimitiveValue> create(T value)
194 { 199 {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 unsigned rgbcolor; 360 unsigned rgbcolor;
356 Pair* pair; 361 Pair* pair;
357 CSSBasicShape* shape; 362 CSSBasicShape* shape;
358 CSSCalcValue* calc; 363 CSSCalcValue* calc;
359 } m_value; 364 } m_value;
360 }; 365 };
361 366
362 } // namespace WebCore 367 } // namespace WebCore
363 368
364 #endif // CSSPrimitiveValue_h 369 #endif // CSSPrimitiveValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698