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

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

Issue 1148873005: Parsing CSS properties for scroll snap points (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix comment Created 5 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 "config.h" 5 #include "config.h"
6 #include "core/css/parser/CSSParserFastPaths.h" 6 #include "core/css/parser/CSSParserFastPaths.h"
7 7
8 #include "core/StylePropertyShorthand.h" 8 #include "core/StylePropertyShorthand.h"
9 #include "core/css/CSSFunctionValue.h" 9 #include "core/css/CSSFunctionValue.h"
10 #include "core/css/CSSValuePool.h" 10 #include "core/css/CSSValuePool.h"
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 case CSSPropertyWebkitUserModify: // read-only | read-write 350 case CSSPropertyWebkitUserModify: // read-only | read-write
351 return valueID == CSSValueReadOnly || valueID == CSSValueReadWrite || va lueID == CSSValueReadWritePlaintextOnly; 351 return valueID == CSSValueReadOnly || valueID == CSSValueReadWrite || va lueID == CSSValueReadWritePlaintextOnly;
352 case CSSPropertyWebkitUserSelect: // auto | none | text | all 352 case CSSPropertyWebkitUserSelect: // auto | none | text | all
353 return valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueText || valueID == CSSValueAll; 353 return valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueText || valueID == CSSValueAll;
354 case CSSPropertyWebkitWritingMode: 354 case CSSPropertyWebkitWritingMode:
355 return valueID >= CSSValueHorizontalTb && valueID <= CSSValueHorizontalB t; 355 return valueID >= CSSValueHorizontalTb && valueID <= CSSValueHorizontalB t;
356 case CSSPropertyWhiteSpace: // normal | pre | nowrap 356 case CSSPropertyWhiteSpace: // normal | pre | nowrap
357 return valueID == CSSValueNormal || valueID == CSSValuePre || valueID == CSSValuePreWrap || valueID == CSSValuePreLine || valueID == CSSValueNowrap; 357 return valueID == CSSValueNormal || valueID == CSSValuePre || valueID == CSSValuePreWrap || valueID == CSSValuePreLine || valueID == CSSValueNowrap;
358 case CSSPropertyWordBreak: // normal | break-all | keep-all | break-word (th is is a custom extension) 358 case CSSPropertyWordBreak: // normal | break-all | keep-all | break-word (th is is a custom extension)
359 return valueID == CSSValueNormal || valueID == CSSValueBreakAll || value ID == CSSValueKeepAll || valueID == CSSValueBreakWord; 359 return valueID == CSSValueNormal || valueID == CSSValueBreakAll || value ID == CSSValueKeepAll || valueID == CSSValueBreakWord;
360 case CSSPropertyScrollSnapType: // none | mandatory | proximity
361 ASSERT(RuntimeEnabledFeatures::cssScrollSnapPointsEnabled());
362 return valueID == CSSValueNone || valueID == CSSValueMandatory || valueI D == CSSValueProximity;
360 default: 363 default:
361 ASSERT_NOT_REACHED(); 364 ASSERT_NOT_REACHED();
362 return false; 365 return false;
363 } 366 }
364 } 367 }
365 368
366 bool CSSParserFastPaths::isKeywordPropertyID(CSSPropertyID propertyId) 369 bool CSSParserFastPaths::isKeywordPropertyID(CSSPropertyID propertyId)
367 { 370 {
368 switch (propertyId) { 371 switch (propertyId) {
369 case CSSPropertyAll: 372 case CSSPropertyAll:
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 case CSSPropertyWebkitTextEmphasisPosition: 446 case CSSPropertyWebkitTextEmphasisPosition:
444 case CSSPropertyWebkitTextSecurity: 447 case CSSPropertyWebkitTextSecurity:
445 case CSSPropertyTransformStyle: 448 case CSSPropertyTransformStyle:
446 case CSSPropertyWebkitUserDrag: 449 case CSSPropertyWebkitUserDrag:
447 case CSSPropertyWebkitUserModify: 450 case CSSPropertyWebkitUserModify:
448 case CSSPropertyWebkitUserSelect: 451 case CSSPropertyWebkitUserSelect:
449 case CSSPropertyWebkitWritingMode: 452 case CSSPropertyWebkitWritingMode:
450 case CSSPropertyWhiteSpace: 453 case CSSPropertyWhiteSpace:
451 case CSSPropertyWordBreak: 454 case CSSPropertyWordBreak:
452 case CSSPropertyWordWrap: 455 case CSSPropertyWordWrap:
456 case CSSPropertyScrollSnapType:
453 return true; 457 return true;
454 case CSSPropertyAlignItems: 458 case CSSPropertyAlignItems:
455 case CSSPropertyAlignSelf: 459 case CSSPropertyAlignSelf:
456 return !RuntimeEnabledFeatures::cssGridLayoutEnabled(); 460 return !RuntimeEnabledFeatures::cssGridLayoutEnabled();
457 default: 461 default:
458 return false; 462 return false;
459 } 463 }
460 } 464 }
461 465
462 static PassRefPtrWillBeRawPtr<CSSValue> parseKeywordValue(CSSPropertyID property Id, const String& string) 466 static PassRefPtrWillBeRawPtr<CSSValue> parseKeywordValue(CSSPropertyID property Id, const String& string)
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 if (RefPtrWillBeRawPtr<CSSValue> color = parseColorValue(propertyID, string, parserMode)) 663 if (RefPtrWillBeRawPtr<CSSValue> color = parseColorValue(propertyID, string, parserMode))
660 return color.release(); 664 return color.release();
661 if (RefPtrWillBeRawPtr<CSSValue> keyword = parseKeywordValue(propertyID, str ing)) 665 if (RefPtrWillBeRawPtr<CSSValue> keyword = parseKeywordValue(propertyID, str ing))
662 return keyword.release(); 666 return keyword.release();
663 if (RefPtrWillBeRawPtr<CSSValue> transform = parseSimpleTransform(propertyID , string)) 667 if (RefPtrWillBeRawPtr<CSSValue> transform = parseSimpleTransform(propertyID , string))
664 return transform.release(); 668 return transform.release();
665 return nullptr; 669 return nullptr;
666 } 670 }
667 671
668 } // namespace blink 672 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/ComputedStyleCSSValueMapping.cpp ('k') | Source/core/css/parser/CSSPropertyParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698