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

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: Rebased onto callback change 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 unified diff | Download patch | Annotate | Revision Log
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 HashMap<AtomicString, String>::const_iterator m_it;
esprehn 2013/09/12 01:13:42 A typedef HashMap<AtomicString, String> VariablesM
alancutter (OOO until 2018) 2013/09/13 03:06:14 Done.
65 HashMap<AtomicString, String>::const_iterator m_end;
66 };
67
52 public: 68 public:
53 static PassRefPtr<CSSComputedStyleDeclaration> create(PassRefPtr<Node> node, bool allowVisitedStyle = false, const String& pseudoElementName = String()) 69 static PassRefPtr<CSSComputedStyleDeclaration> create(PassRefPtr<Node> node, bool allowVisitedStyle = false, const String& pseudoElementName = String())
54 { 70 {
55 return adoptRef(new CSSComputedStyleDeclaration(node, allowVisitedStyle, pseudoElementName)); 71 return adoptRef(new CSSComputedStyleDeclaration(node, allowVisitedStyle, pseudoElementName));
56 } 72 }
57 virtual ~CSSComputedStyleDeclaration(); 73 virtual ~CSSComputedStyleDeclaration();
58 74
59 virtual void ref() OVERRIDE; 75 virtual void ref() OVERRIDE;
60 virtual void deref() OVERRIDE; 76 virtual void deref() OVERRIDE;
61 77
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID); 115 virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID);
100 virtual String getPropertyValueInternal(CSSPropertyID); 116 virtual String getPropertyValueInternal(CSSPropertyID);
101 virtual void setPropertyInternal(CSSPropertyID, const String& value, bool im portant, ExceptionState&); 117 virtual void setPropertyInternal(CSSPropertyID, const String& value, bool im portant, ExceptionState&);
102 118
103 const HashMap<AtomicString, String>* variableMap() const; 119 const HashMap<AtomicString, String>* variableMap() const;
104 virtual unsigned variableCount() const OVERRIDE; 120 virtual unsigned variableCount() const OVERRIDE;
105 virtual String variableValue(const AtomicString& name) const OVERRIDE; 121 virtual String variableValue(const AtomicString& name) const OVERRIDE;
106 virtual void setVariableValue(const AtomicString& name, const String& value, ExceptionState&) OVERRIDE; 122 virtual void setVariableValue(const AtomicString& name, const String& value, ExceptionState&) OVERRIDE;
107 virtual bool removeVariable(const AtomicString& name) OVERRIDE; 123 virtual bool removeVariable(const AtomicString& name) OVERRIDE;
108 virtual void clearVariables(ExceptionState&) OVERRIDE; 124 virtual void clearVariables(ExceptionState&) OVERRIDE;
125 virtual PassRefPtr<CSSVariablesIterator> variablesIterator() const OVERRIDE { return ComputedCSSVariablesIterator::create(variableMap()); }
109 126
110 virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const OVERRI DE; 127 virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const OVERRI DE;
111 128
112 PassRefPtr<CSSValue> valueForShadow(const ShadowData*, CSSPropertyID, const RenderStyle*) const; 129 PassRefPtr<CSSValue> valueForShadow(const ShadowData*, CSSPropertyID, const RenderStyle*) const;
113 PassRefPtr<CSSPrimitiveValue> currentColorOrValidColor(RenderStyle*, const C olor&) const; 130 PassRefPtr<CSSPrimitiveValue> currentColorOrValidColor(RenderStyle*, const C olor&) const;
114 PassRefPtr<SVGPaint> adjustSVGPaintForCurrentColor(PassRefPtr<SVGPaint>, Ren derStyle*) const; 131 PassRefPtr<SVGPaint> adjustSVGPaintForCurrentColor(PassRefPtr<SVGPaint>, Ren derStyle*) const;
115 132
116 PassRefPtr<CSSValue> valueForFilter(const RenderObject*, const RenderStyle*) const; 133 PassRefPtr<CSSValue> valueForFilter(const RenderObject*, const RenderStyle*) const;
117 134
118 PassRefPtr<CSSValueList> valuesForShorthandProperty(const StylePropertyShort hand&) const; 135 PassRefPtr<CSSValueList> valuesForShorthandProperty(const StylePropertyShort hand&) const;
119 PassRefPtr<CSSValueList> valuesForSidesShorthand(const StylePropertyShorthan d&) const; 136 PassRefPtr<CSSValueList> valuesForSidesShorthand(const StylePropertyShorthan d&) const;
120 PassRefPtr<CSSValueList> valuesForBackgroundShorthand() const; 137 PassRefPtr<CSSValueList> valuesForBackgroundShorthand() const;
121 PassRefPtr<CSSValueList> valuesForGridShorthand(const StylePropertyShorthand &) const; 138 PassRefPtr<CSSValueList> valuesForGridShorthand(const StylePropertyShorthand &) const;
122 139
123 RefPtr<Node> m_node; 140 RefPtr<Node> m_node;
124 PseudoId m_pseudoElementSpecifier; 141 PseudoId m_pseudoElementSpecifier;
125 bool m_allowVisitedStyle; 142 bool m_allowVisitedStyle;
126 unsigned m_refCount; 143 unsigned m_refCount;
127 }; 144 };
128 145
129 } // namespace WebCore 146 } // namespace WebCore
130 147
131 #endif // CSSComputedStyleDeclaration_h 148 #endif // CSSComputedStyleDeclaration_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698