Chromium Code Reviews| 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..9d8adaea7ae64d6b7f65b1bc0235d1025741f65a |
| --- /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 referenceAtIndex(int index) const { return m_fragments.at(index); } |
|
meade_UTC10
2016/07/19 04:37:42
To be consistent, this should now be fragmentAtInd
anthonyhkf
2016/07/20 07:05:46
Done.
|
| + |
| + 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 |