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

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

Issue 2630683002: Move custom property isInheritedProperty storage logic into ComputedStyle (Closed)
Patch Set: Undo cscssvm change Created 3 years, 11 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 | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | 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 2baa7e91459bd6918ceca8814865baa7e6b87b8e..9d67471662806ebae405f92442b995c1fb17ee1d 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -928,42 +928,37 @@ void StyleBuilderFunctions::applyValueCSSPropertyVariable(
initial = true;
}
- DCHECK(initial ^ inherit);
Timothy Loh 2017/01/17 05:51:05 Can we just keep this? You loosened the check so n
alancutter (OOO until 2018) 2017/01/17 06:08:15 Ah, true. I mainly changed it so that the code bel
-
+ state.style()->removeVariable(name, isInheritedProperty);
if (initial) {
- if (isInheritedProperty)
- state.style()->removeInheritedVariable(name);
- else
- state.style()->removeNonInheritedVariable(name);
return;
}
- if (isInheritedProperty) {
- state.style()->removeInheritedVariable(name);
- StyleInheritedVariables* parentVariables =
- state.parentStyle()->inheritedVariables();
- if (!parentVariables)
- return;
- CSSVariableData* parentValue = parentVariables->getVariable(name);
+ DCHECK(inherit);
+ CSSVariableData* parentValue =
+ state.parentStyle()->getVariable(name, isInheritedProperty);
+ const CSSValue* parentCSSValue =
+ registration && parentValue
+ ? state.parentStyle()->getRegisteredVariable(name,
+ isInheritedProperty)
+ : nullptr;
+
+ if (!isInheritedProperty) {
+ DCHECK(registration);
if (parentValue) {
- if (!registration)
- state.style()->setResolvedUnregisteredVariable(name, parentValue);
- else
- state.style()->setResolvedInheritedVariable(
- name, parentValue, parentVariables->registeredVariable(name));
+ state.style()->setResolvedNonInheritedVariable(name, parentValue,
+ parentCSSValue);
}
return;
}
- state.style()->removeNonInheritedVariable(name);
- StyleNonInheritedVariables* parentVariables =
- state.parentStyle()->nonInheritedVariables();
- if (!parentVariables)
- return;
- CSSVariableData* parentValue = parentVariables->getVariable(name);
- if (parentValue)
- state.style()->setResolvedNonInheritedVariable(
- name, parentValue, parentVariables->registeredVariable(name));
+ if (parentValue) {
+ if (!registration) {
+ state.style()->setResolvedUnregisteredVariable(name, parentValue);
+ } else {
+ state.style()->setResolvedInheritedVariable(name, parentValue,
+ parentCSSValue);
+ }
+ }
}
void StyleBuilderFunctions::applyInheritCSSPropertyBaselineShift(
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698