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

Side by Side 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, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/css/CSSComputedStyleDeclaration.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public 6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 class RenderObject; 42 class RenderObject;
43 class RenderStyle; 43 class RenderStyle;
44 class SVGPaint; 44 class SVGPaint;
45 class ShadowData; 45 class ShadowData;
46 class StylePropertySet; 46 class StylePropertySet;
47 class StylePropertyShorthand; 47 class StylePropertyShorthand;
48 48
49 enum EUpdateLayout { DoNotUpdateLayout = false, UpdateLayout = true }; 49 enum EUpdateLayout { DoNotUpdateLayout = false, UpdateLayout = true };
50 50
51 class CSSComputedStyleDeclaration : public CSSStyleDeclaration { 51 class CSSComputedStyleDeclaration : public CSSStyleDeclaration {
52 private:
53 class ComputedCSSVariablesIterator : public CSSVariablesIterator {
54 public:
55 virtual ~ComputedCSSVariablesIterator() { }
56 static PassRefPtr<ComputedCSSVariablesIterator> create(const HashMap<Ato micString, String>* variableMap) { return adoptRef(new ComputedCSSVariablesItera tor(variableMap)); }
57 private:
58 explicit ComputedCSSVariablesIterator(const HashMap<AtomicString, String >* variableMap);
59 virtual void advance() OVERRIDE;
60 virtual bool atEnd() const OVERRIDE { return m_it == m_end; }
61 virtual AtomicString name() const OVERRIDE;
62 virtual String value() const OVERRIDE;
63 bool m_active;
64 typedef HashMap<AtomicString, String>::const_iterator VariablesMapIterat or;
65 VariablesMapIterator m_it;
66 VariablesMapIterator m_end;
67 };
68
52 public: 69 public:
53 static PassRefPtr<CSSComputedStyleDeclaration> create(PassRefPtr<Node> node, bool allowVisitedStyle = false, const String& pseudoElementName = String()) 70 static PassRefPtr<CSSComputedStyleDeclaration> create(PassRefPtr<Node> node, bool allowVisitedStyle = false, const String& pseudoElementName = String())
54 { 71 {
55 return adoptRef(new CSSComputedStyleDeclaration(node, allowVisitedStyle, pseudoElementName)); 72 return adoptRef(new CSSComputedStyleDeclaration(node, allowVisitedStyle, pseudoElementName));
56 } 73 }
57 virtual ~CSSComputedStyleDeclaration(); 74 virtual ~CSSComputedStyleDeclaration();
58 75
59 virtual void ref() OVERRIDE; 76 virtual void ref() OVERRIDE;
60 virtual void deref() OVERRIDE; 77 virtual void deref() OVERRIDE;
61 78
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 virtual String removeProperty(const String& propertyName, ExceptionState&); 113 virtual String removeProperty(const String& propertyName, ExceptionState&);
97 virtual String cssText() const; 114 virtual String cssText() const;
98 virtual void setCssText(const String&, ExceptionState&); 115 virtual void setCssText(const String&, ExceptionState&);
99 virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID); 116 virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID);
100 virtual String getPropertyValueInternal(CSSPropertyID); 117 virtual String getPropertyValueInternal(CSSPropertyID);
101 virtual void setPropertyInternal(CSSPropertyID, const String& value, bool im portant, ExceptionState&); 118 virtual void setPropertyInternal(CSSPropertyID, const String& value, bool im portant, ExceptionState&);
102 119
103 const HashMap<AtomicString, String>* variableMap() const; 120 const HashMap<AtomicString, String>* variableMap() const;
104 virtual unsigned variableCount() const OVERRIDE; 121 virtual unsigned variableCount() const OVERRIDE;
105 virtual String variableValue(const AtomicString& name) const OVERRIDE; 122 virtual String variableValue(const AtomicString& name) const OVERRIDE;
106 virtual void setVariableValue(const AtomicString& name, const String& value, ExceptionState&) OVERRIDE; 123 virtual bool setVariableValue(const AtomicString& name, const String& value, ExceptionState&) OVERRIDE;
107 virtual bool removeVariable(const AtomicString& name) OVERRIDE; 124 virtual bool removeVariable(const AtomicString& name) OVERRIDE;
108 virtual void clearVariables(ExceptionState&) OVERRIDE; 125 virtual bool clearVariables(ExceptionState&) OVERRIDE;
126 virtual PassRefPtr<CSSVariablesIterator> variablesIterator() const OVERRIDE { return ComputedCSSVariablesIterator::create(variableMap()); }
109 127
110 virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const OVERRI DE; 128 virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const OVERRI DE;
111 129
112 PassRefPtr<CSSValue> valueForShadow(const ShadowData*, CSSPropertyID, const RenderStyle*) const; 130 PassRefPtr<CSSValue> valueForShadow(const ShadowData*, CSSPropertyID, const RenderStyle*) const;
113 PassRefPtr<CSSPrimitiveValue> currentColorOrValidColor(RenderStyle*, const C olor&) const; 131 PassRefPtr<CSSPrimitiveValue> currentColorOrValidColor(RenderStyle*, const C olor&) const;
114 PassRefPtr<SVGPaint> adjustSVGPaintForCurrentColor(PassRefPtr<SVGPaint>, Ren derStyle*) const; 132 PassRefPtr<SVGPaint> adjustSVGPaintForCurrentColor(PassRefPtr<SVGPaint>, Ren derStyle*) const;
115 133
116 PassRefPtr<CSSValue> valueForFilter(const RenderObject*, const RenderStyle*) const; 134 PassRefPtr<CSSValue> valueForFilter(const RenderObject*, const RenderStyle*) const;
117 135
118 PassRefPtr<CSSValueList> valuesForShorthandProperty(const StylePropertyShort hand&) const; 136 PassRefPtr<CSSValueList> valuesForShorthandProperty(const StylePropertyShort hand&) const;
119 PassRefPtr<CSSValueList> valuesForSidesShorthand(const StylePropertyShorthan d&) const; 137 PassRefPtr<CSSValueList> valuesForSidesShorthand(const StylePropertyShorthan d&) const;
120 PassRefPtr<CSSValueList> valuesForBackgroundShorthand() const; 138 PassRefPtr<CSSValueList> valuesForBackgroundShorthand() const;
121 PassRefPtr<CSSValueList> valuesForGridShorthand(const StylePropertyShorthand &) const; 139 PassRefPtr<CSSValueList> valuesForGridShorthand(const StylePropertyShorthand &) const;
122 140
123 RefPtr<Node> m_node; 141 RefPtr<Node> m_node;
124 PseudoId m_pseudoElementSpecifier; 142 PseudoId m_pseudoElementSpecifier;
125 bool m_allowVisitedStyle; 143 bool m_allowVisitedStyle;
126 unsigned m_refCount; 144 unsigned m_refCount;
127 }; 145 };
128 146
129 } // namespace WebCore 147 } // namespace WebCore
130 148
131 #endif // CSSComputedStyleDeclaration_h 149 #endif // CSSComputedStyleDeclaration_h
OLDNEW
« 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