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

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

Issue 21006006: Add forEach() to CSSVariablesMap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase and review changes Created 7 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
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/css/CSSComputedStyleDeclaration.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSComputedStyleDeclaration.h
diff --git a/Source/core/css/CSSComputedStyleDeclaration.h b/Source/core/css/CSSComputedStyleDeclaration.h
index 6116b50d2b46c1099f5b1245253533ed98b74071..53f10d22b97eea7e920374f73c057feef1c52a44 100644
--- a/Source/core/css/CSSComputedStyleDeclaration.h
+++ b/Source/core/css/CSSComputedStyleDeclaration.h
@@ -49,6 +49,23 @@ class StylePropertyShorthand;
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;
+ typedef HashMap<AtomicString, String>::const_iterator VariablesMapIterator;
+ VariablesMapIterator m_it;
+ VariablesMapIterator m_end;
+ };
+
public:
static PassRefPtr<CSSComputedStyleDeclaration> create(PassRefPtr<Node> node, bool allowVisitedStyle = false, const String& pseudoElementName = String())
{
@@ -103,9 +120,10 @@ private:
const HashMap<AtomicString, String>* variableMap() const;
virtual unsigned variableCount() const OVERRIDE;
virtual String variableValue(const AtomicString& name) const OVERRIDE;
- virtual void setVariableValue(const AtomicString& name, const String& value, ExceptionState&) OVERRIDE;
+ virtual bool setVariableValue(const AtomicString& name, const String& value, ExceptionState&) OVERRIDE;
virtual bool removeVariable(const AtomicString& name) OVERRIDE;
- virtual void clearVariables(ExceptionState&) OVERRIDE;
+ virtual bool clearVariables(ExceptionState&) OVERRIDE;
+ virtual PassRefPtr<CSSVariablesIterator> variablesIterator() const OVERRIDE { return ComputedCSSVariablesIterator::create(variableMap()); }
virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const OVERRIDE;
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/css/CSSComputedStyleDeclaration.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698