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

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

Issue 1408383010: Parse -webkit-border shorthands in CSSPropertyParser with CSSParserTokens (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reuse consumeLineWidth Created 5 years, 1 month 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 if ((id >= CSSValueWebkitAuto && id <= CSSValueWebkitMatchParent) || id == CSSValueStart || id == CSSValueEnd) { 417 if ((id >= CSSValueWebkitAuto && id <= CSSValueWebkitMatchParent) || id == CSSValueStart || id == CSSValueEnd) {
418 validPrimitive = true; 418 validPrimitive = true;
419 } 419 }
420 break; 420 break;
421 421
422 case CSSPropertyBackgroundColor: // <color> | inherit 422 case CSSPropertyBackgroundColor: // <color> | inherit
423 case CSSPropertyBorderTopColor: // <color> | inherit 423 case CSSPropertyBorderTopColor: // <color> | inherit
424 case CSSPropertyBorderRightColor: 424 case CSSPropertyBorderRightColor:
425 case CSSPropertyBorderBottomColor: 425 case CSSPropertyBorderBottomColor:
426 case CSSPropertyBorderLeftColor: 426 case CSSPropertyBorderLeftColor:
427 case CSSPropertyWebkitBorderStartColor:
428 case CSSPropertyWebkitBorderEndColor:
429 case CSSPropertyWebkitBorderBeforeColor:
430 case CSSPropertyWebkitBorderAfterColor:
431 case CSSPropertyWebkitColumnRuleColor: 427 case CSSPropertyWebkitColumnRuleColor:
432 case CSSPropertyWebkitTextStrokeColor: 428 case CSSPropertyWebkitTextStrokeColor:
433 parsedValue = parseColor(m_valueList->current(), acceptQuirkyColors(prop Id)); 429 parsedValue = parseColor(m_valueList->current(), acceptQuirkyColors(prop Id));
434 if (parsedValue) 430 if (parsedValue)
435 m_valueList->next(); 431 m_valueList->next();
436 break; 432 break;
437 433
438 case CSSPropertyCursor: { 434 case CSSPropertyCursor: {
439 // Grammar defined by CSS3 UI and modified by CSS4 images: 435 // Grammar defined by CSS3 UI and modified by CSS4 images:
440 // [ [<image> [<x> <y>]?,]* 436 // [ [<image> [<x> <y>]?,]*
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 break; 588 break;
593 589
594 case CSSPropertyBorderTopWidth: //// <border-width> | inherit 590 case CSSPropertyBorderTopWidth: //// <border-width> | inherit
595 case CSSPropertyBorderRightWidth: // Which is defined as 591 case CSSPropertyBorderRightWidth: // Which is defined as
596 case CSSPropertyBorderBottomWidth: // thin | medium | thick | <length> 592 case CSSPropertyBorderBottomWidth: // thin | medium | thick | <length>
597 case CSSPropertyBorderLeftWidth: 593 case CSSPropertyBorderLeftWidth:
598 if (!inShorthand() || m_currentShorthand == CSSPropertyBorderWidth) 594 if (!inShorthand() || m_currentShorthand == CSSPropertyBorderWidth)
599 unitless = FUnitlessQuirk; 595 unitless = FUnitlessQuirk;
600 // fall through 596 // fall through
601 case CSSPropertyWebkitTextStrokeWidth: 597 case CSSPropertyWebkitTextStrokeWidth:
602 case CSSPropertyWebkitBorderStartWidth:
603 case CSSPropertyWebkitBorderEndWidth:
604 case CSSPropertyWebkitBorderBeforeWidth:
605 case CSSPropertyWebkitBorderAfterWidth:
606 case CSSPropertyWebkitColumnRuleWidth: 598 case CSSPropertyWebkitColumnRuleWidth:
607 if (id == CSSValueThin || id == CSSValueMedium || id == CSSValueThick) 599 if (id == CSSValueThin || id == CSSValueMedium || id == CSSValueThick)
608 validPrimitive = true; 600 validPrimitive = true;
609 else 601 else
610 validPrimitive = validUnit(value, FLength | FNonNeg | unitless); 602 validPrimitive = validUnit(value, FLength | FNonNeg | unitless);
611 break; 603 break;
612 604
613 case CSSPropertyPaddingTop: //// <padding-width> | inherit 605 case CSSPropertyPaddingTop: //// <padding-width> | inherit
614 case CSSPropertyPaddingRight: // Which is defined as 606 case CSSPropertyPaddingRight: // Which is defined as
615 case CSSPropertyPaddingBottom: // <length> | <percentage> 607 case CSSPropertyPaddingBottom: // <length> | <percentage>
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 return parseShorthand(propId, borderTopShorthand(), important); 986 return parseShorthand(propId, borderTopShorthand(), important);
995 case CSSPropertyBorderRight: 987 case CSSPropertyBorderRight:
996 // [ 'border-right-width' || 'border-style' || <color> ] | inherit 988 // [ 'border-right-width' || 'border-style' || <color> ] | inherit
997 return parseShorthand(propId, borderRightShorthand(), important); 989 return parseShorthand(propId, borderRightShorthand(), important);
998 case CSSPropertyBorderBottom: 990 case CSSPropertyBorderBottom:
999 // [ 'border-bottom-width' || 'border-style' || <color> ] | inherit 991 // [ 'border-bottom-width' || 'border-style' || <color> ] | inherit
1000 return parseShorthand(propId, borderBottomShorthand(), important); 992 return parseShorthand(propId, borderBottomShorthand(), important);
1001 case CSSPropertyBorderLeft: 993 case CSSPropertyBorderLeft:
1002 // [ 'border-left-width' || 'border-style' || <color> ] | inherit 994 // [ 'border-left-width' || 'border-style' || <color> ] | inherit
1003 return parseShorthand(propId, borderLeftShorthand(), important); 995 return parseShorthand(propId, borderLeftShorthand(), important);
1004 case CSSPropertyWebkitBorderStart:
1005 return parseShorthand(propId, webkitBorderStartShorthand(), important);
1006 case CSSPropertyWebkitBorderEnd:
1007 return parseShorthand(propId, webkitBorderEndShorthand(), important);
1008 case CSSPropertyWebkitBorderBefore:
1009 return parseShorthand(propId, webkitBorderBeforeShorthand(), important);
1010 case CSSPropertyWebkitBorderAfter:
1011 return parseShorthand(propId, webkitBorderAfterShorthand(), important);
1012 case CSSPropertyBorderColor: 996 case CSSPropertyBorderColor:
1013 // <color>{1,4} | inherit 997 // <color>{1,4} | inherit
1014 return parse4Values(propId, borderColorShorthand().properties(), importa nt); 998 return parse4Values(propId, borderColorShorthand().properties(), importa nt);
1015 case CSSPropertyBorderWidth: 999 case CSSPropertyBorderWidth:
1016 // <border-width>{1,4} | inherit 1000 // <border-width>{1,4} | inherit
1017 return parse4Values(propId, borderWidthShorthand().properties(), importa nt); 1001 return parse4Values(propId, borderWidthShorthand().properties(), importa nt);
1018 case CSSPropertyBorderStyle: 1002 case CSSPropertyBorderStyle:
1019 // <border-style>{1,4} | inherit 1003 // <border-style>{1,4} | inherit
1020 return parse4Values(propId, borderStyleShorthand().properties(), importa nt); 1004 return parse4Values(propId, borderStyleShorthand().properties(), importa nt);
1021 case CSSPropertyMargin: 1005 case CSSPropertyMargin:
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1170 case CSSPropertyMotionOffset: 1154 case CSSPropertyMotionOffset:
1171 case CSSPropertyMotionRotation: 1155 case CSSPropertyMotionRotation:
1172 case CSSPropertyMotion: 1156 case CSSPropertyMotion:
1173 case CSSPropertyWebkitTextEmphasisColor: 1157 case CSSPropertyWebkitTextEmphasisColor:
1174 case CSSPropertyWebkitTextEmphasisStyle: 1158 case CSSPropertyWebkitTextEmphasisStyle:
1175 case CSSPropertyWebkitTextEmphasis: 1159 case CSSPropertyWebkitTextEmphasis:
1176 case CSSPropertyOutline: 1160 case CSSPropertyOutline:
1177 case CSSPropertyOutlineColor: 1161 case CSSPropertyOutlineColor:
1178 case CSSPropertyOutlineWidth: 1162 case CSSPropertyOutlineWidth:
1179 case CSSPropertyOutlineOffset: 1163 case CSSPropertyOutlineOffset:
1164 case CSSPropertyWebkitBorderStartColor:
1165 case CSSPropertyWebkitBorderEndColor:
1166 case CSSPropertyWebkitBorderBeforeColor:
1167 case CSSPropertyWebkitBorderAfterColor:
1168 case CSSPropertyWebkitBorderStartWidth:
1169 case CSSPropertyWebkitBorderEndWidth:
1170 case CSSPropertyWebkitBorderBeforeWidth:
1171 case CSSPropertyWebkitBorderAfterWidth:
1172 case CSSPropertyWebkitBorderStart:
1173 case CSSPropertyWebkitBorderEnd:
1174 case CSSPropertyWebkitBorderBefore:
1175 case CSSPropertyWebkitBorderAfter:
1180 validPrimitive = false; 1176 validPrimitive = false;
1181 break; 1177 break;
1182 1178
1183 case CSSPropertyScrollSnapPointsX: 1179 case CSSPropertyScrollSnapPointsX:
1184 case CSSPropertyScrollSnapPointsY: 1180 case CSSPropertyScrollSnapPointsY:
1185 parsedValue = parseScrollSnapPoints(); 1181 parsedValue = parseScrollSnapPoints();
1186 break; 1182 break;
1187 case CSSPropertyScrollSnapCoordinate: 1183 case CSSPropertyScrollSnapCoordinate:
1188 parsedValue = parseScrollSnapCoordinate(); 1184 parsedValue = parseScrollSnapCoordinate();
1189 break; 1185 break;
(...skipping 4692 matching lines...) Expand 10 before | Expand all | Expand 10 after
5882 return nullptr; 5878 return nullptr;
5883 a = args->next(); 5879 a = args->next();
5884 5880
5885 argNumber++; 5881 argNumber++;
5886 } 5882 }
5887 5883
5888 return transformValue.release(); 5884 return transformValue.release();
5889 } 5885 }
5890 5886
5891 } // namespace blink 5887 } // 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