OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 bool operator==(const GridCoordinate& o) const | 136 bool operator==(const GridCoordinate& o) const |
137 { | 137 { |
138 return columns == o.columns && rows == o.rows; | 138 return columns == o.columns && rows == o.rows; |
139 } | 139 } |
140 | 140 |
141 bool operator!=(const GridCoordinate& o) const | 141 bool operator!=(const GridCoordinate& o) const |
142 { | 142 { |
143 return !(*this == o); | 143 return !(*this == o); |
144 } | 144 } |
145 | 145 |
| 146 size_t positionForSide(GridPositionSide side) const |
| 147 { |
| 148 switch (side) { |
| 149 case ColumnStartSide: |
| 150 return columns.initialPositionIndex; |
| 151 case ColumnEndSide: |
| 152 return columns.finalPositionIndex; |
| 153 case RowStartSide: |
| 154 return rows.initialPositionIndex; |
| 155 case RowEndSide: |
| 156 return rows.finalPositionIndex; |
| 157 } |
| 158 ASSERT_NOT_REACHED(); |
| 159 return 0; |
| 160 } |
| 161 |
146 GridSpan columns; | 162 GridSpan columns; |
147 GridSpan rows; | 163 GridSpan rows; |
148 }; | 164 }; |
149 | 165 |
150 typedef HashMap<String, GridCoordinate> NamedGridAreaMap; | 166 typedef HashMap<String, GridCoordinate> NamedGridAreaMap; |
151 | 167 |
| 168 enum GridTrackSizingDirection { |
| 169 ForColumns, |
| 170 ForRows |
| 171 }; |
| 172 |
152 } // namespace WebCore | 173 } // namespace WebCore |
153 | 174 |
154 #endif // GridCoordinate_h | 175 #endif // GridCoordinate_h |
OLD | NEW |