Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef StylePropertyMap_h | 5 #ifndef StylePropertyMap_h |
| 6 #define StylePropertyMap_h | 6 #define StylePropertyMap_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/CSSStyleValueOrCSSStyleValueSequence.h" | 8 #include "bindings/core/v8/CSSStyleValueOrCSSStyleValueSequence.h" |
| 9 #include "bindings/core/v8/CSSStyleValueOrCSSStyleValueSequenceOrString.h" | 9 #include "bindings/core/v8/CSSStyleValueOrCSSStyleValueSequenceOrString.h" |
| 10 #include "bindings/core/v8/Iterable.h" | 10 #include "bindings/core/v8/Iterable.h" |
| 11 #include "bindings/core/v8/ScriptWrappable.h" | 11 #include "bindings/core/v8/ScriptWrappable.h" |
| 12 #include "core/CSSPropertyNames.h" | 12 #include "core/CSSPropertyNames.h" |
| 13 #include "core/CoreExport.h" | 13 #include "core/CoreExport.h" |
| 14 #include "core/css/cssom/CSSStyleValue.h" | 14 #include "core/css/cssom/CSSStyleValue.h" |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 class ExceptionState; | 18 class ExceptionState; |
| 19 | 19 |
| 20 class CORE_EXPORT StylePropertyMap : public GarbageCollectedFinalized<StylePrope rtyMap>, public ScriptWrappable, public PairIterable<String, CSSStyleValueOrCSSS tyleValueSequence> { | 20 class CORE_EXPORT StylePropertyMap : public GarbageCollectedFinalized<StylePrope rtyMap>, public ScriptWrappable, public PairIterable<String, CSSStyleValueOrCSSS tyleValueSequence> { |
| 21 WTF_MAKE_NONCOPYABLE(StylePropertyMap); | 21 WTF_MAKE_NONCOPYABLE(StylePropertyMap); |
| 22 DEFINE_WRAPPERTYPEINFO(); | 22 DEFINE_WRAPPERTYPEINFO(); |
| 23 public: | 23 public: |
| 24 typedef std::pair<String, CSSStyleValueOrCSSStyleValueSequence> StylePropert yMapEntry; | 24 typedef std::pair<String, CSSStyleValueOrCSSStyleValueSequence> StylePropert yMapEntry; |
| 25 | 25 |
| 26 virtual ~StylePropertyMap() { } | 26 virtual ~StylePropertyMap() { } |
| 27 | 27 |
| 28 // Accessors. | 28 // Accessors. |
| 29 CSSStyleValue* get(const String& propertyName, ExceptionState&); | 29 virtual CSSStyleValue* get(const String& propertyName, ExceptionState&); |
| 30 CSSStyleValueVector getAll(const String& propertyName, ExceptionState&); | 30 virtual CSSStyleValueVector getAll(const String& propertyName, ExceptionStat e&); |
| 31 bool has(const String& propertyName, ExceptionState&); | 31 virtual bool has(const String& propertyName, ExceptionState&); |
| 32 | 32 |
| 33 virtual CSSStyleValueVector getAll(CSSPropertyID) = 0; | |
| 34 virtual Vector<String> getProperties() = 0; | 33 virtual Vector<String> getProperties() = 0; |
| 35 | 34 |
| 36 // Modifiers. | 35 // Modifiers. |
| 37 void set(const String& propertyName, CSSStyleValueOrCSSStyleValueSequenceOrS tring& item, ExceptionState&); | 36 void set(const String& propertyName, CSSStyleValueOrCSSStyleValueSequenceOrS tring& item, ExceptionState&); |
| 38 void append(const String& propertyName, CSSStyleValueOrCSSStyleValueSequence OrString& item, ExceptionState&); | 37 void append(const String& propertyName, CSSStyleValueOrCSSStyleValueSequence OrString& item, ExceptionState&); |
| 39 void remove(const String& propertyName, ExceptionState&); | 38 void remove(const String& propertyName, ExceptionState&); |
| 40 | 39 |
| 41 virtual void set(CSSPropertyID, CSSStyleValueOrCSSStyleValueSequenceOrString & item, ExceptionState&) = 0; | 40 virtual void set(CSSPropertyID, CSSStyleValueOrCSSStyleValueSequenceOrString & item, ExceptionState&) = 0; |
| 42 virtual void append(CSSPropertyID, CSSStyleValueOrCSSStyleValueSequenceOrStr ing& item, ExceptionState&) = 0; | 41 virtual void append(CSSPropertyID, CSSStyleValueOrCSSStyleValueSequenceOrStr ing& item, ExceptionState&) = 0; |
| 43 virtual void remove(CSSPropertyID, ExceptionState&) = 0; | 42 virtual void remove(CSSPropertyID, ExceptionState&) = 0; |
| 44 | 43 |
| 45 DEFINE_INLINE_VIRTUAL_TRACE() { } | 44 DEFINE_INLINE_VIRTUAL_TRACE() { } |
| 46 | 45 |
| 47 protected: | 46 protected: |
| 48 StylePropertyMap() { } | 47 StylePropertyMap() { } |
| 49 | 48 |
| 49 virtual CSSStyleValueVector getAllInternal(CSSPropertyID) = 0; | |
| 50 virtual CSSStyleValueVector getAllInternal(AtomicString customPropertyName) = 0; | |
|
ikilpatrick
2016/06/09 02:28:47
Renamed to internal as public virtual hiding.
| |
| 51 | |
| 50 virtual HeapVector<StylePropertyMapEntry> getIterationEntries() = 0; | 52 virtual HeapVector<StylePropertyMapEntry> getIterationEntries() = 0; |
| 51 IterationSource* startIteration(ScriptState*, ExceptionState&) override; | 53 IterationSource* startIteration(ScriptState*, ExceptionState&) override; |
| 52 }; | 54 }; |
| 53 | 55 |
| 54 } // namespace blink | 56 } // namespace blink |
| 55 | 57 |
| 56 #endif | 58 #endif |
| OLD | NEW |