Index: Source/core/style/ComputedStyle.cpp |
diff --git a/Source/core/style/ComputedStyle.cpp b/Source/core/style/ComputedStyle.cpp |
index d240465c8e5c34b9c1efbbed9a847d8b5127c66f..78f99424c3c620ce808bc2080a08ca0b07d8a841 100644 |
--- a/Source/core/style/ComputedStyle.cpp |
+++ b/Source/core/style/ComputedStyle.cpp |
@@ -1252,6 +1252,37 @@ const Vector<AppliedTextDecoration>& ComputedStyle::appliedTextDecorations() con |
return rareInheritedData->appliedTextDecorations->vector(); |
} |
+StyleVariableData* ComputedStyle::variables() const |
+{ |
+ ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); |
+ return rareInheritedData->variables.get(); |
+} |
+ |
+void ComputedStyle::setVariables(PassRefPtr<StyleVariableData> variableData) |
+{ |
+ rareInheritedData.access()->variables = variableData; |
+} |
+ |
+void ComputedStyle::setVariable(const AtomicString& name, PassRefPtr<CSSVariableData> value) |
+{ |
+ RefPtr<StyleVariableData>& variables = rareInheritedData.access()->variables; |
+ if (!variables) |
+ variables = StyleVariableData::create(); |
+ else if (!variables->hasOneRef()) |
+ variables = variables->copy(); |
+ variables->setVariable(name, value); |
+} |
+ |
+void ComputedStyle::removeVariable(const AtomicString& name) |
+{ |
+ RefPtr<StyleVariableData>& variables = rareInheritedData.access()->variables; |
+ if (!variables) |
+ return; |
+ if (!variables->hasOneRef()) |
+ variables = variables->copy(); |
+ variables->removeVariable(name); |
+} |
+ |
float ComputedStyle::wordSpacing() const { return fontDescription().wordSpacing(); } |
float ComputedStyle::letterSpacing() const { return fontDescription().letterSpacing(); } |