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

Unified Diff: third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.h

Issue 1590193002: Partial implementation of inline StylePropertyMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@maps
Patch Set: Update tests Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.h
diff --git a/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.h b/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.h
new file mode 100644
index 0000000000000000000000000000000000000000..ec0b0cdfcb277da476c87e392bb407f1ccf2bbf6
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.h
@@ -0,0 +1,55 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef InlineStylePropertyMap_h
+#define InlineStylePropertyMap_h
+
+#include "core/css/cssom/MutableStylePropertyMap.h"
+#include "core/dom/Element.h"
+
+namespace blink {
+
+class CSSValue;
+
+class CORE_EXPORT InlineStylePropertyMap final : public MutableStylePropertyMap {
+ WTF_MAKE_NONCOPYABLE(InlineStylePropertyMap);
+public:
+ explicit InlineStylePropertyMap(Element* ownerElement)
+ : 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.
+ , m_ownerElement(ownerElement)
+ , m_styles() { }
+
+ StyleValue* get(CSSPropertyID) override;
+ HeapVector<Member<StyleValue>> getAll(CSSPropertyID) override;
+ bool has(CSSPropertyID) override;
+ Vector<String> getProperties() override;
+
+ void set(CSSPropertyID, StyleValueOrStyleValueSequenceOrString& item, ExceptionState&) override;
+ void append(CSSPropertyID, StyleValueOrStyleValueSequenceOrString& item, ExceptionState&) override;
+ void remove(CSSPropertyID, ExceptionState&) override;
+
+ void updateProperty(CSSPropertyID, PassRefPtrWillBeRawPtr<CSSValue>);
+ void updateCustomProperty(const String& propertyName, PassRefPtrWillBeRawPtr<CSSValue>);
+ void invalidate()
+ {
+ m_cleanStyles.clear();
+ }
+
+ DEFINE_INLINE_VIRTUAL_TRACE()
+ {
+ MutableStylePropertyMap::trace(visitor);
+ visitor->trace(m_styles);
+ }
+
+private:
+ 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.
+ 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.
+ HashMap<CSSPropertyID, bool> m_cleanStyles;
+
+ HeapVector<Member<StyleValue>>& ensurePropertyList(CSSPropertyID);
+};
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698