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

Unified Diff: Source/core/css/resolver/StyleResolver.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/resolver/StyleBuilderCustom.cpp ('k') | Source/core/css/resolver/StyleResolverState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index b8c88ad6f31f654b6c3a886f00c88bdd57f473e1..074caea08ade6cb51648f5088b09578e208338f6 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -2237,12 +2237,12 @@ bool StyleResolver::useSVGZoomRules()
static bool createGridTrackBreadth(CSSPrimitiveValue* primitiveValue, const StyleResolverState& state, GridLength& workingLength)
{
- if (primitiveValue->getIdent() == CSSValueWebkitMinContent) {
+ if (primitiveValue->getValueID() == CSSValueWebkitMinContent) {
workingLength = Length(MinContent);
return true;
}
- if (primitiveValue->getIdent() == CSSValueWebkitMaxContent) {
+ if (primitiveValue->getValueID() == CSSValueWebkitMaxContent) {
workingLength = Length(MaxContent);
return true;
}
@@ -2293,7 +2293,7 @@ static bool createGridTrackList(CSSValue* value, Vector<GridTrackSize>& trackSiz
// Handle 'none'.
if (value->isPrimitiveValue()) {
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- return primitiveValue->getIdent() == CSSValueNone;
+ return primitiveValue->getValueID() == CSSValueNone;
}
if (!value->isValueList())
@@ -2332,7 +2332,7 @@ static bool createGridPosition(CSSValue* value, GridPosition& position)
if (value->isPrimitiveValue()) {
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- ASSERT(primitiveValue->getIdent() == CSSValueAuto);
+ ASSERT(primitiveValue->getValueID() == CSSValueAuto);
return true;
}
@@ -2346,7 +2346,7 @@ static bool createGridPosition(CSSValue* value, GridPosition& position)
CSSValueListIterator it = values;
CSSPrimitiveValue* currentValue = toCSSPrimitiveValue(it.value());
- if (currentValue->getIdent() == CSSValueSpan) {
+ if (currentValue->getValueID() == CSSValueSpan) {
isSpanPosition = true;
it.advance();
currentValue = it.hasMore() ? toCSSPrimitiveValue(it.value()) : 0;
@@ -2537,14 +2537,14 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
} else if (contentValue->isCounter()) {
Counter* counterValue = contentValue->getCounterValue();
EListStyleType listStyleType = NoneListStyle;
- int listStyleIdent = counterValue->listStyleIdent();
+ CSSValueID listStyleIdent = counterValue->listStyleIdent();
if (listStyleIdent != CSSValueNone)
listStyleType = static_cast<EListStyleType>(listStyleIdent - CSSValueDisc);
OwnPtr<CounterContent> counter = adoptPtr(new CounterContent(counterValue->identifier(), listStyleType, counterValue->separator()));
state.style()->setContent(counter.release(), didSet);
didSet = true;
} else {
- switch (contentValue->getIdent()) {
+ switch (contentValue->getValueID()) {
case CSSValueOpenQuote:
state.style()->setContent(OPEN_QUOTE, didSet);
didSet = true;
@@ -2597,7 +2597,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
return;
}
if (primitiveValue) {
- if (primitiveValue->getIdent() == CSSValueNone)
+ if (primitiveValue->getValueID() == CSSValueNone)
state.style()->setQuotes(QuotesData::create());
}
return;
@@ -2619,7 +2619,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
state.setLineHeightValue(0);
FontDescription fontDescription;
- RenderTheme::defaultTheme()->systemFont(primitiveValue->getIdent(), fontDescription);
+ RenderTheme::defaultTheme()->systemFont(primitiveValue->getValueID(), fontDescription);
// Double-check and see if the theme did anything. If not, don't bother updating the font.
if (fontDescription.isAbsoluteSize()) {
@@ -2726,7 +2726,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
int y = item->y->computeLength<int>(state.style(), state.rootElementStyle(), zoomFactor);
int blur = item->blur ? item->blur->computeLength<int>(state.style(), state.rootElementStyle(), zoomFactor) : 0;
int spread = item->spread ? item->spread->computeLength<int>(state.style(), state.rootElementStyle(), zoomFactor) : 0;
- ShadowStyle shadowStyle = item->style && item->style->getIdent() == CSSValueInset ? Inset : Normal;
+ ShadowStyle shadowStyle = item->style && item->style->getValueID() == CSSValueInset ? Inset : Normal;
Color color;
if (item->color)
color = m_state.colorFromPrimitiveValue(item->color.get());
@@ -2772,7 +2772,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
HANDLE_INHERIT_AND_INITIAL(locale, Locale);
if (!primitiveValue)
return;
- if (primitiveValue->getIdent() == CSSValueAuto)
+ if (primitiveValue->getValueID() == CSSValueAuto)
state.style()->setLocale(nullAtom);
else
state.style()->setLocale(primitiveValue->getStringValue());
@@ -2782,23 +2782,23 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
return;
}
case CSSPropertyWebkitAppRegion: {
- if (!primitiveValue || !primitiveValue->getIdent())
+ if (!primitiveValue || !primitiveValue->getValueID())
return;
- state.style()->setDraggableRegionMode(primitiveValue->getIdent() == CSSValueDrag ? DraggableRegionDrag : DraggableRegionNoDrag);
+ state.style()->setDraggableRegionMode(primitiveValue->getValueID() == CSSValueDrag ? DraggableRegionDrag : DraggableRegionNoDrag);
state.document()->setHasAnnotatedRegions(true);
return;
}
case CSSPropertyWebkitTextStrokeWidth: {
HANDLE_INHERIT_AND_INITIAL(textStrokeWidth, TextStrokeWidth)
float width = 0;
- switch (primitiveValue->getIdent()) {
+ switch (primitiveValue->getValueID()) {
case CSSValueThin:
case CSSValueMedium:
case CSSValueThick: {
double result = 1.0 / 48;
- if (primitiveValue->getIdent() == CSSValueMedium)
+ if (primitiveValue->getValueID() == CSSValueMedium)
result *= 3;
- else if (primitiveValue->getIdent() == CSSValueThick)
+ else if (primitiveValue->getValueID() == CSSValueThick)
result *= 5;
width = CSSPrimitiveValue::create(result, CSSPrimitiveValue::CSS_EMS)->computeLength<float>(state.style(), state.rootElementStyle(), zoomFactor);
break;
@@ -2823,7 +2823,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
if (!primitiveValue)
return;
- if (primitiveValue->getIdent() == CSSValueNone) {
+ if (primitiveValue->getValueID() == CSSValueNone) {
state.style()->setPerspective(0);
return;
}
@@ -2855,7 +2855,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
HANDLE_INHERIT_AND_INITIAL(useTouchOverflowScrolling, UseTouchOverflowScrolling);
if (!primitiveValue)
break;
- state.style()->setUseTouchOverflowScrolling(primitiveValue->getIdent() == CSSValueTouch);
+ state.style()->setUseTouchOverflowScrolling(primitiveValue->getValueID() == CSSValueTouch);
return;
}
#endif
@@ -2939,7 +2939,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
case CSSPropertyWebkitLineBoxContain: {
HANDLE_INHERIT_AND_INITIAL(lineBoxContain, LineBoxContain)
- if (primitiveValue && primitiveValue->getIdent() == CSSValueNone) {
+ if (primitiveValue && primitiveValue->getValueID() == CSSValueNone) {
state.style()->setLineBoxContain(LineBoxContainNone);
return;
}
@@ -2954,7 +2954,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
// CSS Fonts Module Level 3
case CSSPropertyWebkitFontFeatureSettings: {
- if (primitiveValue && primitiveValue->getIdent() == CSSValueNormal) {
+ if (primitiveValue && primitiveValue->getValueID() == CSSValueNormal) {
setFontDescription(state.style()->fontDescription().makeNormalFeatureSettings());
return;
}
@@ -3465,7 +3465,7 @@ void StyleResolver::setFontSize(FontDescription& fontDescription, float size)
bool StyleResolver::colorFromPrimitiveValueIsDerivedFromElement(CSSPrimitiveValue* value)
{
- int ident = value->getIdent();
+ int ident = value->getValueID();
switch (ident) {
case CSSValueWebkitText:
case CSSValueWebkitLink:
« no previous file with comments | « Source/core/css/resolver/StyleBuilderCustom.cpp ('k') | Source/core/css/resolver/StyleResolverState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698