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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 m_integerPosition = position; | 75 m_integerPosition = position; |
76 m_namedGridLine = namedGridLine; | 76 m_namedGridLine = namedGridLine; |
77 } | 77 } |
78 | 78 |
79 void setNamedGridArea(const AtomicString& namedGridArea) { | 79 void setNamedGridArea(const AtomicString& namedGridArea) { |
80 m_type = NamedGridAreaPosition; | 80 m_type = NamedGridAreaPosition; |
81 m_namedGridLine = namedGridArea; | 81 m_namedGridLine = namedGridArea; |
82 } | 82 } |
83 | 83 |
84 int integerPosition() const { | 84 int integerPosition() const { |
85 ASSERT(type() == ExplicitPosition); | 85 DCHECK_EQ(type(), ExplicitPosition); |
86 return m_integerPosition; | 86 return m_integerPosition; |
87 } | 87 } |
88 | 88 |
89 AtomicString namedGridLine() const { | 89 AtomicString namedGridLine() const { |
90 ASSERT(type() == ExplicitPosition || type() == SpanPosition || | 90 DCHECK(type() == ExplicitPosition || type() == SpanPosition || |
91 type() == NamedGridAreaPosition); | 91 type() == NamedGridAreaPosition); |
92 return m_namedGridLine; | 92 return m_namedGridLine; |
93 } | 93 } |
94 | 94 |
95 int spanPosition() const { | 95 int spanPosition() const { |
96 ASSERT(type() == SpanPosition); | 96 DCHECK_EQ(type(), SpanPosition); |
97 return m_integerPosition; | 97 return m_integerPosition; |
98 } | 98 } |
99 | 99 |
100 bool operator==(const GridPosition& other) const { | 100 bool operator==(const GridPosition& other) const { |
101 return m_type == other.m_type && | 101 return m_type == other.m_type && |
102 m_integerPosition == other.m_integerPosition && | 102 m_integerPosition == other.m_integerPosition && |
103 m_namedGridLine == other.m_namedGridLine; | 103 m_namedGridLine == other.m_namedGridLine; |
104 } | 104 } |
105 | 105 |
106 bool shouldBeResolvedAgainstOppositePosition() const { | 106 bool shouldBeResolvedAgainstOppositePosition() const { |
107 return isAuto() || isSpan(); | 107 return isAuto() || isSpan(); |
108 } | 108 } |
109 | 109 |
110 private: | 110 private: |
111 GridPositionType m_type; | 111 GridPositionType m_type; |
112 int m_integerPosition; | 112 int m_integerPosition; |
113 AtomicString m_namedGridLine; | 113 AtomicString m_namedGridLine; |
114 }; | 114 }; |
115 | 115 |
116 } // namespace blink | 116 } // namespace blink |
117 | 117 |
118 #endif // GridPosition_h | 118 #endif // GridPosition_h |
OLD | NEW |