Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CSSTokenStreamValue_h | |
| 6 #define CSSTokenStreamValue_h | |
| 7 | |
| 8 #include "bindings/core/v8/Iterable.h" | |
| 9 #include "core/css/cssom/CSSStyleValue.h" | |
| 10 #include "wtf/Vector.h" | |
| 11 | |
| 12 namespace blink { | |
| 13 | |
| 14 class CORE_EXPORT CSSTokenStreamValue final : public CSSStyleValue, public Value Iterable<String> { | |
| 15 WTF_MAKE_NONCOPYABLE(CSSTokenStreamValue); | |
| 16 DEFINE_WRAPPERTYPEINFO(); | |
| 17 public: | |
| 18 static CSSTokenStreamValue* create(const Vector<String>& fragments) | |
| 19 { | |
| 20 return new CSSTokenStreamValue(fragments); | |
| 21 } | |
| 22 | |
| 23 CSSValue* toCSSValue() const override; | |
| 24 | |
| 25 StyleValueType type() const override { return TokenStreamType; } | |
| 26 | |
| 27 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.
| |
| 28 | |
| 29 size_t size() const { return m_fragments.size(); } | |
| 30 | |
| 31 protected: | |
| 32 CSSTokenStreamValue(const Vector<String>& fragments) | |
| 33 : CSSStyleValue() | |
| 34 , m_fragments(fragments) | |
| 35 { | |
| 36 } | |
| 37 | |
| 38 private: | |
| 39 IterationSource* startIteration(ScriptState*, ExceptionState&) override; | |
| 40 | |
| 41 Vector<String> m_fragments; | |
| 42 }; | |
| 43 | |
| 44 } // namespace blink | |
| 45 | |
| 46 #endif // CSSTokenStreamValue_h | |
| OLD | NEW |