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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp

Issue 2767213003: First Implementation of Snapped Points
Patch Set: Rebase and format 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
OLDNEW
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
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
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 return value_id == CSSValueNormal || value_id == CSSValueAlways;
846 return value_id == CSSValueNone || value_id == CSSValueMandatory ||
847 value_id == CSSValueProximity;
848 default: 862 default:
849 NOTREACHED(); 863 NOTREACHED();
850 return false; 864 return false;
851 } 865 }
852 } 866 }
853 867
854 bool CSSParserFastPaths::IsKeywordPropertyID(CSSPropertyID property_id) { 868 bool CSSParserFastPaths::IsKeywordPropertyID(CSSPropertyID property_id) {
855 switch (property_id) { 869 switch (property_id) {
856 case CSSPropertyAlignmentBaseline: 870 case CSSPropertyAlignmentBaseline:
857 case CSSPropertyAll: 871 case CSSPropertyAll:
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 case CSSPropertyTransformBox: 964 case CSSPropertyTransformBox:
951 case CSSPropertyTransformStyle: 965 case CSSPropertyTransformStyle:
952 case CSSPropertyWebkitUserDrag: 966 case CSSPropertyWebkitUserDrag:
953 case CSSPropertyWebkitUserModify: 967 case CSSPropertyWebkitUserModify:
954 case CSSPropertyUserSelect: 968 case CSSPropertyUserSelect:
955 case CSSPropertyWebkitWritingMode: 969 case CSSPropertyWebkitWritingMode:
956 case CSSPropertyWhiteSpace: 970 case CSSPropertyWhiteSpace:
957 case CSSPropertyWordBreak: 971 case CSSPropertyWordBreak:
958 case CSSPropertyWordWrap: 972 case CSSPropertyWordWrap:
959 case CSSPropertyWritingMode: 973 case CSSPropertyWritingMode:
960 case CSSPropertyScrollSnapType: 974 case CSSPropertyScrollSnapStop:
961 return true; 975 return true;
962 case CSSPropertyJustifyContent: 976 case CSSPropertyJustifyContent:
963 case CSSPropertyAlignContent: 977 case CSSPropertyAlignContent:
964 case CSSPropertyAlignItems: 978 case CSSPropertyAlignItems:
965 case CSSPropertyAlignSelf: 979 case CSSPropertyAlignSelf:
966 return !RuntimeEnabledFeatures::cssGridLayoutEnabled(); 980 return !RuntimeEnabledFeatures::cssGridLayoutEnabled();
967 default: 981 default:
968 return false; 982 return false;
969 } 983 }
970 } 984 }
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 if (IsColorPropertyID(property_id)) 1237 if (IsColorPropertyID(property_id))
1224 return ParseColor(string, parser_mode); 1238 return ParseColor(string, parser_mode);
1225 if (CSSValue* keyword = ParseKeywordValue(property_id, string, parser_mode)) 1239 if (CSSValue* keyword = ParseKeywordValue(property_id, string, parser_mode))
1226 return keyword; 1240 return keyword;
1227 if (CSSValue* transform = ParseSimpleTransform(property_id, string)) 1241 if (CSSValue* transform = ParseSimpleTransform(property_id, string))
1228 return transform; 1242 return transform;
1229 return nullptr; 1243 return nullptr;
1230 } 1244 }
1231 1245
1232 } // namespace blink 1246 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698