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

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

Issue 2882103002: Make ELineBreak an enum class. (Closed)
Patch Set: Rebase Created 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp » ('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 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 } 996 }
997 997
998 NOTREACHED(); 998 NOTREACHED();
999 return kHyphensManual; 999 return kHyphensManual;
1000 } 1000 }
1001 1001
1002 template <> 1002 template <>
1003 inline CSSIdentifierValue::CSSIdentifierValue(LineBreak e) 1003 inline CSSIdentifierValue::CSSIdentifierValue(LineBreak e)
1004 : CSSValue(kIdentifierClass) { 1004 : CSSValue(kIdentifierClass) {
1005 switch (e) { 1005 switch (e) {
1006 case kLineBreakAuto: 1006 case LineBreak::kAuto:
1007 value_id_ = CSSValueAuto; 1007 value_id_ = CSSValueAuto;
1008 break; 1008 break;
1009 case kLineBreakLoose: 1009 case LineBreak::kLoose:
1010 value_id_ = CSSValueLoose; 1010 value_id_ = CSSValueLoose;
1011 break; 1011 break;
1012 case kLineBreakNormal: 1012 case LineBreak::kNormal:
1013 value_id_ = CSSValueNormal; 1013 value_id_ = CSSValueNormal;
1014 break; 1014 break;
1015 case kLineBreakStrict: 1015 case LineBreak::kStrict:
1016 value_id_ = CSSValueStrict; 1016 value_id_ = CSSValueStrict;
1017 break; 1017 break;
1018 case kLineBreakAfterWhiteSpace: 1018 case LineBreak::kAfterWhiteSpace:
1019 value_id_ = CSSValueAfterWhiteSpace; 1019 value_id_ = CSSValueAfterWhiteSpace;
1020 break; 1020 break;
1021 } 1021 }
1022 } 1022 }
1023 1023
1024 template <> 1024 template <>
1025 inline LineBreak CSSIdentifierValue::ConvertTo() const { 1025 inline LineBreak CSSIdentifierValue::ConvertTo() const {
1026 switch (value_id_) { 1026 switch (value_id_) {
1027 case CSSValueAuto: 1027 case CSSValueAuto:
1028 return kLineBreakAuto; 1028 return LineBreak::kAuto;
1029 case CSSValueLoose: 1029 case CSSValueLoose:
1030 return kLineBreakLoose; 1030 return LineBreak::kLoose;
1031 case CSSValueNormal: 1031 case CSSValueNormal:
1032 return kLineBreakNormal; 1032 return LineBreak::kNormal;
1033 case CSSValueStrict: 1033 case CSSValueStrict:
1034 return kLineBreakStrict; 1034 return LineBreak::kStrict;
1035 case CSSValueAfterWhiteSpace: 1035 case CSSValueAfterWhiteSpace:
1036 return kLineBreakAfterWhiteSpace; 1036 return LineBreak::kAfterWhiteSpace;
1037 default: 1037 default:
1038 break; 1038 break;
1039 } 1039 }
1040 1040
1041 NOTREACHED(); 1041 NOTREACHED();
1042 return kLineBreakAuto; 1042 return LineBreak::kAuto;
1043 } 1043 }
1044 1044
1045 template <> 1045 template <>
1046 inline CSSIdentifierValue::CSSIdentifierValue(EMarginCollapse e) 1046 inline CSSIdentifierValue::CSSIdentifierValue(EMarginCollapse e)
1047 : CSSValue(kIdentifierClass) { 1047 : CSSValue(kIdentifierClass) {
1048 switch (e) { 1048 switch (e) {
1049 case kMarginCollapseCollapse: 1049 case kMarginCollapseCollapse:
1050 value_id_ = CSSValueCollapse; 1050 value_id_ = CSSValueCollapse;
1051 break; 1051 break;
1052 case kMarginCollapseSeparate: 1052 case kMarginCollapseSeparate:
(...skipping 2360 matching lines...) Expand 10 before | Expand all | Expand 10 after
3413 default: 3413 default:
3414 break; 3414 break;
3415 } 3415 }
3416 NOTREACHED(); 3416 NOTREACHED();
3417 return kContainsNone; 3417 return kContainsNone;
3418 } 3418 }
3419 3419
3420 } // namespace blink 3420 } // namespace blink
3421 3421
3422 #endif 3422 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698