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

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: Remove spurious file Created 4 years, 9 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..d508b688244425bd0a7996e6c9284a91f07f2486
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.h
@@ -0,0 +1,58 @@
+// 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;
+
+typedef HeapVector<Member<StyleValue>> StyleValueVector;
+typedef HeapHashMap<CSSPropertyID, StyleValueVector> StyleVectorMap;
+
+class CORE_EXPORT InlineStylePropertyMap final : public MutableStylePropertyMap {
+ WTF_MAKE_NONCOPYABLE(InlineStylePropertyMap);
+public:
+ explicit InlineStylePropertyMap(Element* ownerElement)
+ : m_ownerElement(ownerElement)
+ , m_styles() { }
+
+ StyleValue* get(CSSPropertyID) override;
+ StyleValueVector getAll(CSSPropertyID) override;
+ bool has(CSSPropertyID) override;
+ Vector<String> getProperties() override;
+
+ void set(CSSPropertyID, StyleValueOrStyleValueSequenceOrString& item, ExceptionState&) override;
Timothy Loh 2016/03/23 03:45:09 no need to give arguments names in declarations if
meade_UTC10 2016/03/29 06:27:37 Done.
+ void append(CSSPropertyID, StyleValueOrStyleValueSequenceOrString& item, ExceptionState&) override;
+ void remove(CSSPropertyID, ExceptionState&) override;
+
+ void updatePropertyIfNeeded(CSSPropertyID);
+ void updateCustomProperty(const String& propertyName, PassRefPtrWillBeRawPtr<CSSValue>);
+ void invalidate()
+ {
+ m_cleanStyles.clear();
+ }
+
+ DEFINE_INLINE_VIRTUAL_TRACE()
+ {
+ visitor->trace(m_ownerElement);
+ visitor->trace(m_styles);
+ MutableStylePropertyMap::trace(visitor);
+ }
+
+private:
+ Member<Element> m_ownerElement;
+ StyleVectorMap m_styles;
+ HashMap<CSSPropertyID, bool> m_cleanStyles;
Timothy Loh 2016/03/23 03:45:09 Are we going to set the bool to false ever? Otherw
meade_UTC10 2016/03/29 06:27:37 Good idea, done.
+
+ StyleValueVector& ensurePropertyList(CSSPropertyID);
+};
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698