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

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: Added license header 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 "bindings/core/v8/ScriptWrappable.h"
10 #include "core/CSSPropertyNames.h"
11 #include "core/CoreExport.h"
12 #include "core/css/CSSCustomIdentValue.h"
13 #include "core/css/CSSPrimitiveValue.h"
14 #include "core/css/cssom/CSSStyleValue.h"
15 #include "core/css/parser/CSSParserTokenRange.h"
16 #include "core/css/parser/CSSPropertyParser.h"
Timothy Loh 2016/07/19 03:40:20 Some of these includes aren't necessary (also in t
anthonyhkf 2016/07/19 03:55:15 Done.
17 #include "platform/heap/HeapAllocator.h"
18 #include "wtf/Vector.h"
19
20 namespace blink {
21
22 class CORE_EXPORT CSSTokenStreamValue final : public CSSStyleValue, public Value Iterable<String> {
23 WTF_MAKE_NONCOPYABLE(CSSTokenStreamValue);
24 DEFINE_WRAPPERTYPEINFO();
25 public:
26 static CSSTokenStreamValue* create(const Vector<String>& listOfReferences)
27 {
28 return new CSSTokenStreamValue(listOfReferences);
29 }
30
31 CSSValue* toCSSValue() const override;
32
33 StyleValueType type() const override { return TokenStreamType; }
34
35 String referenceAtIndex(int index) { return m_listOfReferences.at(index); }
Timothy Loh 2016/07/19 03:40:20 referenceAtIndex(..) const
anthonyhkf 2016/07/19 03:55:15 Done.
36
37 size_t size() { return m_listOfReferences.size(); }
Timothy Loh 2016/07/19 03:40:20 size() const
anthonyhkf 2016/07/19 03:55:15 Done.
38
39 protected:
40 CSSTokenStreamValue(Vector<String> listOfReferences)
Timothy Loh 2016/07/19 03:40:20 const Vector<>& (avoids an extra copy)
anthonyhkf 2016/07/19 03:55:15 Done.
41 : CSSStyleValue()
42 , m_listOfReferences(listOfReferences)
43 {
44 }
45
46 private:
47 IterationSource* startIteration(ScriptState*, ExceptionState&) override;
48
49 Vector<String> m_listOfReferences;
Timothy Loh 2016/07/19 03:40:20 listOf is generally avoided. These (going to be) a
anthonyhkf 2016/07/19 03:55:15 Done.
50 };
51
52 } // namespace blink
53
54 #endif // CSSTokenStreamValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698