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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h

Issue 2551013002: Removed ordering dependencies for EDisplay (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSValueKeywords.in » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>. 2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>.
3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
5 * (http://www.torchmobile.com/) 5 * (http://www.torchmobile.com/)
6 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 6 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
(...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1264 m_valueID = CSSValueContents; 1264 m_valueID = CSSValueContents;
1265 break; 1265 break;
1266 case EDisplay::None: 1266 case EDisplay::None:
1267 m_valueID = CSSValueNone; 1267 m_valueID = CSSValueNone;
1268 break; 1268 break;
1269 } 1269 }
1270 } 1270 }
1271 1271
1272 template <> 1272 template <>
1273 inline EDisplay CSSIdentifierValue::convertTo() const { 1273 inline EDisplay CSSIdentifierValue::convertTo() const {
1274 if (m_valueID == CSSValueNone) 1274 switch (m_valueID) {
1275 return EDisplay::None; 1275 case CSSValueInline:
1276 1276 return EDisplay::Inline;
1277 if (m_valueID == CSSValueWebkitFlex) 1277 case CSSValueBlock:
1278 return EDisplay::Flex; 1278 return EDisplay::Block;
1279 if (m_valueID == CSSValueWebkitInlineFlex) 1279 case CSSValueListItem:
1280 return EDisplay::InlineFlex; 1280 return EDisplay::ListItem;
1281 1281 case CSSValueInlineBlock:
1282 EDisplay display = static_cast<EDisplay>(m_valueID - CSSValueInline); 1282 return EDisplay::InlineBlock;
1283 // TODO(sashab): Check display is a valid EDisplay here. 1283 case CSSValueTable:
1284 return display; 1284 return EDisplay::Table;
1285 case CSSValueInlineTable:
1286 return EDisplay::InlineTable;
1287 case CSSValueTableRowGroup:
1288 return EDisplay::TableRowGroup;
1289 case CSSValueTableHeaderGroup:
1290 return EDisplay::TableHeaderGroup;
1291 case CSSValueTableFooterGroup:
1292 return EDisplay::TableFooterGroup;
1293 case CSSValueTableRow:
1294 return EDisplay::TableRow;
1295 case CSSValueTableColumnGroup:
1296 return EDisplay::TableColumnGroup;
1297 case CSSValueTableColumn:
1298 return EDisplay::TableColumn;
1299 case CSSValueTableCell:
1300 return EDisplay::TableCell;
1301 case CSSValueTableCaption:
1302 return EDisplay::TableCaption;
1303 case CSSValueWebkitBox:
1304 return EDisplay::WebkitBox;
1305 case CSSValueWebkitInlineBox:
1306 return EDisplay::WebkitInlineBox;
1307 case CSSValueFlex:
1308 case CSSValueWebkitFlex:
1309 return EDisplay::Flex;
1310 case CSSValueInlineFlex:
1311 case CSSValueWebkitInlineFlex:
1312 return EDisplay::InlineFlex;
1313 case CSSValueGrid:
1314 return EDisplay::Grid;
1315 case CSSValueInlineGrid:
1316 return EDisplay::InlineGrid;
1317 case CSSValueContents:
1318 return EDisplay::Contents;
1319 case CSSValueNone:
1320 return EDisplay::None;
1321 break;
1322 default:
1323 NOTREACHED();
1324 return EDisplay::None;
1325 }
1285 } 1326 }
1286 1327
1287 template <> 1328 template <>
1288 inline CSSIdentifierValue::CSSIdentifierValue(EEmptyCells e) 1329 inline CSSIdentifierValue::CSSIdentifierValue(EEmptyCells e)
1289 : CSSValue(IdentifierClass) { 1330 : CSSValue(IdentifierClass) {
1290 switch (e) { 1331 switch (e) {
1291 case EEmptyCells::Show: 1332 case EEmptyCells::Show:
1292 m_valueID = CSSValueShow; 1333 m_valueID = CSSValueShow;
1293 break; 1334 break;
1294 case EEmptyCells::Hide: 1335 case EEmptyCells::Hide:
(...skipping 3449 matching lines...) Expand 10 before | Expand all | Expand 10 after
4744 default: 4785 default:
4745 break; 4786 break;
4746 } 4787 }
4747 ASSERT_NOT_REACHED(); 4788 ASSERT_NOT_REACHED();
4748 return ContainsNone; 4789 return ContainsNone;
4749 } 4790 }
4750 4791
4751 } // namespace blink 4792 } // namespace blink
4752 4793
4753 #endif 4794 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSValueKeywords.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698