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

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

Issue 2122193003: [Typed-OM] Add CSSTokenStreamValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test for CSSTokenStreamValue Created 4 years, 5 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/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..3ffe8c069429b6176e0afe0ae7b1f2966ba26e25
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/cssom/CSSTokenStreamValue.h
@@ -0,0 +1,46 @@
+// 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 "core/css/cssom/CSSStyleValue.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>& fragments)
+ {
+ return new CSSTokenStreamValue(fragments);
+ }
+
+ CSSValue* toCSSValue() const override;
+
+ StyleValueType type() const override { return TokenStreamType; }
+
+ String fragmentAtIndex(int index) const { return m_fragments.at(index); }
+
+ size_t size() const { return m_fragments.size(); }
+
+protected:
+ CSSTokenStreamValue(const Vector<String>& fragments)
+ : CSSStyleValue()
+ , m_fragments(fragments)
+ {
+ }
+
+private:
+ IterationSource* startIteration(ScriptState*, ExceptionState&) override;
+
+ Vector<String> m_fragments;
+};
+
+} // namespace blink
+
+#endif // CSSTokenStreamValue_h

Powered by Google App Engine
This is Rietveld 408576698