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

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

Issue 1419223002: Move text-shadow/box-shadow properties into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix failures 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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 return false; 754 return false;
755 addProperty(propId, CSSValuePair::create(parsedValue1.release(), parsedV alue2.release(), CSSValuePair::DropIdenticalValues), important); 755 addProperty(propId, CSSValuePair::create(parsedValue1.release(), parsedV alue2.release(), CSSValuePair::DropIdenticalValues), important);
756 return true; 756 return true;
757 } 757 }
758 case CSSPropertyBorderRadius: 758 case CSSPropertyBorderRadius:
759 case CSSPropertyAliasWebkitBorderRadius: 759 case CSSPropertyAliasWebkitBorderRadius:
760 return parseBorderRadius(unresolvedProperty, important); 760 return parseBorderRadius(unresolvedProperty, important);
761 case CSSPropertyOutlineOffset: 761 case CSSPropertyOutlineOffset:
762 validPrimitive = validUnit(value, FLength); 762 validPrimitive = validUnit(value, FLength);
763 break; 763 break;
764 case CSSPropertyTextShadow: // CSS2 property, dropped in CSS2.1, back in CSS 3, so treat as CSS3
765 case CSSPropertyBoxShadow:
766 if (id == CSSValueNone)
767 validPrimitive = true;
768 else
769 parsedValue = parseShadow(m_valueList, propId);
770 break;
771 case CSSPropertyWebkitBoxReflect: 764 case CSSPropertyWebkitBoxReflect:
772 if (id == CSSValueNone) 765 if (id == CSSValueNone)
773 validPrimitive = true; 766 validPrimitive = true;
774 else 767 else
775 parsedValue = parseReflect(); 768 parsedValue = parseReflect();
776 break; 769 break;
777 case CSSPropertyFontSizeAdjust: // none | <number> 770 case CSSPropertyFontSizeAdjust: // none | <number>
778 ASSERT(RuntimeEnabledFeatures::cssFontSizeAdjustEnabled()); 771 ASSERT(RuntimeEnabledFeatures::cssFontSizeAdjustEnabled());
779 validPrimitive = (id == CSSValueNone) ? true : validUnit(value, FNumber | FNonNeg); 772 validPrimitive = (id == CSSValueNone) ? true : validUnit(value, FNumber | FNonNeg);
780 break; 773 break;
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 case CSSPropertyAnimationPlayState: 1216 case CSSPropertyAnimationPlayState:
1224 case CSSPropertyAnimationTimingFunction: 1217 case CSSPropertyAnimationTimingFunction:
1225 case CSSPropertyTransitionTimingFunction: 1218 case CSSPropertyTransitionTimingFunction:
1226 case CSSPropertyTransitionProperty: 1219 case CSSPropertyTransitionProperty:
1227 case CSSPropertyOrphans: 1220 case CSSPropertyOrphans:
1228 case CSSPropertyWidows: 1221 case CSSPropertyWidows:
1229 case CSSPropertyWebkitTapHighlightColor: 1222 case CSSPropertyWebkitTapHighlightColor:
1230 case CSSPropertyWebkitTextFillColor: 1223 case CSSPropertyWebkitTextFillColor:
1231 case CSSPropertyColor: 1224 case CSSPropertyColor:
1232 case CSSPropertyZIndex: 1225 case CSSPropertyZIndex:
1226 case CSSPropertyTextShadow:
1227 case CSSPropertyBoxShadow:
1233 validPrimitive = false; 1228 validPrimitive = false;
1234 break; 1229 break;
1235 1230
1236 case CSSPropertyScrollSnapPointsX: 1231 case CSSPropertyScrollSnapPointsX:
1237 case CSSPropertyScrollSnapPointsY: 1232 case CSSPropertyScrollSnapPointsY:
1238 parsedValue = parseScrollSnapPoints(); 1233 parsedValue = parseScrollSnapPoints();
1239 break; 1234 break;
1240 case CSSPropertyScrollSnapCoordinate: 1235 case CSSPropertyScrollSnapCoordinate:
1241 parsedValue = parseScrollSnapCoordinate(); 1236 parsedValue = parseScrollSnapCoordinate();
1242 break; 1237 break;
(...skipping 2622 matching lines...) Expand 10 before | Expand all | Expand 10 after
3865 return false; 3860 return false;
3866 result = makeRGBAFromHSLA(colorValues[0], colorValues[1], colorValue s[2], colorValues[3]); 3861 result = makeRGBAFromHSLA(colorValues[0], colorValues[1], colorValue s[2], colorValues[3]);
3867 } else { 3862 } else {
3868 return false; 3863 return false;
3869 } 3864 }
3870 } 3865 }
3871 3866
3872 return true; 3867 return true;
3873 } 3868 }
3874 3869
3875 PassRefPtrWillBeRawPtr<CSSValueList> CSSPropertyParser::parseShadow(CSSParserVal ueList* valueList, CSSPropertyID propID)
3876 {
3877 RefPtrWillBeRawPtr<CSSValueList> shadowValueList = CSSValueList::createComma Separated();
3878 const bool isBoxShadowProperty = propID == CSSPropertyBoxShadow;
3879 while (RefPtrWillBeRawPtr<CSSShadowValue> shadowValue = parseSingleShadow(va lueList, isBoxShadowProperty, isBoxShadowProperty)) {
3880 shadowValueList->append(shadowValue);
3881 if (!valueList->current())
3882 break;
3883 if (!consumeComma(valueList))
3884 return nullptr;
3885 }
3886 if (shadowValueList->length() == 0)
3887 return nullptr;
3888 return shadowValueList;
3889 }
3890
3891 PassRefPtrWillBeRawPtr<CSSShadowValue> CSSPropertyParser::parseSingleShadow(CSSP arserValueList* valueList, bool allowInset, bool allowSpread) 3870 PassRefPtrWillBeRawPtr<CSSShadowValue> CSSPropertyParser::parseSingleShadow(CSSP arserValueList* valueList, bool allowInset, bool allowSpread)
3892 { 3871 {
3893 RefPtrWillBeRawPtr<CSSPrimitiveValue> style = nullptr; 3872 RefPtrWillBeRawPtr<CSSPrimitiveValue> style = nullptr;
3894 RefPtrWillBeRawPtr<CSSValue> color = nullptr; 3873 RefPtrWillBeRawPtr<CSSValue> color = nullptr;
3895 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, 4> lengths; 3874 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, 4> lengths;
3896 3875
3897 CSSParserValue* val = valueList->current(); 3876 CSSParserValue* val = valueList->current();
3898 if (!val) 3877 if (!val)
3899 return nullptr; 3878 return nullptr;
3900 if (val->id == CSSValueInset) { 3879 if (val->id == CSSValueInset) {
(...skipping 2365 matching lines...) Expand 10 before | Expand all | Expand 10 after
6266 } 6245 }
6267 } 6246 }
6268 6247
6269 if (!list->length()) 6248 if (!list->length())
6270 return nullptr; 6249 return nullptr;
6271 6250
6272 return list.release(); 6251 return list.release();
6273 } 6252 }
6274 6253
6275 } // namespace blink 6254 } // 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