Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: Source/core/rendering/style/GridCoordinate.h

Issue 148293008: [CSS Grid Layout] Add support to place items using named grid lines (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased patch Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 bool operator==(const GridCoordinate& o) const 149 bool operator==(const GridCoordinate& o) const
150 { 150 {
151 return columns == o.columns && rows == o.rows; 151 return columns == o.columns && rows == o.rows;
152 } 152 }
153 153
154 bool operator!=(const GridCoordinate& o) const 154 bool operator!=(const GridCoordinate& o) const
155 { 155 {
156 return !(*this == o); 156 return !(*this == o);
157 } 157 }
158 158
159 GridResolvedPosition positionForSide(GridPositionSide side) const
160 {
161 switch (side) {
162 case ColumnStartSide:
163 return columns.resolvedInitialPosition;
164 case ColumnEndSide:
165 return columns.resolvedFinalPosition;
166 case RowStartSide:
167 return rows.resolvedInitialPosition;
168 case RowEndSide:
169 return rows.resolvedFinalPosition;
170 }
171 ASSERT_NOT_REACHED();
172 return 0;
173 }
174
159 GridSpan columns; 175 GridSpan columns;
160 GridSpan rows; 176 GridSpan rows;
161 }; 177 };
162 178
163 typedef HashMap<String, GridCoordinate> NamedGridAreaMap; 179 typedef HashMap<String, GridCoordinate> NamedGridAreaMap;
164 180
165 } // namespace WebCore 181 } // namespace WebCore
166 182
167 #endif // GridCoordinate_h 183 #endif // GridCoordinate_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698