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

Unified 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, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/CSSParser.cpp ('k') | Source/core/css/CSSPrimitiveValue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSPrimitiveValue.h
diff --git a/Source/core/css/CSSPrimitiveValue.h b/Source/core/css/CSSPrimitiveValue.h
index 70a47100279d2e34202f8b7d35b9ce09adbc335f..22842186b3a3347e662dc7770be1cb23e2e8be95 100644
--- a/Source/core/css/CSSPrimitiveValue.h
+++ b/Source/core/css/CSSPrimitiveValue.h
@@ -139,9 +139,7 @@ public:
UTime,
UFrequency,
UViewportPercentageLength,
-#if ENABLE(RESOLUTION_MEDIA_QUERY)
UResolution,
-#endif
UOther
};
@@ -183,6 +181,11 @@ public:
bool isDotsPerInch() const { return primitiveType() == CSS_DPI; }
bool isDotsPerPixel() const { return primitiveType() == CSS_DPPX; }
bool isDotsPerCentimeter() const { return primitiveType() == CSS_DPCM; }
+ bool isResolution() const
+ {
+ unsigned short type = primitiveType();
+ return type >= CSS_DPPX && type <= CSS_DPCM;
+ }
bool isVariableName() const { return primitiveType() == CSS_VARIABLE_NAME; }
bool isViewportPercentageLength() const { return m_primitiveUnitType >= CSS_VW && m_primitiveUnitType <= CSS_VMAX; }
bool isFlex() const { return primitiveType() == CSS_FR; }
« no previous file with comments | « Source/core/css/CSSParser.cpp ('k') | Source/core/css/CSSPrimitiveValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698