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

Side by Side 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 unified diff | Download patch
OLDNEW
(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 fragmentAtIndex(int index) const { return m_fragments.at(index); }
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698