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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2310823002: Skeleton implementation of CSS Properties and Values API (Closed)
Patch Set: custom properties :D 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
Index: third_party/WebKit/Source/core/style/ComputedStyle.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index 79b8d1e384a4e59c1d01349676b847b377f7a4a1..0995b29c336435646b430970c1923fa6c0fe446c 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -1460,6 +1460,17 @@ void ComputedStyle::setVariable(const AtomicString& name, PassRefPtr<CSSVariable
variables->setVariable(name, value);
}
+void ComputedStyle::setRegisteredInheritedProperty(const AtomicString& name, const CSSValue* parsedValue)
+{
+ RefPtr<StyleVariableData>& variables = m_rareInheritedData.access()->variables;
+ DCHECK(variables);
+ if (!variables->hasOneRef())
+ variables = variables->copy();
+ DCHECK(!!parsedValue == !!variables->getVariable(name));
meade_UTC10 2016/09/06 04:52:07 I don't really understand what this check is for,
+ DCHECK(!(parsedValue && variables->getVariable(name)->needsVariableResolution()));
meade_UTC10 2016/09/06 04:52:07 Is this one "you can clear a variable that still n
Timothy Loh 2016/09/06 08:21:17 Both dchecks are sanity checks about the relation
+ variables->setRegisteredInheritedProperty(name, parsedValue);
+}
+
void ComputedStyle::removeVariable(const AtomicString& name)
{
RefPtr<StyleVariableData>& variables = m_rareInheritedData.access()->variables;

Powered by Google App Engine
This is Rietveld 408576698