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

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

Issue 2911383002: Generate enum/getters/setters/mappings for line-break. (Closed)
Patch Set: Created 3 years, 6 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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 return EFloat::kNone; 867 return EFloat::kNone;
868 default: 868 default:
869 break; 869 break;
870 } 870 }
871 871
872 NOTREACHED(); 872 NOTREACHED();
873 return EFloat::kNone; 873 return EFloat::kNone;
874 } 874 }
875 875
876 template <> 876 template <>
877 inline CSSIdentifierValue::CSSIdentifierValue(LineBreak e)
878 : CSSValue(kIdentifierClass) {
879 switch (e) {
880 case LineBreak::kAuto:
881 value_id_ = CSSValueAuto;
882 break;
883 case LineBreak::kLoose:
884 value_id_ = CSSValueLoose;
885 break;
886 case LineBreak::kNormal:
887 value_id_ = CSSValueNormal;
888 break;
889 case LineBreak::kStrict:
890 value_id_ = CSSValueStrict;
891 break;
892 case LineBreak::kAfterWhiteSpace:
893 value_id_ = CSSValueAfterWhiteSpace;
894 break;
895 }
896 }
897
898 template <>
899 inline LineBreak CSSIdentifierValue::ConvertTo() const {
900 switch (value_id_) {
901 case CSSValueAuto:
902 return LineBreak::kAuto;
903 case CSSValueLoose:
904 return LineBreak::kLoose;
905 case CSSValueNormal:
906 return LineBreak::kNormal;
907 case CSSValueStrict:
908 return LineBreak::kStrict;
909 case CSSValueAfterWhiteSpace:
910 return LineBreak::kAfterWhiteSpace;
911 default:
912 break;
913 }
914
915 NOTREACHED();
916 return LineBreak::kAuto;
917 }
918
919 template <>
920 inline CSSIdentifierValue::CSSIdentifierValue(EMarginCollapse e) 877 inline CSSIdentifierValue::CSSIdentifierValue(EMarginCollapse e)
921 : CSSValue(kIdentifierClass) { 878 : CSSValue(kIdentifierClass) {
922 switch (e) { 879 switch (e) {
923 case kMarginCollapseCollapse: 880 case kMarginCollapseCollapse:
924 value_id_ = CSSValueCollapse; 881 value_id_ = CSSValueCollapse;
925 break; 882 break;
926 case kMarginCollapseSeparate: 883 case kMarginCollapseSeparate:
927 value_id_ = CSSValueSeparate; 884 value_id_ = CSSValueSeparate;
928 break; 885 break;
929 case kMarginCollapseDiscard: 886 case kMarginCollapseDiscard:
(...skipping 2150 matching lines...) Expand 10 before | Expand all | Expand 10 after
3080 default: 3037 default:
3081 break; 3038 break;
3082 } 3039 }
3083 NOTREACHED(); 3040 NOTREACHED();
3084 return kContainsNone; 3041 return kContainsNone;
3085 } 3042 }
3086 3043
3087 } // namespace blink 3044 } // namespace blink
3088 3045
3089 #endif 3046 #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