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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 bool operator==(const GridCoordinate& o) const | 148 bool operator==(const GridCoordinate& o) const |
149 { | 149 { |
150 return columns == o.columns && rows == o.rows; | 150 return columns == o.columns && rows == o.rows; |
151 } | 151 } |
152 | 152 |
153 bool operator!=(const GridCoordinate& o) const | 153 bool operator!=(const GridCoordinate& o) const |
154 { | 154 { |
155 return !(*this == o); | 155 return !(*this == o); |
156 } | 156 } |
157 | 157 |
| 158 GridResolvedPosition positionForSide(GridPositionSide side) const |
| 159 { |
| 160 switch (side) { |
| 161 case ColumnStartSide: |
| 162 return columns.resolvedInitialPosition; |
| 163 case ColumnEndSide: |
| 164 return columns.resolvedFinalPosition; |
| 165 case RowStartSide: |
| 166 return rows.resolvedInitialPosition; |
| 167 case RowEndSide: |
| 168 return rows.resolvedFinalPosition; |
| 169 } |
| 170 ASSERT_NOT_REACHED(); |
| 171 return 0; |
| 172 } |
| 173 |
158 GridSpan columns; | 174 GridSpan columns; |
159 GridSpan rows; | 175 GridSpan rows; |
160 }; | 176 }; |
161 | 177 |
162 typedef HashMap<String, GridCoordinate> NamedGridAreaMap; | 178 typedef HashMap<String, GridCoordinate> NamedGridAreaMap; |
163 | 179 |
164 } // namespace WebCore | 180 } // namespace WebCore |
165 | 181 |
166 #endif // GridCoordinate_h | 182 #endif // GridCoordinate_h |
OLD | NEW |