Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef InlineStylePropertyMap_h | |
| 6 #define InlineStylePropertyMap_h | |
| 7 | |
| 8 #include "core/css/cssom/MutableStylePropertyMap.h" | |
| 9 #include "core/dom/Element.h" | |
| 10 | |
| 11 namespace blink { | |
| 12 | |
| 13 class CSSValue; | |
| 14 | |
| 15 class CORE_EXPORT InlineStylePropertyMap final : public MutableStylePropertyMap { | |
| 16 WTF_MAKE_NONCOPYABLE(InlineStylePropertyMap); | |
| 17 public: | |
| 18 explicit InlineStylePropertyMap(Element* ownerElement) | |
| 19 : MutableStylePropertyMap() | |
|
Timothy Loh
2016/02/09 07:29:32
no need to explicitly call ctors, this happens any
meade_UTC10
2016/02/10 05:55:39
Done.
| |
| 20 , m_ownerElement(ownerElement) | |
| 21 , m_styles() { } | |
| 22 | |
| 23 StyleValue* get(CSSPropertyID) override; | |
| 24 HeapVector<Member<StyleValue>> getAll(CSSPropertyID) override; | |
| 25 bool has(CSSPropertyID) override; | |
| 26 Vector<String> getProperties() override; | |
| 27 | |
| 28 void set(CSSPropertyID, StyleValueOrStyleValueSequenceOrString& item, Except ionState&) override; | |
| 29 void append(CSSPropertyID, StyleValueOrStyleValueSequenceOrString& item, Exc eptionState&) override; | |
| 30 void remove(CSSPropertyID, ExceptionState&) override; | |
| 31 | |
| 32 void updateProperty(CSSPropertyID, PassRefPtrWillBeRawPtr<CSSValue>); | |
| 33 void updateCustomProperty(const String& propertyName, PassRefPtrWillBeRawPtr <CSSValue>); | |
| 34 void invalidate() | |
| 35 { | |
| 36 m_cleanStyles.clear(); | |
| 37 } | |
| 38 | |
| 39 DEFINE_INLINE_VIRTUAL_TRACE() | |
| 40 { | |
| 41 MutableStylePropertyMap::trace(visitor); | |
| 42 visitor->trace(m_styles); | |
| 43 } | |
| 44 | |
| 45 private: | |
| 46 Element* m_ownerElement; | |
|
Timothy Loh
2016/02/09 07:29:32
Does this need to be a member?
meade_UTC10
2016/02/10 05:55:39
It's used to actually set the styles on the elemen
Timothy Loh
2016/02/10 06:01:31
Err.. I meant Member here.
meade_UTC10
2016/02/10 23:45:18
Oh right. Done.
| |
| 47 HeapHashMap<CSSPropertyID, HeapVector<Member<StyleValue>>> m_styles; | |
|
Timothy Loh
2016/02/09 07:29:32
Probably a good idea to make using declarations fo
meade_UTC10
2016/02/10 05:55:39
Done.
| |
| 48 HashMap<CSSPropertyID, bool> m_cleanStyles; | |
| 49 | |
| 50 HeapVector<Member<StyleValue>>& ensurePropertyList(CSSPropertyID); | |
| 51 }; | |
| 52 | |
| 53 } // namespace blink | |
| 54 | |
| 55 #endif | |
| OLD | NEW |