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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 case CSSPropertyOverflowWrap: | 897 case CSSPropertyOverflowWrap: |
892 case CSSPropertyOverflowX: | 898 case CSSPropertyOverflowX: |
893 case CSSPropertyOverflowY: | 899 case CSSPropertyOverflowY: |
894 case CSSPropertyBreakAfter: | 900 case CSSPropertyBreakAfter: |
895 case CSSPropertyBreakBefore: | 901 case CSSPropertyBreakBefore: |
896 case CSSPropertyBreakInside: | 902 case CSSPropertyBreakInside: |
897 case CSSPropertyPointerEvents: | 903 case CSSPropertyPointerEvents: |
898 case CSSPropertyPosition: | 904 case CSSPropertyPosition: |
899 case CSSPropertyResize: | 905 case CSSPropertyResize: |
900 case CSSPropertyScrollBehavior: | 906 case CSSPropertyScrollBehavior: |
| 907 case CSSPropertyScrollBoundaryBehaviorX: |
| 908 case CSSPropertyScrollBoundaryBehaviorY: |
901 case CSSPropertyShapeRendering: | 909 case CSSPropertyShapeRendering: |
902 case CSSPropertySpeak: | 910 case CSSPropertySpeak: |
903 case CSSPropertyStrokeLinecap: | 911 case CSSPropertyStrokeLinecap: |
904 case CSSPropertyStrokeLinejoin: | 912 case CSSPropertyStrokeLinejoin: |
905 case CSSPropertyTableLayout: | 913 case CSSPropertyTableLayout: |
906 case CSSPropertyTextAlign: | 914 case CSSPropertyTextAlign: |
907 case CSSPropertyTextAlignLast: | 915 case CSSPropertyTextAlignLast: |
908 case CSSPropertyTextAnchor: | 916 case CSSPropertyTextAnchor: |
909 case CSSPropertyTextCombineUpright: | 917 case CSSPropertyTextCombineUpright: |
910 case CSSPropertyTextDecorationStyle: | 918 case CSSPropertyTextDecorationStyle: |
(...skipping 312 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 |