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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp

Issue 1406993009: Revert "CSS Custom Properties (Variables)" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
Index: third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
index e9e56d3b274778cc4e1ebf1803823c3491e7e38d..5943b343d79f52940f4134609269175f0e8107ab 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -46,7 +46,6 @@
#include "core/css/CSSBasicShapeValues.h"
#include "core/css/CSSCounterValue.h"
#include "core/css/CSSCursorImageValue.h"
-#include "core/css/CSSCustomPropertyDeclaration.h"
#include "core/css/CSSFunctionValue.h"
#include "core/css/CSSGradientValue.h"
#include "core/css/CSSGridTemplateAreasValue.h"
@@ -57,10 +56,8 @@
#include "core/css/CSSPropertyMetadata.h"
#include "core/css/CSSURIValue.h"
#include "core/css/CSSValuePair.h"
-#include "core/css/CSSVariableReferenceValue.h"
#include "core/css/StylePropertySet.h"
#include "core/css/StyleRule.h"
-#include "core/css/resolver/CSSVariableResolver.h"
#include "core/css/resolver/ElementStyleResources.h"
#include "core/css/resolver/FilterOperationResolver.h"
#include "core/css/resolver/FontBuilder.h"
@@ -111,11 +108,6 @@ static inline bool isValidVisitedLinkProperty(CSSPropertyID id)
void StyleBuilder::applyProperty(CSSPropertyID id, StyleResolverState& state, CSSValue* value)
{
- if (RuntimeEnabledFeatures::cssVariablesEnabled() && id != CSSPropertyVariable && value->isVariableReferenceValue()) {
- CSSVariableResolver::resolveAndApplyVariableReferences(state, id, *toCSSVariableReferenceValue(value));
- return;
- }
-
ASSERT_WITH_MESSAGE(!isShorthandProperty(id), "Shorthand property id = %d wasn't expanded at parsing time", id);
bool isInherit = state.parentNode() && value->isInheritedValue();
@@ -821,34 +813,6 @@ void StyleBuilderFunctions::applyValueCSSPropertyWebkitTextOrientation(StyleReso
state.setTextOrientation(toCSSPrimitiveValue(value)->convertTo<TextOrientation>());
}
-void StyleBuilderFunctions::applyValueCSSPropertyVariable(StyleResolverState& state, CSSValue* value)
-{
- CSSCustomPropertyDeclaration* declaration = toCSSCustomPropertyDeclaration(value);
- switch (declaration->id()) {
- case CSSValueInitial:
- state.style()->removeVariable(declaration->name());
- break;
-
- case CSSValueUnset:
- case CSSValueInherit: {
- state.style()->removeVariable(declaration->name());
- StyleVariableData* parentVariables = state.parentStyle()->variables();
- if (!parentVariables)
- return;
- CSSVariableData* value = parentVariables->getVariable(declaration->name());
- if (!value)
- return;
- state.style()->setVariable(declaration->name(), value);
- break;
- }
- case CSSValueInternalVariableValue:
- state.style()->setVariable(declaration->name(), declaration->value());
- break;
- default:
- ASSERT_NOT_REACHED();
- }
-}
-
void StyleBuilderFunctions::applyInheritCSSPropertyBaselineShift(StyleResolverState& state)
{
const SVGComputedStyle& parentSvgStyle = state.parentStyle()->svgStyle();

Powered by Google App Engine
This is Rietveld 408576698