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

Unified Diff: Source/core/css/CSSComputedStyleDeclaration.cpp

Issue 16339006: Make sure to use CSSValueID and CSSPropertyID rather than integers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/css/CSSGrammar.y.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSComputedStyleDeclaration.cpp
diff --git a/Source/core/css/CSSComputedStyleDeclaration.cpp b/Source/core/css/CSSComputedStyleDeclaration.cpp
index 4fc0fc5eb0af68b411368978d8741df06c0adade..c77fd48c58ac01459759ff5d3c20500347f031bf 100644
--- a/Source/core/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -390,7 +390,7 @@ static const Vector<CSSPropertyID>& computableProperties()
return properties;
}
-static int valueForRepeatRule(int rule)
+static CSSValueID valueForRepeatRule(int rule)
{
switch (rule) {
case RepeatImageRule:
@@ -1223,11 +1223,11 @@ void CSSComputedStyleDeclaration::setCssText(const String&, ExceptionCode& ec)
ec = NO_MODIFICATION_ALLOWED_ERR;
}
-static int cssIdentifierForFontSizeKeyword(int keywordSize)
+static CSSValueID cssIdentifierForFontSizeKeyword(int keywordSize)
{
ASSERT_ARG(keywordSize, keywordSize);
ASSERT_ARG(keywordSize, keywordSize <= 8);
- return CSSValueXxSmall + keywordSize - 1;
+ return static_cast<CSSValueID>(CSSValueXxSmall + keywordSize - 1);
}
PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringKeyword() const
@@ -1283,7 +1283,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
return getPropertyCSSValue(propertyID, UpdateLayout);
}
-static int identifierForFamily(const AtomicString& family)
+static CSSValueID identifierForFamily(const AtomicString& family)
{
if (family == cursiveFamily)
return CSSValueCursive;
@@ -1297,12 +1297,12 @@ static int identifierForFamily(const AtomicString& family)
return CSSValueSansSerif;
if (family == serifFamily)
return CSSValueSerif;
- return 0;
+ return CSSValueInvalid;
}
static PassRefPtr<CSSPrimitiveValue> valueForFamily(const AtomicString& family)
{
- if (int familyIdentifier = identifierForFamily(family))
+ if (CSSValueID familyIdentifier = identifierForFamily(family))
return cssValuePool().createIdentifierValue(familyIdentifier);
return cssValuePool().createValue(family.string(), CSSPrimitiveValue::CSS_STRING);
}
« no previous file with comments | « no previous file | Source/core/css/CSSGrammar.y.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698