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

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

Issue 16415007: Cleanup usage of CSSPropertyID and CSSValueID inside Blink. (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 | « Source/core/css/CSSPrimitiveValueMappings.h ('k') | Source/core/css/Counter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSToStyleMap.cpp
diff --git a/Source/core/css/CSSToStyleMap.cpp b/Source/core/css/CSSToStyleMap.cpp
index 4b459968853da236a62cf9faee9cb8ce19657969..156b4c240d7ac54cc3679c0119c80c6139a21678 100644
--- a/Source/core/css/CSSToStyleMap.cpp
+++ b/Source/core/css/CSSToStyleMap.cpp
@@ -72,7 +72,7 @@ void CSSToStyleMap::mapFillAttachment(CSSPropertyID, FillLayer* layer, CSSValue*
return;
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- switch (primitiveValue->getIdent()) {
+ switch (primitiveValue->getValueID()) {
case CSSValueFixed:
layer->setAttachment(FixedBackgroundAttachment);
break;
@@ -190,16 +190,16 @@ void CSSToStyleMap::mapFillSize(CSSPropertyID, FillLayer* layer, CSSValue* value
}
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (primitiveValue->getIdent() == CSSValueContain)
+ if (primitiveValue->getValueID() == CSSValueContain)
layer->setSizeType(Contain);
- else if (primitiveValue->getIdent() == CSSValueCover)
+ else if (primitiveValue->getValueID() == CSSValueCover)
layer->setSizeType(Cover);
else
layer->setSizeType(SizeLength);
LengthSize b = FillLayer::initialFillSizeLength(layer->type());
- if (value->isInitialValue() || primitiveValue->getIdent() == CSSValueContain || primitiveValue->getIdent() == CSSValueCover) {
+ if (value->isInitialValue() || primitiveValue->getValueID() == CSSValueContain || primitiveValue->getValueID() == CSSValueCover) {
layer->setSizeLength(b);
return;
}
@@ -322,7 +322,7 @@ void CSSToStyleMap::mapAnimationDirection(CSSAnimationData* layer, CSSValue* val
return;
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- switch (primitiveValue->getIdent()) {
+ switch (primitiveValue->getValueID()) {
case CSSValueNormal:
layer->setDirection(CSSAnimationData::AnimationDirectionNormal);
break;
@@ -335,6 +335,8 @@ void CSSToStyleMap::mapAnimationDirection(CSSAnimationData* layer, CSSValue* val
case CSSValueAlternateReverse:
layer->setDirection(CSSAnimationData::AnimationDirectionAlternateReverse);
break;
+ default:
+ break;
}
}
@@ -363,7 +365,7 @@ void CSSToStyleMap::mapAnimationFillMode(CSSAnimationData* layer, CSSValue* valu
return;
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- switch (primitiveValue->getIdent()) {
+ switch (primitiveValue->getValueID()) {
case CSSValueNone:
layer->setFillMode(AnimationFillModeNone);
break;
@@ -376,6 +378,8 @@ void CSSToStyleMap::mapAnimationFillMode(CSSAnimationData* layer, CSSValue* valu
case CSSValueBoth:
layer->setFillMode(AnimationFillModeBoth);
break;
+ default:
+ break;
}
}
@@ -390,7 +394,7 @@ void CSSToStyleMap::mapAnimationIterationCount(CSSAnimationData* animation, CSSV
return;
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (primitiveValue->getIdent() == CSSValueInfinite)
+ if (primitiveValue->getValueID() == CSSValueInfinite)
animation->setIterationCount(CSSAnimationData::IterationCountInfinite);
else
animation->setIterationCount(primitiveValue->getFloatValue());
@@ -407,7 +411,7 @@ void CSSToStyleMap::mapAnimationName(CSSAnimationData* layer, CSSValue* value)
return;
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (primitiveValue->getIdent() == CSSValueNone)
+ if (primitiveValue->getValueID() == CSSValueNone)
layer->setIsNoneAnimation(true);
else
layer->setName(primitiveValue->getStringValue());
@@ -424,7 +428,7 @@ void CSSToStyleMap::mapAnimationPlayState(CSSAnimationData* layer, CSSValue* val
return;
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- EAnimPlayState playState = (primitiveValue->getIdent() == CSSValuePaused) ? AnimPlayStatePaused : AnimPlayStatePlaying;
+ EAnimPlayState playState = (primitiveValue->getValueID() == CSSValuePaused) ? AnimPlayStatePaused : AnimPlayStatePlaying;
layer->setPlayState(playState);
}
@@ -440,15 +444,15 @@ void CSSToStyleMap::mapAnimationProperty(CSSAnimationData* animation, CSSValue*
return;
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (primitiveValue->getIdent() == CSSValueAll) {
+ if (primitiveValue->getValueID() == CSSValueAll) {
animation->setAnimationMode(CSSAnimationData::AnimateAll);
animation->setProperty(CSSPropertyInvalid);
- } else if (primitiveValue->getIdent() == CSSValueNone) {
+ } else if (primitiveValue->getValueID() == CSSValueNone) {
animation->setAnimationMode(CSSAnimationData::AnimateNone);
animation->setProperty(CSSPropertyInvalid);
} else {
animation->setAnimationMode(CSSAnimationData::AnimateSingleProperty);
- animation->setProperty(static_cast<CSSPropertyID>(primitiveValue->getIdent()));
+ animation->setProperty(primitiveValue->getPropertyID());
}
}
@@ -461,7 +465,7 @@ void CSSToStyleMap::mapAnimationTimingFunction(CSSAnimationData* animation, CSSV
if (value->isPrimitiveValue()) {
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- switch (primitiveValue->getIdent()) {
+ switch (primitiveValue->getValueID()) {
case CSSValueLinear:
animation->setTimingFunction(LinearTimingFunction::create());
break;
@@ -483,6 +487,8 @@ void CSSToStyleMap::mapAnimationTimingFunction(CSSAnimationData* animation, CSSV
case CSSValueStepEnd:
animation->setTimingFunction(StepsTimingFunction::create(1, false));
break;
+ default:
+ break;
}
return;
}
@@ -607,28 +613,28 @@ LengthBox CSSToStyleMap::mapNinePieceImageQuad(CSSValue* value)
box.m_top = Length(slices->top()->getIntValue(), Relative);
else if (slices->top()->isPercentage())
box.m_top = Length(slices->top()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
- else if (slices->top()->getIdent() != CSSValueAuto)
+ else if (slices->top()->getValueID() != CSSValueAuto)
box.m_top = slices->top()->computeLength<Length>(style(), rootElementStyle(), zoom);
if (slices->right()->isNumber())
box.m_right = Length(slices->right()->getIntValue(), Relative);
else if (slices->right()->isPercentage())
box.m_right = Length(slices->right()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
- else if (slices->right()->getIdent() != CSSValueAuto)
+ else if (slices->right()->getValueID() != CSSValueAuto)
box.m_right = slices->right()->computeLength<Length>(style(), rootElementStyle(), zoom);
if (slices->bottom()->isNumber())
box.m_bottom = Length(slices->bottom()->getIntValue(), Relative);
else if (slices->bottom()->isPercentage())
box.m_bottom = Length(slices->bottom()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
- else if (slices->bottom()->getIdent() != CSSValueAuto)
+ else if (slices->bottom()->getValueID() != CSSValueAuto)
box.m_bottom = slices->bottom()->computeLength<Length>(style(), rootElementStyle(), zoom);
if (slices->left()->isNumber())
box.m_left = Length(slices->left()->getIntValue(), Relative);
else if (slices->left()->isPercentage())
box.m_left = Length(slices->left()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
- else if (slices->left()->getIdent() != CSSValueAuto)
+ else if (slices->left()->getValueID() != CSSValueAuto)
box.m_left = slices->left()->computeLength<Length>(style(), rootElementStyle(), zoom);
return box;
@@ -644,8 +650,8 @@ void CSSToStyleMap::mapNinePieceImageRepeat(CSSValue* value, NinePieceImage& ima
if (!pair || !pair->first() || !pair->second())
return;
- int firstIdentifier = pair->first()->getIdent();
- int secondIdentifier = pair->second()->getIdent();
+ CSSValueID firstIdentifier = pair->first()->getValueID();
+ CSSValueID secondIdentifier = pair->second()->getValueID();
ENinePieceImageRule horizontalRule;
switch (firstIdentifier) {
« no previous file with comments | « Source/core/css/CSSPrimitiveValueMappings.h ('k') | Source/core/css/Counter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698