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 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 return value_id == CSSValueNormal || value_id == CSSValuePre || | 838 return value_id == CSSValueNormal || value_id == CSSValuePre || |
839 value_id == CSSValuePreWrap || value_id == CSSValuePreLine || | 839 value_id == CSSValuePreWrap || value_id == CSSValuePreLine || |
840 value_id == CSSValueNowrap; | 840 value_id == CSSValueNowrap; |
841 case CSSPropertyWordBreak: | 841 case CSSPropertyWordBreak: |
842 return value_id == CSSValueNormal || value_id == CSSValueBreakAll || | 842 return value_id == CSSValueNormal || value_id == CSSValueBreakAll || |
843 value_id == CSSValueKeepAll || value_id == CSSValueBreakWord; | 843 value_id == CSSValueKeepAll || value_id == CSSValueBreakWord; |
844 case CSSPropertyScrollSnapType: | 844 case CSSPropertyScrollSnapType: |
845 DCHECK(RuntimeEnabledFeatures::CSSScrollSnapPointsEnabled()); | 845 DCHECK(RuntimeEnabledFeatures::CSSScrollSnapPointsEnabled()); |
846 return value_id == CSSValueNone || value_id == CSSValueMandatory || | 846 return value_id == CSSValueNone || value_id == CSSValueMandatory || |
847 value_id == CSSValueProximity; | 847 value_id == CSSValueProximity; |
| 848 case CSSPropertyScrollBoundaryBehaviorX: |
| 849 return value_id == CSSValueAuto || value_id == CSSValueContain || |
| 850 value_id == CSSValueNone; |
| 851 case CSSPropertyScrollBoundaryBehaviorY: |
| 852 return value_id == CSSValueAuto || value_id == CSSValueContain || |
| 853 value_id == CSSValueNone; |
848 default: | 854 default: |
849 NOTREACHED(); | 855 NOTREACHED(); |
850 return false; | 856 return false; |
851 } | 857 } |
852 } | 858 } |
853 | 859 |
854 bool CSSParserFastPaths::IsKeywordPropertyID(CSSPropertyID property_id) { | 860 bool CSSParserFastPaths::IsKeywordPropertyID(CSSPropertyID property_id) { |
855 switch (property_id) { | 861 switch (property_id) { |
856 case CSSPropertyAlignmentBaseline: | 862 case CSSPropertyAlignmentBaseline: |
857 case CSSPropertyAll: | 863 case CSSPropertyAll: |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 case CSSPropertyTransformStyle: | 957 case CSSPropertyTransformStyle: |
952 case CSSPropertyWebkitUserDrag: | 958 case CSSPropertyWebkitUserDrag: |
953 case CSSPropertyWebkitUserModify: | 959 case CSSPropertyWebkitUserModify: |
954 case CSSPropertyUserSelect: | 960 case CSSPropertyUserSelect: |
955 case CSSPropertyWebkitWritingMode: | 961 case CSSPropertyWebkitWritingMode: |
956 case CSSPropertyWhiteSpace: | 962 case CSSPropertyWhiteSpace: |
957 case CSSPropertyWordBreak: | 963 case CSSPropertyWordBreak: |
958 case CSSPropertyWordWrap: | 964 case CSSPropertyWordWrap: |
959 case CSSPropertyWritingMode: | 965 case CSSPropertyWritingMode: |
960 case CSSPropertyScrollSnapType: | 966 case CSSPropertyScrollSnapType: |
| 967 case CSSPropertyScrollBoundaryBehaviorX: |
| 968 case CSSPropertyScrollBoundaryBehaviorY: |
961 return true; | 969 return true; |
962 case CSSPropertyJustifyContent: | 970 case CSSPropertyJustifyContent: |
963 case CSSPropertyAlignContent: | 971 case CSSPropertyAlignContent: |
964 case CSSPropertyAlignItems: | 972 case CSSPropertyAlignItems: |
965 case CSSPropertyAlignSelf: | 973 case CSSPropertyAlignSelf: |
966 return !RuntimeEnabledFeatures::CSSGridLayoutEnabled(); | 974 return !RuntimeEnabledFeatures::CSSGridLayoutEnabled(); |
967 default: | 975 default: |
968 return false; | 976 return false; |
969 } | 977 } |
970 } | 978 } |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1223 if (IsColorPropertyID(property_id)) | 1231 if (IsColorPropertyID(property_id)) |
1224 return ParseColor(string, parser_mode); | 1232 return ParseColor(string, parser_mode); |
1225 if (CSSValue* keyword = ParseKeywordValue(property_id, string, parser_mode)) | 1233 if (CSSValue* keyword = ParseKeywordValue(property_id, string, parser_mode)) |
1226 return keyword; | 1234 return keyword; |
1227 if (CSSValue* transform = ParseSimpleTransform(property_id, string)) | 1235 if (CSSValue* transform = ParseSimpleTransform(property_id, string)) |
1228 return transform; | 1236 return transform; |
1229 return nullptr; | 1237 return nullptr; |
1230 } | 1238 } |
1231 | 1239 |
1232 } // namespace blink | 1240 } // namespace blink |
OLD | NEW |