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

Unified Diff: Source/core/css/CSSPrimitiveValue.h

Issue 240063003: Revert "A sizes attribute parser" (https://codereview.chromium.org/224733011) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/core.gypi ('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 6e62b4f2c1f3c069186077fa562883522f82c993..aecea7cbee317b78f060db2139f80b46a89ce60c 100644
--- a/Source/core/css/CSSPrimitiveValue.h
+++ b/Source/core/css/CSSPrimitiveValue.h
@@ -196,12 +196,11 @@ public:
|| m_primitiveUnitType == CSS_REMS
|| m_primitiveUnitType == CSS_CHS;
}
- static bool isViewportPercentageLength(unsigned short type) { return type >= CSS_VW && type <= CSS_VMAX; }
- static bool isLength(unsigned short type)
+ bool isLength() const
{
- return (type >= CSS_EMS && type <= CSS_PC) || type == CSS_REMS || type == CSS_CHS || isViewportPercentageLength(type);
+ unsigned short type = primitiveType();
+ return (type >= CSS_EMS && type <= CSS_PC) || type == CSS_REMS || type == CSS_CHS || isViewportPercentageLength();
}
- bool isLength() const { return isLength(primitiveType()); }
bool isNumber() const { return primitiveType() == CSS_NUMBER; }
bool isPercentage() const { return primitiveType() == CSS_PERCENTAGE; }
bool isPx() const { return primitiveType() == CSS_PX; }
@@ -222,6 +221,7 @@ public:
unsigned short type = primitiveType();
return type >= CSS_DPPX && type <= CSS_DPCM;
}
+ bool isViewportPercentageLength() const { return m_primitiveUnitType >= CSS_VW && m_primitiveUnitType <= CSS_VMAX; }
bool isFlex() const { return primitiveType() == CSS_FR; }
bool isValueID() const { return m_primitiveUnitType == CSS_VALUE_ID; }
bool colorIsDerivedFromElement() const;
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/css/CSSPrimitiveValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698