| 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 typedef HeapVector<Member<StyleValue>> StyleValueVector; |
| 16 typedef HeapHashMap<CSSPropertyID, StyleValueVector> StyleVectorMap; |
| 17 |
| 18 class CORE_EXPORT InlineStylePropertyMap final : public MutableStylePropertyMap
{ |
| 19 WTF_MAKE_NONCOPYABLE(InlineStylePropertyMap); |
| 20 public: |
| 21 explicit InlineStylePropertyMap(Element* ownerElement) |
| 22 : m_ownerElement(ownerElement) |
| 23 , m_styles() { } |
| 24 |
| 25 StyleValue* get(CSSPropertyID) override; |
| 26 StyleValueVector getAll(CSSPropertyID) override; |
| 27 bool has(CSSPropertyID) override; |
| 28 Vector<String> getProperties() override; |
| 29 |
| 30 void set(CSSPropertyID, StyleValueOrStyleValueSequenceOrString& item, Except
ionState&) override; |
| 31 void append(CSSPropertyID, StyleValueOrStyleValueSequenceOrString& item, Exc
eptionState&) override; |
| 32 void remove(CSSPropertyID, ExceptionState&) override; |
| 33 |
| 34 void updatePropertyIfNeeded(CSSPropertyID); |
| 35 void updateCustomProperty(const String& propertyName, PassRefPtrWillBeRawPtr
<CSSValue>); |
| 36 void invalidate() |
| 37 { |
| 38 m_cleanStyles.clear(); |
| 39 } |
| 40 |
| 41 DEFINE_INLINE_VIRTUAL_TRACE() |
| 42 { |
| 43 visitor->trace(m_ownerElement); |
| 44 visitor->trace(m_styles); |
| 45 MutableStylePropertyMap::trace(visitor); |
| 46 } |
| 47 |
| 48 private: |
| 49 Member<Element> m_ownerElement; |
| 50 StyleVectorMap m_styles; |
| 51 HashMap<CSSPropertyID, bool> m_cleanStyles; |
| 52 |
| 53 StyleValueVector& ensurePropertyList(CSSPropertyID); |
| 54 }; |
| 55 |
| 56 } // namespace blink |
| 57 |
| 58 #endif |
| OLD | NEW |