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

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

Issue 2922483004: Generate enum/getters/setters/mappings for image-rendering. (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 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after
2019 return AB_MATHEMATICAL; 2019 return AB_MATHEMATICAL;
2020 default: 2020 default:
2021 break; 2021 break;
2022 } 2022 }
2023 2023
2024 NOTREACHED(); 2024 NOTREACHED();
2025 return AB_AUTO; 2025 return AB_AUTO;
2026 } 2026 }
2027 2027
2028 template <> 2028 template <>
2029 inline CSSIdentifierValue::CSSIdentifierValue(EImageRendering e)
2030 : CSSValue(kIdentifierClass) {
2031 switch (e) {
2032 case EImageRendering::kAuto:
2033 value_id_ = CSSValueAuto;
2034 break;
2035 case EImageRendering::kOptimizeSpeed:
2036 value_id_ = CSSValueOptimizeSpeed;
2037 break;
2038 case EImageRendering::kOptimizeQuality:
2039 value_id_ = CSSValueOptimizeQuality;
2040 break;
2041 case EImageRendering::kPixelated:
2042 value_id_ = CSSValuePixelated;
2043 break;
2044 case EImageRendering::kOptimizeContrast:
2045 value_id_ = CSSValueWebkitOptimizeContrast;
2046 break;
2047 }
2048 }
2049
2050 template <>
2051 inline EImageRendering CSSIdentifierValue::ConvertTo() const {
2052 switch (value_id_) {
2053 case CSSValueAuto:
2054 return EImageRendering::kAuto;
2055 case CSSValueOptimizeSpeed:
2056 return EImageRendering::kOptimizeSpeed;
2057 case CSSValueOptimizeQuality:
2058 return EImageRendering::kOptimizeQuality;
2059 case CSSValuePixelated:
2060 return EImageRendering::kPixelated;
2061 case CSSValueWebkitOptimizeContrast:
2062 return EImageRendering::kOptimizeContrast;
2063 default:
2064 break;
2065 }
2066
2067 NOTREACHED();
2068 return EImageRendering::kAuto;
2069 }
2070
2071 template <>
2072 inline CSSIdentifierValue::CSSIdentifierValue(ETransformStyle3D e) 2029 inline CSSIdentifierValue::CSSIdentifierValue(ETransformStyle3D e)
2073 : CSSValue(kIdentifierClass) { 2030 : CSSValue(kIdentifierClass) {
2074 switch (e) { 2031 switch (e) {
2075 case kTransformStyle3DFlat: 2032 case kTransformStyle3DFlat:
2076 value_id_ = CSSValueFlat; 2033 value_id_ = CSSValueFlat;
2077 break; 2034 break;
2078 case kTransformStyle3DPreserve3D: 2035 case kTransformStyle3DPreserve3D:
2079 value_id_ = CSSValuePreserve3d; 2036 value_id_ = CSSValuePreserve3d;
2080 break; 2037 break;
2081 } 2038 }
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
2877 default: 2834 default:
2878 break; 2835 break;
2879 } 2836 }
2880 NOTREACHED(); 2837 NOTREACHED();
2881 return kContainsNone; 2838 return kContainsNone;
2882 } 2839 }
2883 2840
2884 } // namespace blink 2841 } // namespace blink
2885 2842
2886 #endif 2843 #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