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

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

Issue 1553363002: Move miscellaneous properties into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. 9 * Copyright (C) 2012 Intel Corporation. All rights reserved.
10 * 10 *
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 case CSSPropertyBorderBottomWidth: // thin | medium | thick | <length> 396 case CSSPropertyBorderBottomWidth: // thin | medium | thick | <length>
397 case CSSPropertyBorderLeftWidth: 397 case CSSPropertyBorderLeftWidth:
398 if (!inShorthand() || m_currentShorthand == CSSPropertyBorderWidth) 398 if (!inShorthand() || m_currentShorthand == CSSPropertyBorderWidth)
399 unitless = FUnitlessQuirk; 399 unitless = FUnitlessQuirk;
400 if (id == CSSValueThin || id == CSSValueMedium || id == CSSValueThick) 400 if (id == CSSValueThin || id == CSSValueMedium || id == CSSValueThick)
401 validPrimitive = true; 401 validPrimitive = true;
402 else 402 else
403 validPrimitive = validUnit(value, FLength | FNonNeg | unitless); 403 validPrimitive = validUnit(value, FLength | FNonNeg | unitless);
404 break; 404 break;
405 405
406 case CSSPropertyVerticalAlign:
407 // baseline | sub | super | top | text-top | middle | bottom | text-bott om |
408 // <percentage> | <length> | inherit
409
410 if (id >= CSSValueBaseline && id <= CSSValueWebkitBaselineMiddle)
411 validPrimitive = true;
412 else
413 validPrimitive = validUnit(value, FLength | FPercent | FUnitlessQuir k);
414 break;
415
416 case CSSPropertyBottom: // <length> | <percentage> | auto | in herit 406 case CSSPropertyBottom: // <length> | <percentage> | auto | in herit
417 case CSSPropertyLeft: // <length> | <percentage> | auto | in herit 407 case CSSPropertyLeft: // <length> | <percentage> | auto | in herit
418 case CSSPropertyRight: // <length> | <percentage> | auto | in herit 408 case CSSPropertyRight: // <length> | <percentage> | auto | in herit
419 case CSSPropertyTop: // <length> | <percentage> | auto | in herit 409 case CSSPropertyTop: // <length> | <percentage> | auto | in herit
420 if (id == CSSValueAuto) 410 if (id == CSSValueAuto)
421 validPrimitive = true; 411 validPrimitive = true;
422 else 412 else
423 validPrimitive = validUnit(value, FLength | FPercent | FUnitlessQuir k); 413 validPrimitive = validUnit(value, FLength | FPercent | FUnitlessQuir k);
424 break; 414 break;
425 415
426 case CSSPropertyTextUnderlinePosition:
427 // auto | [ under || [ left | right ] ], but we only support auto | unde r for now
428 ASSERT(RuntimeEnabledFeatures::css3TextDecorationsEnabled());
429 validPrimitive = (id == CSSValueAuto || id == CSSValueUnder);
430 break;
431
432 case CSSPropertySrc: 416 case CSSPropertySrc:
433 case CSSPropertyUnicodeRange: 417 case CSSPropertyUnicodeRange:
434 /* @font-face only descriptors */ 418 /* @font-face only descriptors */
435 break; 419 break;
436 420
437 /* CSS3 properties */ 421 /* CSS3 properties */
438 422
439 case CSSPropertyBorderImage: 423 case CSSPropertyBorderImage:
440 case CSSPropertyWebkitMaskBoxImage: 424 case CSSPropertyWebkitMaskBoxImage:
441 return parseBorderImageShorthand(propId, important); 425 return parseBorderImageShorthand(propId, important);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 case CSSPropertyWebkitBoxReflect: 470 case CSSPropertyWebkitBoxReflect:
487 if (id == CSSValueNone) 471 if (id == CSSValueNone)
488 validPrimitive = true; 472 validPrimitive = true;
489 else 473 else
490 parsedValue = parseReflect(); 474 parsedValue = parseReflect();
491 break; 475 break;
492 case CSSPropertyFontSizeAdjust: // none | <number> 476 case CSSPropertyFontSizeAdjust: // none | <number>
493 ASSERT(RuntimeEnabledFeatures::cssFontSizeAdjustEnabled()); 477 ASSERT(RuntimeEnabledFeatures::cssFontSizeAdjustEnabled());
494 validPrimitive = (id == CSSValueNone) ? true : validUnit(value, FNumber | FNonNeg); 478 validPrimitive = (id == CSSValueNone) ? true : validUnit(value, FNumber | FNonNeg);
495 break; 479 break;
496 case CSSPropertyOpacity:
497 case CSSPropertyWebkitBoxFlex:
498 validPrimitive = validUnit(value, FNumber);
499 break;
500 case CSSPropertyWebkitBoxFlexGroup:
501 validPrimitive = validUnit(value, FInteger | FNonNeg);
502 break;
503 case CSSPropertyOrder:
504 validPrimitive = validUnit(value, FInteger);
505 break;
506
507 case CSSPropertyJustifyContent: 480 case CSSPropertyJustifyContent:
508 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); 481 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
509 parsedValue = parseContentDistributionOverflowPosition(); 482 parsedValue = parseContentDistributionOverflowPosition();
510 break; 483 break;
511 case CSSPropertyJustifySelf: 484 case CSSPropertyJustifySelf:
512 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); 485 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
513 return parseItemPositionOverflowPosition(propId, important); 486 return parseItemPositionOverflowPosition(propId, important);
514 case CSSPropertyJustifyItems: 487 case CSSPropertyJustifyItems:
515 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); 488 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
516 489
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 case CSSPropertyWebkitColumnRule: 787 case CSSPropertyWebkitColumnRule:
815 case CSSPropertyWebkitColumnRuleColor: 788 case CSSPropertyWebkitColumnRuleColor:
816 case CSSPropertyWebkitColumnRuleWidth: 789 case CSSPropertyWebkitColumnRuleWidth:
817 case CSSPropertyClipPath: 790 case CSSPropertyClipPath:
818 case CSSPropertyFilter: 791 case CSSPropertyFilter:
819 case CSSPropertyMask: 792 case CSSPropertyMask:
820 case CSSPropertyStrokeOpacity: 793 case CSSPropertyStrokeOpacity:
821 case CSSPropertyFillOpacity: 794 case CSSPropertyFillOpacity:
822 case CSSPropertyStopOpacity: 795 case CSSPropertyStopOpacity:
823 case CSSPropertyFloodOpacity: 796 case CSSPropertyFloodOpacity:
797 case CSSPropertyOpacity:
798 case CSSPropertyWebkitBoxFlex:
824 case CSSPropertyBaselineShift: 799 case CSSPropertyBaselineShift:
825 case CSSPropertyStrokeMiterlimit: 800 case CSSPropertyStrokeMiterlimit:
826 case CSSPropertyStrokeWidth: 801 case CSSPropertyStrokeWidth:
827 case CSSPropertyStrokeDashoffset: 802 case CSSPropertyStrokeDashoffset:
828 case CSSPropertyCx: 803 case CSSPropertyCx:
829 case CSSPropertyCy: 804 case CSSPropertyCy:
830 case CSSPropertyX: 805 case CSSPropertyX:
831 case CSSPropertyY: 806 case CSSPropertyY:
832 case CSSPropertyR: 807 case CSSPropertyR:
833 case CSSPropertyRx: 808 case CSSPropertyRx:
834 case CSSPropertyRy: 809 case CSSPropertyRy:
835 case CSSPropertyScale: 810 case CSSPropertyScale:
836 case CSSPropertyTranslate: 811 case CSSPropertyTranslate:
837 case CSSPropertyCursor: 812 case CSSPropertyCursor:
838 case CSSPropertyTransformOrigin: 813 case CSSPropertyTransformOrigin:
839 case CSSPropertyContent: 814 case CSSPropertyContent:
840 case CSSPropertyListStyleImage: 815 case CSSPropertyListStyleImage:
841 case CSSPropertyListStyle: 816 case CSSPropertyListStyle:
842 case CSSPropertyPerspective: 817 case CSSPropertyPerspective:
843 case CSSPropertyScrollSnapCoordinate: 818 case CSSPropertyScrollSnapCoordinate:
844 case CSSPropertyScrollSnapPointsX: 819 case CSSPropertyScrollSnapPointsX:
845 case CSSPropertyScrollSnapPointsY: 820 case CSSPropertyScrollSnapPointsY:
846 case CSSPropertyBorderTopRightRadius: 821 case CSSPropertyBorderTopRightRadius:
847 case CSSPropertyBorderTopLeftRadius: 822 case CSSPropertyBorderTopLeftRadius:
848 case CSSPropertyBorderBottomLeftRadius: 823 case CSSPropertyBorderBottomLeftRadius:
849 case CSSPropertyBorderBottomRightRadius: 824 case CSSPropertyBorderBottomRightRadius:
850 case CSSPropertyBorderRadius: 825 case CSSPropertyBorderRadius:
851 case CSSPropertyAliasWebkitBorderRadius: 826 case CSSPropertyAliasWebkitBorderRadius:
827 case CSSPropertyWebkitBoxFlexGroup:
828 case CSSPropertyOrder:
829 case CSSPropertyTextUnderlinePosition:
830 case CSSPropertyVerticalAlign:
852 validPrimitive = false; 831 validPrimitive = false;
853 break; 832 break;
854 833
855 default: 834 default:
856 // If you crash here, it's because you added a css property and are not handling it 835 // If you crash here, it's because you added a css property and are not handling it
857 // in either this switch statement or the one in CSSPropertyParser::pars eSingleValue. 836 // in either this switch statement or the one in CSSPropertyParser::pars eSingleValue.
858 ASSERT_WITH_MESSAGE(0, "unimplemented propertyID: %d", propId); 837 ASSERT_WITH_MESSAGE(0, "unimplemented propertyID: %d", propId);
859 return false; 838 return false;
860 } 839 }
861 840
(...skipping 3727 matching lines...) Expand 10 before | Expand all | Expand 10 after
4589 ASSERT(!m_parsedCalculation); 4568 ASSERT(!m_parsedCalculation);
4590 m_parsedCalculation = CSSCalcValue::create(args, range); 4569 m_parsedCalculation = CSSCalcValue::create(args, range);
4591 4570
4592 if (!m_parsedCalculation) 4571 if (!m_parsedCalculation)
4593 return false; 4572 return false;
4594 4573
4595 return true; 4574 return true;
4596 } 4575 }
4597 4576
4598 } // namespace blink 4577 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698