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

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

Issue 2382663002: Change CSSCustomPropertyDeclaration::id() to isInherit() and isInitial() (Closed)
Patch Set: moo Created 4 years, 3 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 | « third_party/WebKit/Source/core/css/CSSCustomPropertyDeclaration.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cc84d8b8c4db637799d3b41c7551b79eac0a6fde..cdb4359d89b9676489ab52204bc743e595519453 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -805,15 +805,14 @@ void StyleBuilderFunctions::applyValueCSSPropertyVariable(StyleResolverState& st
if (registry)
registration = registry->registration(name);
- bool initial = declaration.id() == CSSValueInitial
- || (declaration.id() == CSSValueUnset && registration && !registration->inherits());
- bool inherit = declaration.id() == CSSValueInherit
- || (declaration.id() == CSSValueUnset && (!registration || registration->inherits()));
+ bool isInheritedProperty = !registration || registration->inherits();
+ bool initial = declaration.isInitial(isInheritedProperty);
+ bool inherit = declaration.isInherit(isInheritedProperty);
DCHECK(!(initial && inherit));
- if (declaration.id() == CSSValueInternalVariableValue) {
+ if (!initial && !inherit) {
if (declaration.value()->needsVariableResolution()) {
- if (!registration || registration->inherits())
+ if (isInheritedProperty)
state.style()->setUnresolvedInheritedVariable(name, declaration.value());
else
state.style()->setUnresolvedNonInheritedVariable(name, declaration.value());
@@ -829,13 +828,13 @@ void StyleBuilderFunctions::applyValueCSSPropertyVariable(StyleResolverState& st
if (parsedValue) {
parsedValue = &StyleBuilderConverter::convertRegisteredPropertyValue(state, *parsedValue);
DCHECK(parsedValue);
- if (registration->inherits())
+ if (isInheritedProperty)
state.style()->setResolvedInheritedVariable(name, declaration.value(), parsedValue);
else
state.style()->setResolvedNonInheritedVariable(name, declaration.value(), parsedValue);
return;
}
- if (registration->inherits())
+ if (isInheritedProperty)
inherit = true;
else
initial = true;
@@ -844,14 +843,14 @@ void StyleBuilderFunctions::applyValueCSSPropertyVariable(StyleResolverState& st
DCHECK(initial ^ inherit);
if (initial) {
- if (!registration || registration->inherits())
+ if (isInheritedProperty)
state.style()->removeInheritedVariable(name);
else
state.style()->removeNonInheritedVariable(name);
return;
}
- if (!registration || registration->inherits()) {
+ if (isInheritedProperty) {
state.style()->removeInheritedVariable(name);
StyleInheritedVariables* parentVariables = state.parentStyle()->inheritedVariables();
if (!parentVariables)
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSCustomPropertyDeclaration.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698