Index: third_party/WebKit/Source/core/css/cssom/CSSTokenStreamValue.h |
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSTokenStreamValue.h b/third_party/WebKit/Source/core/css/cssom/CSSTokenStreamValue.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d57e1804e09aa777a04b52bbf57cde16072c53e9 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/css/cssom/CSSTokenStreamValue.h |
@@ -0,0 +1,54 @@ |
+// 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 CSSTokenStreamValue_h |
+#define CSSTokenStreamValue_h |
+ |
+#include "bindings/core/v8/Iterable.h" |
+#include "bindings/core/v8/ScriptWrappable.h" |
+#include "core/CSSPropertyNames.h" |
+#include "core/CoreExport.h" |
+#include "core/css/CSSCustomIdentValue.h" |
+#include "core/css/CSSPrimitiveValue.h" |
+#include "core/css/cssom/CSSStyleValue.h" |
+#include "core/css/parser/CSSParserTokenRange.h" |
+#include "core/css/parser/CSSPropertyParser.h" |
Timothy Loh
2016/07/19 03:40:20
Some of these includes aren't necessary (also in t
anthonyhkf
2016/07/19 03:55:15
Done.
|
+#include "platform/heap/HeapAllocator.h" |
+#include "wtf/Vector.h" |
+ |
+namespace blink { |
+ |
+class CORE_EXPORT CSSTokenStreamValue final : public CSSStyleValue, public ValueIterable<String> { |
+ WTF_MAKE_NONCOPYABLE(CSSTokenStreamValue); |
+ DEFINE_WRAPPERTYPEINFO(); |
+public: |
+ static CSSTokenStreamValue* create(const Vector<String>& listOfReferences) |
+ { |
+ return new CSSTokenStreamValue(listOfReferences); |
+ } |
+ |
+ CSSValue* toCSSValue() const override; |
+ |
+ StyleValueType type() const override { return TokenStreamType; } |
+ |
+ String referenceAtIndex(int index) { return m_listOfReferences.at(index); } |
Timothy Loh
2016/07/19 03:40:20
referenceAtIndex(..) const
anthonyhkf
2016/07/19 03:55:15
Done.
|
+ |
+ size_t size() { return m_listOfReferences.size(); } |
Timothy Loh
2016/07/19 03:40:20
size() const
anthonyhkf
2016/07/19 03:55:15
Done.
|
+ |
+protected: |
+ CSSTokenStreamValue(Vector<String> listOfReferences) |
Timothy Loh
2016/07/19 03:40:20
const Vector<>& (avoids an extra copy)
anthonyhkf
2016/07/19 03:55:15
Done.
|
+ : CSSStyleValue() |
+ , m_listOfReferences(listOfReferences) |
+ { |
+ } |
+ |
+private: |
+ IterationSource* startIteration(ScriptState*, ExceptionState&) override; |
+ |
+ Vector<String> m_listOfReferences; |
Timothy Loh
2016/07/19 03:40:20
listOf is generally avoided. These (going to be) a
anthonyhkf
2016/07/19 03:55:15
Done.
|
+}; |
+ |
+} // namespace blink |
+ |
+#endif // CSSTokenStreamValue_h |