OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef GridPosition_h | 31 #ifndef GridPosition_h |
32 #define GridPosition_h | 32 #define GridPosition_h |
33 | 33 |
| 34 #include "wtf/Allocator.h" |
34 #include "wtf/text/WTFString.h" | 35 #include "wtf/text/WTFString.h" |
35 | 36 |
36 namespace blink { | 37 namespace blink { |
37 | 38 |
38 enum GridPositionType { | 39 enum GridPositionType { |
39 AutoPosition, | 40 AutoPosition, |
40 ExplicitPosition, // [ <integer> || <string> ] | 41 ExplicitPosition, // [ <integer> || <string> ] |
41 SpanPosition, // span && [ <integer> || <string> ] | 42 SpanPosition, // span && [ <integer> || <string> ] |
42 NamedGridAreaPosition // <ident> | 43 NamedGridAreaPosition // <ident> |
43 }; | 44 }; |
44 | 45 |
45 class GridPosition { | 46 class GridPosition { |
| 47 DISALLOW_ALLOCATION(); |
46 public: | 48 public: |
47 GridPosition() | 49 GridPosition() |
48 : m_type(AutoPosition) | 50 : m_type(AutoPosition) |
49 , m_integerPosition(0) | 51 , m_integerPosition(0) |
50 { | 52 { |
51 } | 53 } |
52 | 54 |
53 bool isPositive() const { return integerPosition() > 0; } | 55 bool isPositive() const { return integerPosition() > 0; } |
54 | 56 |
55 GridPositionType type() const { return m_type; } | 57 GridPositionType type() const { return m_type; } |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 } | 117 } |
116 private: | 118 private: |
117 GridPositionType m_type; | 119 GridPositionType m_type; |
118 int m_integerPosition; | 120 int m_integerPosition; |
119 String m_namedGridLine; | 121 String m_namedGridLine; |
120 }; | 122 }; |
121 | 123 |
122 } // namespace blink | 124 } // namespace blink |
123 | 125 |
124 #endif // GridPosition_h | 126 #endif // GridPosition_h |
OLD | NEW |