OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CSSPathValue_h | 5 #ifndef CSSPathValue_h |
6 #define CSSPathValue_h | 6 #define CSSPathValue_h |
7 | 7 |
8 #include "core/css/CSSValue.h" | 8 #include "core/css/CSSValue.h" |
9 #include "core/style/StylePath.h" | 9 #include "core/style/StylePath.h" |
10 #include "core/svg/SVGPathByteStream.h" | 10 #include "core/svg/SVGPathByteStream.h" |
11 #include "wtf/PassRefPtr.h" | 11 #include "wtf/PassRefPtr.h" |
12 #include "wtf/RefPtr.h" | 12 #include "wtf/RefPtr.h" |
13 #include <memory> | |
14 | 13 |
15 namespace blink { | 14 namespace blink { |
16 | 15 |
17 class StylePath; | 16 class StylePath; |
18 | 17 |
19 class CSSPathValue : public CSSValue { | 18 class CSSPathValue : public CSSValue { |
20 public: | 19 public: |
21 static CSSPathValue* create(PassRefPtr<StylePath>); | 20 static CSSPathValue* create(PassRefPtr<StylePath>); |
22 static CSSPathValue* create(std::unique_ptr<SVGPathByteStream>); | 21 static CSSPathValue* create(PassOwnPtr<SVGPathByteStream>); |
23 | 22 |
24 static CSSPathValue& emptyPathValue(); | 23 static CSSPathValue& emptyPathValue(); |
25 | 24 |
26 StylePath* stylePath() const { return m_stylePath.get(); } | 25 StylePath* stylePath() const { return m_stylePath.get(); } |
27 String customCSSText() const; | 26 String customCSSText() const; |
28 | 27 |
29 bool equals(const CSSPathValue&) const; | 28 bool equals(const CSSPathValue&) const; |
30 | 29 |
31 DECLARE_TRACE_AFTER_DISPATCH(); | 30 DECLARE_TRACE_AFTER_DISPATCH(); |
32 | 31 |
33 const SVGPathByteStream& byteStream() const { return m_stylePath->byteStream
(); } | 32 const SVGPathByteStream& byteStream() const { return m_stylePath->byteStream
(); } |
34 | 33 |
35 private: | 34 private: |
36 CSSPathValue(PassRefPtr<StylePath>); | 35 CSSPathValue(PassRefPtr<StylePath>); |
37 | 36 |
38 RefPtr<StylePath> m_stylePath; | 37 RefPtr<StylePath> m_stylePath; |
39 }; | 38 }; |
40 | 39 |
41 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPathValue, isPathValue()); | 40 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPathValue, isPathValue()); |
42 | 41 |
43 } // namespace blink | 42 } // namespace blink |
44 | 43 |
45 #endif // CSSPathValue_h | 44 #endif // CSSPathValue_h |
OLD | NEW |