OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/css/parser/CSSParserFastPaths.h" | 5 #include "core/css/parser/CSSParserFastPaths.h" |
6 | 6 |
7 #include "core/StylePropertyShorthand.h" | 7 #include "core/StylePropertyShorthand.h" |
8 #include "core/css/CSSColorValue.h" | 8 #include "core/css/CSSColorValue.h" |
9 #include "core/css/CSSFunctionValue.h" | 9 #include "core/css/CSSFunctionValue.h" |
10 #include "core/css/CSSIdentifierValue.h" | 10 #include "core/css/CSSIdentifierValue.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 case CSSPropertyGridColumnGap: | 33 case CSSPropertyGridColumnGap: |
34 case CSSPropertyGridRowGap: | 34 case CSSPropertyGridRowGap: |
35 case CSSPropertyHeight: | 35 case CSSPropertyHeight: |
36 case CSSPropertyWidth: | 36 case CSSPropertyWidth: |
37 case CSSPropertyMinHeight: | 37 case CSSPropertyMinHeight: |
38 case CSSPropertyMinWidth: | 38 case CSSPropertyMinWidth: |
39 case CSSPropertyPaddingBottom: | 39 case CSSPropertyPaddingBottom: |
40 case CSSPropertyPaddingLeft: | 40 case CSSPropertyPaddingLeft: |
41 case CSSPropertyPaddingRight: | 41 case CSSPropertyPaddingRight: |
42 case CSSPropertyPaddingTop: | 42 case CSSPropertyPaddingTop: |
| 43 case CSSPropertyScrollPaddingTop: |
| 44 case CSSPropertyScrollPaddingRight: |
| 45 case CSSPropertyScrollPaddingBottom: |
| 46 case CSSPropertyScrollPaddingLeft: |
| 47 case CSSPropertyScrollPaddingBlockStart: |
| 48 case CSSPropertyScrollPaddingBlockEnd: |
| 49 case CSSPropertyScrollPaddingInlineStart: |
| 50 case CSSPropertyScrollPaddingInlineEnd: |
| 51 case CSSPropertyScrollSnapMarginTop: |
| 52 case CSSPropertyScrollSnapMarginRight: |
| 53 case CSSPropertyScrollSnapMarginBottom: |
| 54 case CSSPropertyScrollSnapMarginLeft: |
| 55 case CSSPropertyScrollSnapMarginBlockStart: |
| 56 case CSSPropertyScrollSnapMarginBlockEnd: |
| 57 case CSSPropertyScrollSnapMarginInlineStart: |
| 58 case CSSPropertyScrollSnapMarginInlineEnd: |
43 case CSSPropertyWebkitLogicalWidth: | 59 case CSSPropertyWebkitLogicalWidth: |
44 case CSSPropertyWebkitLogicalHeight: | 60 case CSSPropertyWebkitLogicalHeight: |
45 case CSSPropertyWebkitMinLogicalWidth: | 61 case CSSPropertyWebkitMinLogicalWidth: |
46 case CSSPropertyWebkitMinLogicalHeight: | 62 case CSSPropertyWebkitMinLogicalHeight: |
47 case CSSPropertyWebkitPaddingAfter: | 63 case CSSPropertyWebkitPaddingAfter: |
48 case CSSPropertyWebkitPaddingBefore: | 64 case CSSPropertyWebkitPaddingBefore: |
49 case CSSPropertyWebkitPaddingEnd: | 65 case CSSPropertyWebkitPaddingEnd: |
50 case CSSPropertyWebkitPaddingStart: | 66 case CSSPropertyWebkitPaddingStart: |
51 case CSSPropertyShapeMargin: | 67 case CSSPropertyShapeMargin: |
52 case CSSPropertyR: | 68 case CSSPropertyR: |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 value_id == CSSValueLrTb || value_id == CSSValueRlTb || | 850 value_id == CSSValueLrTb || value_id == CSSValueRlTb || |
835 value_id == CSSValueTbRl || value_id == CSSValueLr || | 851 value_id == CSSValueTbRl || value_id == CSSValueLr || |
836 value_id == CSSValueRl || value_id == CSSValueTb; | 852 value_id == CSSValueRl || value_id == CSSValueTb; |
837 case CSSPropertyWhiteSpace: | 853 case CSSPropertyWhiteSpace: |
838 return value_id == CSSValueNormal || value_id == CSSValuePre || | 854 return value_id == CSSValueNormal || value_id == CSSValuePre || |
839 value_id == CSSValuePreWrap || value_id == CSSValuePreLine || | 855 value_id == CSSValuePreWrap || value_id == CSSValuePreLine || |
840 value_id == CSSValueNowrap; | 856 value_id == CSSValueNowrap; |
841 case CSSPropertyWordBreak: | 857 case CSSPropertyWordBreak: |
842 return value_id == CSSValueNormal || value_id == CSSValueBreakAll || | 858 return value_id == CSSValueNormal || value_id == CSSValueBreakAll || |
843 value_id == CSSValueKeepAll || value_id == CSSValueBreakWord; | 859 value_id == CSSValueKeepAll || value_id == CSSValueBreakWord; |
844 case CSSPropertyScrollSnapType: | 860 case CSSPropertyScrollSnapStop: |
845 DCHECK(RuntimeEnabledFeatures::CSSScrollSnapPointsEnabled()); | 861 DCHECK(RuntimeEnabledFeatures::CSSScrollSnapPointsEnabled()); |
846 return value_id == CSSValueNone || value_id == CSSValueMandatory || | 862 return value_id == CSSValueNormal || value_id == CSSValueAlways; |
847 value_id == CSSValueProximity; | |
848 default: | 863 default: |
849 NOTREACHED(); | 864 NOTREACHED(); |
850 return false; | 865 return false; |
851 } | 866 } |
852 } | 867 } |
853 | 868 |
854 bool CSSParserFastPaths::IsKeywordPropertyID(CSSPropertyID property_id) { | 869 bool CSSParserFastPaths::IsKeywordPropertyID(CSSPropertyID property_id) { |
855 switch (property_id) { | 870 switch (property_id) { |
856 case CSSPropertyAlignmentBaseline: | 871 case CSSPropertyAlignmentBaseline: |
857 case CSSPropertyAll: | 872 case CSSPropertyAll: |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 case CSSPropertyTransformBox: | 965 case CSSPropertyTransformBox: |
951 case CSSPropertyTransformStyle: | 966 case CSSPropertyTransformStyle: |
952 case CSSPropertyWebkitUserDrag: | 967 case CSSPropertyWebkitUserDrag: |
953 case CSSPropertyWebkitUserModify: | 968 case CSSPropertyWebkitUserModify: |
954 case CSSPropertyUserSelect: | 969 case CSSPropertyUserSelect: |
955 case CSSPropertyWebkitWritingMode: | 970 case CSSPropertyWebkitWritingMode: |
956 case CSSPropertyWhiteSpace: | 971 case CSSPropertyWhiteSpace: |
957 case CSSPropertyWordBreak: | 972 case CSSPropertyWordBreak: |
958 case CSSPropertyWordWrap: | 973 case CSSPropertyWordWrap: |
959 case CSSPropertyWritingMode: | 974 case CSSPropertyWritingMode: |
960 case CSSPropertyScrollSnapType: | 975 case CSSPropertyScrollSnapStop: |
961 return true; | 976 return true; |
962 case CSSPropertyJustifyContent: | 977 case CSSPropertyJustifyContent: |
963 case CSSPropertyAlignContent: | 978 case CSSPropertyAlignContent: |
964 case CSSPropertyAlignItems: | 979 case CSSPropertyAlignItems: |
965 case CSSPropertyAlignSelf: | 980 case CSSPropertyAlignSelf: |
966 return !RuntimeEnabledFeatures::CSSGridLayoutEnabled(); | 981 return !RuntimeEnabledFeatures::CSSGridLayoutEnabled(); |
967 default: | 982 default: |
968 return false; | 983 return false; |
969 } | 984 } |
970 } | 985 } |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1223 if (IsColorPropertyID(property_id)) | 1238 if (IsColorPropertyID(property_id)) |
1224 return ParseColor(string, parser_mode); | 1239 return ParseColor(string, parser_mode); |
1225 if (CSSValue* keyword = ParseKeywordValue(property_id, string, parser_mode)) | 1240 if (CSSValue* keyword = ParseKeywordValue(property_id, string, parser_mode)) |
1226 return keyword; | 1241 return keyword; |
1227 if (CSSValue* transform = ParseSimpleTransform(property_id, string)) | 1242 if (CSSValue* transform = ParseSimpleTransform(property_id, string)) |
1228 return transform; | 1243 return transform; |
1229 return nullptr; | 1244 return nullptr; |
1230 } | 1245 } |
1231 | 1246 |
1232 } // namespace blink | 1247 } // namespace blink |
OLD | NEW |