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

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

Issue 21006006: Add forEach() to CSSVariablesMap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reverted .tmpl rename 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 3e461e28a64232ebf39dc0836eecea2425f35056..0a126e28978fc9d030bcdf578d3b845320ef94ac 100644
--- a/Source/core/css/CSSComputedStyleDeclaration.h
+++ b/Source/core/css/CSSComputedStyleDeclaration.h
@@ -50,6 +50,22 @@ 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;
+ 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, ExceptionState&) OVERRIDE;
virtual bool removeVariable(const AtomicString& name) OVERRIDE;
virtual void clearVariables(ExceptionState&) 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