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

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

Issue 1582963004: Add outline files for StylePropertyMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make more functions pure virtual Created 4 years, 11 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/StylePropertyMap.h
diff --git a/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.h b/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.h
new file mode 100644
index 0000000000000000000000000000000000000000..51dab82f2e684ce40b95ddff57e2fc1cb12f3a11
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.h
@@ -0,0 +1,65 @@
+// 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 StylePropertyMap_h
+#define StylePropertyMap_h
+
+#include "bindings/core/v8/Iterable.h"
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "bindings/core/v8/UnionTypesCore.h"
+#include "core/CSSPropertyNames.h"
+#include "core/CoreExport.h"
+#include "core/css/cssom/StyleValue.h"
+
+namespace blink {
+
+class ExceptionState;
+
+class CORE_EXPORT StylePropertyMap : public GarbageCollectedFinalized<StylePropertyMap>, public ScriptWrappable, public PairIterable<String, StyleValueOrStyleValueSequence> {
+ WTF_MAKE_NONCOPYABLE(StylePropertyMap);
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ // Accessors.
+ virtual StyleValue* get(const String& propertyName);
+ virtual StyleValue* get(CSSPropertyID) = 0;
+ virtual HeapVector<StyleValue*> getAll(const String& propertyName) = 0;
+ virtual Vector<String> getProperties() = 0;
+ virtual bool has(const String& propertyName) = 0;
+
+ // Modifiers.
+ virtual void set(const String& propertyName, StyleValueOrStyleValueSequenceOrString& item, ExceptionState&);
+ virtual void set(CSSPropertyID, StyleValueOrStyleValueSequenceOrString& item, ExceptionState&) = 0;
+ virtual void append(const String& propertyName, StyleValueOrStyleValueSequenceOrString& item, ExceptionState&) = 0;
+ virtual void remove(const String& propertyName, ExceptionState&) = 0;
+
+ DEFINE_INLINE_VIRTUAL_TRACE() { }
+
+protected:
+ StylePropertyMap() {}
+};
+
+class CORE_EXPORT MutableStylePropertyMap : public StylePropertyMap {
+};
+
+class CORE_EXPORT ImmutableStylePropertyMap : public StylePropertyMap {
Timothy Loh 2016/01/18 03:47:23 Classes should be in their own files.
meade_UTC10 2016/01/19 00:15:19 Done.
+public:
+ void set(CSSPropertyID, StyleValueOrStyleValueSequenceOrString&, ExceptionState& exceptionState) override
+ {
+ exceptionState.throwTypeError("This StylePropertyMap is immutable.");
+ }
+
+ void append(const String& propertyName, StyleValueOrStyleValueSequenceOrString&, ExceptionState& exceptionState) override
+ {
+ exceptionState.throwTypeError("This StylePropertyMap is immutable.");
+ }
+
+ void remove(const String& propertyName, ExceptionState& exceptionState) override
+ {
+ exceptionState.throwTypeError("This StylePropertyMap is immutable.");
+ }
+};
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698