| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CSSTokenStreamValue_h | 5 #ifndef CSSTokenStreamValue_h |
| 6 #define CSSTokenStreamValue_h | 6 #define CSSTokenStreamValue_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/Iterable.h" | 8 #include "bindings/core/v8/Iterable.h" |
| 9 #include "bindings/core/v8/StringOrCSSVariableReferenceValue.h" | 9 #include "bindings/core/v8/StringOrCSSVariableReferenceValue.h" |
| 10 #include "core/css/CSSVariableReferenceValue.h" |
| 10 #include "core/css/cssom/CSSStyleValue.h" | 11 #include "core/css/cssom/CSSStyleValue.h" |
| 11 #include "wtf/Vector.h" | 12 #include "wtf/Vector.h" |
| 12 | 13 |
| 13 namespace blink { | 14 namespace blink { |
| 14 | 15 |
| 15 class CORE_EXPORT CSSTokenStreamValue final : public CSSStyleValue, public Value
Iterable<StringOrCSSVariableReferenceValue> { | 16 class CORE_EXPORT CSSTokenStreamValue final : public CSSStyleValue, public Value
Iterable<StringOrCSSVariableReferenceValue> { |
| 16 WTF_MAKE_NONCOPYABLE(CSSTokenStreamValue); | 17 WTF_MAKE_NONCOPYABLE(CSSTokenStreamValue); |
| 17 DEFINE_WRAPPERTYPEINFO(); | 18 DEFINE_WRAPPERTYPEINFO(); |
| 18 public: | 19 public: |
| 19 static CSSTokenStreamValue* create(const HeapVector<StringOrCSSVariableRefer
enceValue>& fragments) | 20 static CSSTokenStreamValue* create(const HeapVector<StringOrCSSVariableRefer
enceValue>& fragments) |
| 20 { | 21 { |
| 21 return new CSSTokenStreamValue(fragments); | 22 return new CSSTokenStreamValue(fragments); |
| 22 } | 23 } |
| 23 | 24 |
| 25 static CSSTokenStreamValue* fromCSSValue(const CSSVariableReferenceValue&); |
| 26 |
| 24 CSSValue* toCSSValue() const override; | 27 CSSValue* toCSSValue() const override; |
| 25 | 28 |
| 26 StyleValueType type() const override { return TokenStreamType; } | 29 StyleValueType type() const override { return TokenStreamType; } |
| 27 | 30 |
| 28 StringOrCSSVariableReferenceValue fragmentAtIndex(int index) const { return
m_fragments.at(index); } | 31 StringOrCSSVariableReferenceValue fragmentAtIndex(int index) const { return
m_fragments.at(index); } |
| 29 | 32 |
| 30 size_t size() const { return m_fragments.size(); } | 33 size_t size() const { return m_fragments.size(); } |
| 31 | 34 |
| 32 DEFINE_INLINE_VIRTUAL_TRACE() | 35 DEFINE_INLINE_VIRTUAL_TRACE() |
| 33 { | 36 { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 44 | 47 |
| 45 private: | 48 private: |
| 46 IterationSource* startIteration(ScriptState*, ExceptionState&) override; | 49 IterationSource* startIteration(ScriptState*, ExceptionState&) override; |
| 47 | 50 |
| 48 HeapVector<StringOrCSSVariableReferenceValue> m_fragments; | 51 HeapVector<StringOrCSSVariableReferenceValue> m_fragments; |
| 49 }; | 52 }; |
| 50 | 53 |
| 51 } // namespace blink | 54 } // namespace blink |
| 52 | 55 |
| 53 #endif // CSSTokenStreamValue_h | 56 #endif // CSSTokenStreamValue_h |
| OLD | NEW |