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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSValueKeywords.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h
diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h b/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h
index 6f80b12fb2b7392860d9d47cd03552cf13daef49..df57d555f7e2bf96ea0046ec4f5d47a815b0a07f 100644
--- a/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h
+++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h
@@ -1271,17 +1271,58 @@ inline CSSIdentifierValue::CSSIdentifierValue(EDisplay e)
template <>
inline EDisplay CSSIdentifierValue::convertTo() const {
- if (m_valueID == CSSValueNone)
- return EDisplay::None;
-
- if (m_valueID == CSSValueWebkitFlex)
- return EDisplay::Flex;
- if (m_valueID == CSSValueWebkitInlineFlex)
- return EDisplay::InlineFlex;
-
- EDisplay display = static_cast<EDisplay>(m_valueID - CSSValueInline);
- // TODO(sashab): Check display is a valid EDisplay here.
- return display;
+ switch (m_valueID) {
+ case CSSValueInline:
+ return EDisplay::Inline;
+ case CSSValueBlock:
+ return EDisplay::Block;
+ case CSSValueListItem:
+ return EDisplay::ListItem;
+ case CSSValueInlineBlock:
+ return EDisplay::InlineBlock;
+ case CSSValueTable:
+ return EDisplay::Table;
+ case CSSValueInlineTable:
+ return EDisplay::InlineTable;
+ case CSSValueTableRowGroup:
+ return EDisplay::TableRowGroup;
+ case CSSValueTableHeaderGroup:
+ return EDisplay::TableHeaderGroup;
+ case CSSValueTableFooterGroup:
+ return EDisplay::TableFooterGroup;
+ case CSSValueTableRow:
+ return EDisplay::TableRow;
+ case CSSValueTableColumnGroup:
+ return EDisplay::TableColumnGroup;
+ case CSSValueTableColumn:
+ return EDisplay::TableColumn;
+ case CSSValueTableCell:
+ return EDisplay::TableCell;
+ case CSSValueTableCaption:
+ return EDisplay::TableCaption;
+ case CSSValueWebkitBox:
+ return EDisplay::WebkitBox;
+ case CSSValueWebkitInlineBox:
+ return EDisplay::WebkitInlineBox;
+ case CSSValueFlex:
+ case CSSValueWebkitFlex:
+ return EDisplay::Flex;
+ case CSSValueInlineFlex:
+ case CSSValueWebkitInlineFlex:
+ return EDisplay::InlineFlex;
+ case CSSValueGrid:
+ return EDisplay::Grid;
+ case CSSValueInlineGrid:
+ return EDisplay::InlineGrid;
+ case CSSValueContents:
+ return EDisplay::Contents;
+ case CSSValueNone:
+ return EDisplay::None;
+ break;
+ default:
+ NOTREACHED();
+ return EDisplay::None;
+ }
}
template <>
« 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