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

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

Issue 1407203004: Parse outline shorthand in CSSPropertyParser with CSSParserTokens (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 412
413 case CSSPropertyTextAlign: 413 case CSSPropertyTextAlign:
414 // left | right | center | justify | -webkit-left | -webkit-right | -web kit-center | -webkit-match-parent 414 // left | right | center | justify | -webkit-left | -webkit-right | -web kit-center | -webkit-match-parent
415 // | start | end | <string> | inherit | -webkit-auto (converted to start ) 415 // | start | end | <string> | inherit | -webkit-auto (converted to start )
416 // FIXME: <string> not supported right now 416 // FIXME: <string> not supported right now
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 CSSPropertyOutlineColor: // <color> | invert | inherit
423 // Outline color has "invert" as additional keyword.
424 // Also, we want to allow the special focus color even in HTML Standard parsing mode.
425 if (id == CSSValueInvert || id == CSSValueWebkitFocusRingColor) {
426 validPrimitive = true;
427 break;
428 }
429 /* nobreak */
430 case CSSPropertyBackgroundColor: // <color> | inherit 422 case CSSPropertyBackgroundColor: // <color> | inherit
431 case CSSPropertyBorderTopColor: // <color> | inherit 423 case CSSPropertyBorderTopColor: // <color> | inherit
432 case CSSPropertyBorderRightColor: 424 case CSSPropertyBorderRightColor:
433 case CSSPropertyBorderBottomColor: 425 case CSSPropertyBorderBottomColor:
434 case CSSPropertyBorderLeftColor: 426 case CSSPropertyBorderLeftColor:
435 case CSSPropertyWebkitBorderStartColor: 427 case CSSPropertyWebkitBorderStartColor:
436 case CSSPropertyWebkitBorderEndColor: 428 case CSSPropertyWebkitBorderEndColor:
437 case CSSPropertyWebkitBorderBeforeColor: 429 case CSSPropertyWebkitBorderBeforeColor:
438 case CSSPropertyWebkitBorderAfterColor: 430 case CSSPropertyWebkitBorderAfterColor:
439 case CSSPropertyWebkitColumnRuleColor: 431 case CSSPropertyWebkitColumnRuleColor:
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 break; 592 break;
601 593
602 case CSSPropertyBorderTopWidth: //// <border-width> | inherit 594 case CSSPropertyBorderTopWidth: //// <border-width> | inherit
603 case CSSPropertyBorderRightWidth: // Which is defined as 595 case CSSPropertyBorderRightWidth: // Which is defined as
604 case CSSPropertyBorderBottomWidth: // thin | medium | thick | <length> 596 case CSSPropertyBorderBottomWidth: // thin | medium | thick | <length>
605 case CSSPropertyBorderLeftWidth: 597 case CSSPropertyBorderLeftWidth:
606 if (!inShorthand() || m_currentShorthand == CSSPropertyBorderWidth) 598 if (!inShorthand() || m_currentShorthand == CSSPropertyBorderWidth)
607 unitless = FUnitlessQuirk; 599 unitless = FUnitlessQuirk;
608 // fall through 600 // fall through
609 case CSSPropertyWebkitTextStrokeWidth: 601 case CSSPropertyWebkitTextStrokeWidth:
610 case CSSPropertyOutlineWidth: // <border-width> | inherit
611 case CSSPropertyWebkitBorderStartWidth: 602 case CSSPropertyWebkitBorderStartWidth:
612 case CSSPropertyWebkitBorderEndWidth: 603 case CSSPropertyWebkitBorderEndWidth:
613 case CSSPropertyWebkitBorderBeforeWidth: 604 case CSSPropertyWebkitBorderBeforeWidth:
614 case CSSPropertyWebkitBorderAfterWidth: 605 case CSSPropertyWebkitBorderAfterWidth:
615 case CSSPropertyWebkitColumnRuleWidth: 606 case CSSPropertyWebkitColumnRuleWidth:
616 if (id == CSSValueThin || id == CSSValueMedium || id == CSSValueThick) 607 if (id == CSSValueThin || id == CSSValueMedium || id == CSSValueThick)
617 validPrimitive = true; 608 validPrimitive = true;
618 else 609 else
619 validPrimitive = validUnit(value, FLength | FNonNeg | unitless); 610 validPrimitive = validUnit(value, FLength | FNonNeg | unitless);
620 break; 611 break;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 parsedValue2 = parsedValue1; 732 parsedValue2 = parsedValue1;
742 733
743 if (m_valueList->next()) 734 if (m_valueList->next())
744 return false; 735 return false;
745 addProperty(propId, CSSValuePair::create(parsedValue1.release(), parsedV alue2.release(), CSSValuePair::DropIdenticalValues), important); 736 addProperty(propId, CSSValuePair::create(parsedValue1.release(), parsedV alue2.release(), CSSValuePair::DropIdenticalValues), important);
746 return true; 737 return true;
747 } 738 }
748 case CSSPropertyBorderRadius: 739 case CSSPropertyBorderRadius:
749 case CSSPropertyAliasWebkitBorderRadius: 740 case CSSPropertyAliasWebkitBorderRadius:
750 return parseBorderRadius(unresolvedProperty, important); 741 return parseBorderRadius(unresolvedProperty, important);
751 case CSSPropertyOutlineOffset:
752 validPrimitive = validUnit(value, FLength);
753 break;
754 case CSSPropertyWebkitBoxReflect: 742 case CSSPropertyWebkitBoxReflect:
755 if (id == CSSValueNone) 743 if (id == CSSValueNone)
756 validPrimitive = true; 744 validPrimitive = true;
757 else 745 else
758 parsedValue = parseReflect(); 746 parsedValue = parseReflect();
759 break; 747 break;
760 case CSSPropertyFontSizeAdjust: // none | <number> 748 case CSSPropertyFontSizeAdjust: // none | <number>
761 ASSERT(RuntimeEnabledFeatures::cssFontSizeAdjustEnabled()); 749 ASSERT(RuntimeEnabledFeatures::cssFontSizeAdjustEnabled());
762 validPrimitive = (id == CSSValueNone) ? true : validUnit(value, FNumber | FNonNeg); 750 validPrimitive = (id == CSSValueNone) ? true : validUnit(value, FNumber | FNonNeg);
763 break; 751 break;
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 // [ 'border-left-width' || 'border-style' || <color> ] | inherit 1002 // [ 'border-left-width' || 'border-style' || <color> ] | inherit
1015 return parseShorthand(propId, borderLeftShorthand(), important); 1003 return parseShorthand(propId, borderLeftShorthand(), important);
1016 case CSSPropertyWebkitBorderStart: 1004 case CSSPropertyWebkitBorderStart:
1017 return parseShorthand(propId, webkitBorderStartShorthand(), important); 1005 return parseShorthand(propId, webkitBorderStartShorthand(), important);
1018 case CSSPropertyWebkitBorderEnd: 1006 case CSSPropertyWebkitBorderEnd:
1019 return parseShorthand(propId, webkitBorderEndShorthand(), important); 1007 return parseShorthand(propId, webkitBorderEndShorthand(), important);
1020 case CSSPropertyWebkitBorderBefore: 1008 case CSSPropertyWebkitBorderBefore:
1021 return parseShorthand(propId, webkitBorderBeforeShorthand(), important); 1009 return parseShorthand(propId, webkitBorderBeforeShorthand(), important);
1022 case CSSPropertyWebkitBorderAfter: 1010 case CSSPropertyWebkitBorderAfter:
1023 return parseShorthand(propId, webkitBorderAfterShorthand(), important); 1011 return parseShorthand(propId, webkitBorderAfterShorthand(), important);
1024 case CSSPropertyOutline:
1025 // [ 'outline-color' || 'outline-style' || 'outline-width' ] | inherit
1026 return parseShorthand(propId, outlineShorthand(), important);
1027 case CSSPropertyBorderColor: 1012 case CSSPropertyBorderColor:
1028 // <color>{1,4} | inherit 1013 // <color>{1,4} | inherit
1029 return parse4Values(propId, borderColorShorthand().properties(), importa nt); 1014 return parse4Values(propId, borderColorShorthand().properties(), importa nt);
1030 case CSSPropertyBorderWidth: 1015 case CSSPropertyBorderWidth:
1031 // <border-width>{1,4} | inherit 1016 // <border-width>{1,4} | inherit
1032 return parse4Values(propId, borderWidthShorthand().properties(), importa nt); 1017 return parse4Values(propId, borderWidthShorthand().properties(), importa nt);
1033 case CSSPropertyBorderStyle: 1018 case CSSPropertyBorderStyle:
1034 // <border-style>{1,4} | inherit 1019 // <border-style>{1,4} | inherit
1035 return parse4Values(propId, borderStyleShorthand().properties(), importa nt); 1020 return parse4Values(propId, borderStyleShorthand().properties(), importa nt);
1036 case CSSPropertyMargin: 1021 case CSSPropertyMargin:
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 case CSSPropertyWebkitTextDecorationsInEffect: 1166 case CSSPropertyWebkitTextDecorationsInEffect:
1182 case CSSPropertyTextDecorationLine: 1167 case CSSPropertyTextDecorationLine:
1183 case CSSPropertyTextDecoration: 1168 case CSSPropertyTextDecoration:
1184 case CSSPropertyMotionPath: 1169 case CSSPropertyMotionPath:
1185 case CSSPropertyMotionOffset: 1170 case CSSPropertyMotionOffset:
1186 case CSSPropertyMotionRotation: 1171 case CSSPropertyMotionRotation:
1187 case CSSPropertyMotion: 1172 case CSSPropertyMotion:
1188 case CSSPropertyWebkitTextEmphasisColor: 1173 case CSSPropertyWebkitTextEmphasisColor:
1189 case CSSPropertyWebkitTextEmphasisStyle: 1174 case CSSPropertyWebkitTextEmphasisStyle:
1190 case CSSPropertyWebkitTextEmphasis: 1175 case CSSPropertyWebkitTextEmphasis:
1176 case CSSPropertyOutline:
1177 case CSSPropertyOutlineColor:
1178 case CSSPropertyOutlineWidth:
1179 case CSSPropertyOutlineOffset:
1191 validPrimitive = false; 1180 validPrimitive = false;
1192 break; 1181 break;
1193 1182
1194 case CSSPropertyScrollSnapPointsX: 1183 case CSSPropertyScrollSnapPointsX:
1195 case CSSPropertyScrollSnapPointsY: 1184 case CSSPropertyScrollSnapPointsY:
1196 parsedValue = parseScrollSnapPoints(); 1185 parsedValue = parseScrollSnapPoints();
1197 break; 1186 break;
1198 case CSSPropertyScrollSnapCoordinate: 1187 case CSSPropertyScrollSnapCoordinate:
1199 parsedValue = parseScrollSnapCoordinate(); 1188 parsedValue = parseScrollSnapCoordinate();
1200 break; 1189 break;
(...skipping 4692 matching lines...) Expand 10 before | Expand all | Expand 10 after
5893 return nullptr; 5882 return nullptr;
5894 a = args->next(); 5883 a = args->next();
5895 5884
5896 argNumber++; 5885 argNumber++;
5897 } 5886 }
5898 5887
5899 return transformValue.release(); 5888 return transformValue.release();
5900 } 5889 }
5901 5890
5902 } // namespace blink 5891 } // 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