Chromium Code Reviews| 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/cssom/CSSStyleValue.h" | 10 #include "core/css/cssom/CSSStyleValue.h" |
| 11 #include "core/css/parser/CSSParserTokenRange.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 CSSValue&); | |
| 26 | |
| 27 static CSSTokenStreamValue* fromParserTokenRange(CSSParserTokenRange, String Builder&, bool); | |
|
meade_UTC10
2016/08/19 08:43:52
Can this be a private method?
anthonyhkf
2016/08/22 03:19:21
Done.
| |
| 28 | |
| 24 CSSValue* toCSSValue() const override; | 29 CSSValue* toCSSValue() const override; |
| 25 | 30 |
| 26 StyleValueType type() const override { return TokenStreamType; } | 31 StyleValueType type() const override { return TokenStreamType; } |
| 27 | 32 |
| 28 StringOrCSSVariableReferenceValue fragmentAtIndex(int index) const { return m_fragments.at(index); } | 33 StringOrCSSVariableReferenceValue fragmentAtIndex(int index) const { return m_fragments.at(index); } |
| 29 | 34 |
| 30 size_t size() const { return m_fragments.size(); } | 35 size_t size() const { return m_fragments.size(); } |
| 31 | 36 |
| 32 DEFINE_INLINE_VIRTUAL_TRACE() | 37 DEFINE_INLINE_VIRTUAL_TRACE() |
| 33 { | 38 { |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 44 | 49 |
| 45 private: | 50 private: |
| 46 IterationSource* startIteration(ScriptState*, ExceptionState&) override; | 51 IterationSource* startIteration(ScriptState*, ExceptionState&) override; |
| 47 | 52 |
| 48 HeapVector<StringOrCSSVariableReferenceValue> m_fragments; | 53 HeapVector<StringOrCSSVariableReferenceValue> m_fragments; |
| 49 }; | 54 }; |
| 50 | 55 |
| 51 } // namespace blink | 56 } // namespace blink |
| 52 | 57 |
| 53 #endif // CSSTokenStreamValue_h | 58 #endif // CSSTokenStreamValue_h |
| OLD | NEW |