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

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: Patch for landing v3. Fix for Debug bot 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleBuilderCustom.cpp ('k') | Source/core/rendering/style/GridResolvedPosition.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698