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

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

Issue 2310823002: Skeleton implementation of CSS Properties and Values API (Closed)
Patch Set: fix stylevardata copy ctor 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 99e261c588767492591e8552c8f1d67586cef05c..33ee08dfcad4107811b9849b87b02be30f2d8cd6 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -1460,6 +1460,19 @@ void ComputedStyle::setVariable(const AtomicString& name, PassRefPtr<CSSVariable
variables->setVariable(name, std::move(value));
}
+void ComputedStyle::setRegisteredInheritedProperty(const AtomicString& name, const CSSValue* parsedValue)
+{
+ RefPtr<StyleVariableData>& variables = m_rareInheritedData.access()->variables;
+ // The CSSVariableData needs to be set before calling this function
+ DCHECK(variables);
+ DCHECK(!!parsedValue == !!variables->getVariable(name));
+ DCHECK(!(variables->getVariable(name) && variables->getVariable(name)->needsVariableResolution()));
+
+ if (!variables->hasOneRef())
+ variables = variables->copy();
+ variables->setRegisteredInheritedProperty(name, parsedValue);
+}
+
void ComputedStyle::removeVariable(const AtomicString& name)
{
RefPtr<StyleVariableData>& variables = m_rareInheritedData.access()->variables;
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | third_party/WebKit/Source/core/style/StyleVariableData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698