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

Unified Diff: Source/core/css/CSSComputedStyleDeclaration.h

Issue 21006006: Add forEach() to CSSVariablesMap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Test fixes and rebased onto Python IDL generator Created 7 years, 4 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: Source/core/css/CSSComputedStyleDeclaration.h
diff --git a/Source/core/css/CSSComputedStyleDeclaration.h b/Source/core/css/CSSComputedStyleDeclaration.h
index 1f2a35fad5209caa3baf78e4472b4b7dbb9121fe..a1e0cc80f7d875f98d44a8297fac13ade93586d2 100644
--- a/Source/core/css/CSSComputedStyleDeclaration.h
+++ b/Source/core/css/CSSComputedStyleDeclaration.h
@@ -50,6 +50,22 @@ class CustomFilterParameter;
enum EUpdateLayout { DoNotUpdateLayout = false, UpdateLayout = true };
class CSSComputedStyleDeclaration : public CSSStyleDeclaration {
+private:
+ class ComputedCSSVariablesIterator : public CSSVariablesIterator {
+ public:
+ virtual ~ComputedCSSVariablesIterator() { }
+ static PassRefPtr<ComputedCSSVariablesIterator> create(const HashMap<AtomicString, String>* variableMap) { return adoptRef(new ComputedCSSVariablesIterator(variableMap)); }
+ private:
+ explicit ComputedCSSVariablesIterator(const HashMap<AtomicString, String>* variableMap);
+ virtual void advance() OVERRIDE;
+ virtual bool atEnd() const OVERRIDE { return m_it == m_end; }
+ virtual AtomicString name() const OVERRIDE;
+ virtual String value() const OVERRIDE;
+ bool m_active;
+ HashMap<AtomicString, String>::const_iterator m_it;
+ HashMap<AtomicString, String>::const_iterator m_end;
+ };
+
public:
static PassRefPtr<CSSComputedStyleDeclaration> create(PassRefPtr<Node> node, bool allowVisitedStyle = false, const String& pseudoElementName = String())
{
@@ -107,6 +123,7 @@ private:
virtual void setVariableValue(const AtomicString& name, const String& value, ExceptionCode&) OVERRIDE;
virtual bool removeVariable(const AtomicString& name) OVERRIDE;
virtual void clearVariables(ExceptionCode&) OVERRIDE;
+ virtual PassRefPtr<CSSVariablesIterator> variablesIterator() const OVERRIDE { return ComputedCSSVariablesIterator::create(variableMap()); }
virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const OVERRIDE;

Powered by Google App Engine
This is Rietveld 408576698