Index: Source/core/css/CSSComputedStyleDeclaration.cpp |
diff --git a/Source/core/css/CSSComputedStyleDeclaration.cpp b/Source/core/css/CSSComputedStyleDeclaration.cpp |
index dd2e82d38908db2c89904c793b053b3e464b3a1c..89193818f9b2312dfedbdcfb3d2b3e695850f465 100644 |
--- a/Source/core/css/CSSComputedStyleDeclaration.cpp |
+++ b/Source/core/css/CSSComputedStyleDeclaration.cpp |
@@ -3186,6 +3186,35 @@ void CSSComputedStyleDeclaration::clearVariables(ExceptionState& es) |
es.throwDOMException(NoModificationAllowedError, "Failed to clear variables from a computed 'CSSStyleDeclaration': computed styles are read-only."); |
} |
+CSSComputedStyleDeclaration::ComputedCSSVariablesIterator::ComputedCSSVariablesIterator(const HashMap<AtomicString, String>* variables) |
+ : m_active(variables) |
+{ |
+ ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); |
+ if (m_active) { |
+ m_it = variables->begin(); |
+ m_end = variables->end(); |
+ } |
+} |
+ |
+void CSSComputedStyleDeclaration::ComputedCSSVariablesIterator::advance() |
+{ |
+ ASSERT(m_active); |
+ ++m_it; |
+ m_active = !atEnd(); |
+} |
+ |
+AtomicString CSSComputedStyleDeclaration::ComputedCSSVariablesIterator::name() const |
+{ |
+ ASSERT(m_active); |
+ return m_it->key; |
+} |
+ |
+String CSSComputedStyleDeclaration::ComputedCSSVariablesIterator::value() const |
+{ |
+ ASSERT(m_active); |
+ return m_it->value; |
+} |
+ |
PassRefPtr<CSSValueList> CSSComputedStyleDeclaration::valuesForBackgroundShorthand() const |
{ |
static const CSSPropertyID propertiesBeforeSlashSeperator[5] = { CSSPropertyBackgroundColor, CSSPropertyBackgroundImage, |