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

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

Issue 1348363004: Add consumeInteger/consumeLength (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 5 years, 2 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 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 case CSSPropertyWebkitBorderEndWidth: 684 case CSSPropertyWebkitBorderEndWidth:
685 case CSSPropertyWebkitBorderBeforeWidth: 685 case CSSPropertyWebkitBorderBeforeWidth:
686 case CSSPropertyWebkitBorderAfterWidth: 686 case CSSPropertyWebkitBorderAfterWidth:
687 case CSSPropertyWebkitColumnRuleWidth: 687 case CSSPropertyWebkitColumnRuleWidth:
688 if (id == CSSValueThin || id == CSSValueMedium || id == CSSValueThick) 688 if (id == CSSValueThin || id == CSSValueMedium || id == CSSValueThick)
689 validPrimitive = true; 689 validPrimitive = true;
690 else 690 else
691 validPrimitive = validUnit(value, FLength | FNonNeg | unitless); 691 validPrimitive = validUnit(value, FLength | FNonNeg | unitless);
692 break; 692 break;
693 693
694 case CSSPropertyLetterSpacing: // normal | <length> | inherit
695 case CSSPropertyWordSpacing: // normal | <length> | inherit
696 if (id == CSSValueNormal)
697 validPrimitive = true;
698 else
699 validPrimitive = validUnit(value, FLength | FUnitlessQuirk);
700 break;
701
702 case CSSPropertyTextIndent: 694 case CSSPropertyTextIndent:
703 parsedValue = parseTextIndent(); 695 parsedValue = parseTextIndent();
704 break; 696 break;
705 697
706 case CSSPropertyPaddingTop: //// <padding-width> | inherit 698 case CSSPropertyPaddingTop: //// <padding-width> | inherit
707 case CSSPropertyPaddingRight: // Which is defined as 699 case CSSPropertyPaddingRight: // Which is defined as
708 case CSSPropertyPaddingBottom: // <length> | <percentage> 700 case CSSPropertyPaddingBottom: // <length> | <percentage>
709 case CSSPropertyPaddingLeft: //// 701 case CSSPropertyPaddingLeft: ////
710 unitless = FUnitlessQuirk; 702 unitless = FUnitlessQuirk;
711 // fall through 703 // fall through
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 return false; 897 return false;
906 parsedValue2 = createPrimitiveNumericValue(value); 898 parsedValue2 = createPrimitiveNumericValue(value);
907 } else 899 } else
908 parsedValue2 = parsedValue1; 900 parsedValue2 = parsedValue1;
909 901
910 if (m_valueList->next()) 902 if (m_valueList->next())
911 return false; 903 return false;
912 addProperty(propId, CSSValuePair::create(parsedValue1.release(), parsedV alue2.release(), CSSValuePair::DropIdenticalValues), important); 904 addProperty(propId, CSSValuePair::create(parsedValue1.release(), parsedV alue2.release(), CSSValuePair::DropIdenticalValues), important);
913 return true; 905 return true;
914 } 906 }
915 case CSSPropertyTabSize:
916 // May be specified as a unit-less non-negative integer or length indica ting number of space characters.
917 validPrimitive = validUnit(value, FInteger | FLength | FNonNeg);
918 break;
919 case CSSPropertyBorderRadius: 907 case CSSPropertyBorderRadius:
920 case CSSPropertyAliasWebkitBorderRadius: 908 case CSSPropertyAliasWebkitBorderRadius:
921 return parseBorderRadius(unresolvedProperty, important); 909 return parseBorderRadius(unresolvedProperty, important);
922 case CSSPropertyOutlineOffset: 910 case CSSPropertyOutlineOffset:
923 validPrimitive = validUnit(value, FLength); 911 validPrimitive = validUnit(value, FLength);
924 break; 912 break;
925 case CSSPropertyTextShadow: // CSS2 property, dropped in CSS2.1, back in CSS 3, so treat as CSS3 913 case CSSPropertyTextShadow: // CSS2 property, dropped in CSS2.1, back in CSS 3, so treat as CSS3
926 case CSSPropertyBoxShadow: 914 case CSSPropertyBoxShadow:
927 if (id == CSSValueNone) 915 if (id == CSSValueNone)
928 validPrimitive = true; 916 validPrimitive = true;
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1417 case CSSPropertyWillChange: 1405 case CSSPropertyWillChange:
1418 case CSSPropertyPage: 1406 case CSSPropertyPage:
1419 case CSSPropertyOverflow: 1407 case CSSPropertyOverflow:
1420 case CSSPropertyQuotes: 1408 case CSSPropertyQuotes:
1421 case CSSPropertyWebkitHighlight: 1409 case CSSPropertyWebkitHighlight:
1422 case CSSPropertyFontVariantLigatures: 1410 case CSSPropertyFontVariantLigatures:
1423 case CSSPropertyWebkitFontFeatureSettings: 1411 case CSSPropertyWebkitFontFeatureSettings:
1424 case CSSPropertyFontVariant: 1412 case CSSPropertyFontVariant:
1425 case CSSPropertyFontFamily: 1413 case CSSPropertyFontFamily:
1426 case CSSPropertyFontWeight: 1414 case CSSPropertyFontWeight:
1415 case CSSPropertyLetterSpacing:
1416 case CSSPropertyWordSpacing:
1417 case CSSPropertyTabSize:
1427 validPrimitive = false; 1418 validPrimitive = false;
1428 break; 1419 break;
1429 1420
1430 case CSSPropertyScrollSnapPointsX: 1421 case CSSPropertyScrollSnapPointsX:
1431 case CSSPropertyScrollSnapPointsY: 1422 case CSSPropertyScrollSnapPointsY:
1432 parsedValue = parseScrollSnapPoints(); 1423 parsedValue = parseScrollSnapPoints();
1433 break; 1424 break;
1434 case CSSPropertyScrollSnapCoordinate: 1425 case CSSPropertyScrollSnapCoordinate:
1435 parsedValue = parseScrollSnapCoordinate(); 1426 parsedValue = parseScrollSnapCoordinate();
1436 break; 1427 break;
(...skipping 6038 matching lines...) Expand 10 before | Expand all | Expand 10 after
7475 } 7466 }
7476 } 7467 }
7477 7468
7478 if (!list->length()) 7469 if (!list->length())
7479 return nullptr; 7470 return nullptr;
7480 7471
7481 return list.release(); 7472 return list.release();
7482 } 7473 }
7483 7474
7484 } // namespace blink 7475 } // 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