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

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

Issue 2672693002: Moved display property to be generated in ComputedStyleBase. (Closed)
Patch Set: Rebase Created 3 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSProperties.json5 » ('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 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 return VERTICAL; 852 return VERTICAL;
853 default: 853 default:
854 break; 854 break;
855 } 855 }
856 856
857 ASSERT_NOT_REACHED(); 857 ASSERT_NOT_REACHED();
858 return HORIZONTAL; 858 return HORIZONTAL;
859 } 859 }
860 860
861 template <> 861 template <>
862 inline CSSIdentifierValue::CSSIdentifierValue(EDisplay e)
863 : CSSValue(IdentifierClass) {
864 switch (e) {
865 case EDisplay::kInline:
866 m_valueID = CSSValueInline;
867 break;
868 case EDisplay::kBlock:
869 m_valueID = CSSValueBlock;
870 break;
871 case EDisplay::kListItem:
872 m_valueID = CSSValueListItem;
873 break;
874 case EDisplay::kInlineBlock:
875 m_valueID = CSSValueInlineBlock;
876 break;
877 case EDisplay::kTable:
878 m_valueID = CSSValueTable;
879 break;
880 case EDisplay::kInlineTable:
881 m_valueID = CSSValueInlineTable;
882 break;
883 case EDisplay::kTableRowGroup:
884 m_valueID = CSSValueTableRowGroup;
885 break;
886 case EDisplay::kTableHeaderGroup:
887 m_valueID = CSSValueTableHeaderGroup;
888 break;
889 case EDisplay::kTableFooterGroup:
890 m_valueID = CSSValueTableFooterGroup;
891 break;
892 case EDisplay::kTableRow:
893 m_valueID = CSSValueTableRow;
894 break;
895 case EDisplay::kTableColumnGroup:
896 m_valueID = CSSValueTableColumnGroup;
897 break;
898 case EDisplay::kTableColumn:
899 m_valueID = CSSValueTableColumn;
900 break;
901 case EDisplay::kTableCell:
902 m_valueID = CSSValueTableCell;
903 break;
904 case EDisplay::kTableCaption:
905 m_valueID = CSSValueTableCaption;
906 break;
907 case EDisplay::kWebkitBox:
908 m_valueID = CSSValueWebkitBox;
909 break;
910 case EDisplay::kWebkitInlineBox:
911 m_valueID = CSSValueWebkitInlineBox;
912 break;
913 case EDisplay::kFlex:
914 m_valueID = CSSValueFlex;
915 break;
916 case EDisplay::kInlineFlex:
917 m_valueID = CSSValueInlineFlex;
918 break;
919 case EDisplay::kGrid:
920 m_valueID = CSSValueGrid;
921 break;
922 case EDisplay::kInlineGrid:
923 m_valueID = CSSValueInlineGrid;
924 break;
925 case EDisplay::kContents:
926 m_valueID = CSSValueContents;
927 break;
928 case EDisplay::kFlowRoot:
929 m_valueID = CSSValueFlowRoot;
930 break;
931 case EDisplay::kNone:
932 m_valueID = CSSValueNone;
933 break;
934 }
935 }
936
937 template <>
938 inline EDisplay CSSIdentifierValue::convertTo() const {
939 switch (m_valueID) {
940 case CSSValueInline:
941 return EDisplay::kInline;
942 case CSSValueBlock:
943 return EDisplay::kBlock;
944 case CSSValueListItem:
945 return EDisplay::kListItem;
946 case CSSValueInlineBlock:
947 return EDisplay::kInlineBlock;
948 case CSSValueTable:
949 return EDisplay::kTable;
950 case CSSValueInlineTable:
951 return EDisplay::kInlineTable;
952 case CSSValueTableRowGroup:
953 return EDisplay::kTableRowGroup;
954 case CSSValueTableHeaderGroup:
955 return EDisplay::kTableHeaderGroup;
956 case CSSValueTableFooterGroup:
957 return EDisplay::kTableFooterGroup;
958 case CSSValueTableRow:
959 return EDisplay::kTableRow;
960 case CSSValueTableColumnGroup:
961 return EDisplay::kTableColumnGroup;
962 case CSSValueTableColumn:
963 return EDisplay::kTableColumn;
964 case CSSValueTableCell:
965 return EDisplay::kTableCell;
966 case CSSValueTableCaption:
967 return EDisplay::kTableCaption;
968 case CSSValueWebkitBox:
969 return EDisplay::kWebkitBox;
970 case CSSValueWebkitInlineBox:
971 return EDisplay::kWebkitInlineBox;
972 case CSSValueFlex:
973 case CSSValueWebkitFlex:
974 return EDisplay::kFlex;
975 case CSSValueInlineFlex:
976 case CSSValueWebkitInlineFlex:
977 return EDisplay::kInlineFlex;
978 case CSSValueGrid:
979 return EDisplay::kGrid;
980 case CSSValueInlineGrid:
981 return EDisplay::kInlineGrid;
982 case CSSValueContents:
983 return EDisplay::kContents;
984 case CSSValueFlowRoot:
985 return EDisplay::kFlowRoot;
986 case CSSValueNone:
987 return EDisplay::kNone;
988 break;
989 default:
990 NOTREACHED();
991 return EDisplay::kNone;
992 }
993 }
994
995 template <>
996 inline CSSIdentifierValue::CSSIdentifierValue(EFlexDirection e) 862 inline CSSIdentifierValue::CSSIdentifierValue(EFlexDirection e)
997 : CSSValue(IdentifierClass) { 863 : CSSValue(IdentifierClass) {
998 switch (e) { 864 switch (e) {
999 case FlowRow: 865 case FlowRow:
1000 m_valueID = CSSValueRow; 866 m_valueID = CSSValueRow;
1001 break; 867 break;
1002 case FlowRowReverse: 868 case FlowRowReverse:
1003 m_valueID = CSSValueRowReverse; 869 m_valueID = CSSValueRowReverse;
1004 break; 870 break;
1005 case FlowColumn: 871 case FlowColumn:
(...skipping 2537 matching lines...) Expand 10 before | Expand all | Expand 10 after
3543 default: 3409 default:
3544 break; 3410 break;
3545 } 3411 }
3546 ASSERT_NOT_REACHED(); 3412 ASSERT_NOT_REACHED();
3547 return ContainsNone; 3413 return ContainsNone;
3548 } 3414 }
3549 3415
3550 } // namespace blink 3416 } // namespace blink
3551 3417
3552 #endif 3418 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSProperties.json5 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698