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

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

Issue 1676513003: Move background/webkit-mask shorthands into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix background-size logic Created 4 years, 9 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
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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 return parseGridAreaShorthand(important); 355 return parseGridAreaShorthand(important);
356 356
357 case CSSPropertyGridTemplate: 357 case CSSPropertyGridTemplate:
358 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); 358 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
359 return parseGridTemplateShorthand(important); 359 return parseGridTemplateShorthand(important);
360 360
361 case CSSPropertyGrid: 361 case CSSPropertyGrid:
362 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); 362 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
363 return parseGridShorthand(important); 363 return parseGridShorthand(important);
364 364
365 case CSSPropertyBackground: {
366 // Position must come before color in this array because a plain old "0" is a legal color
367 // in quirks mode but it's usually the X coordinate of a position.
368 const CSSPropertyID properties[] = { CSSPropertyBackgroundImage, CSSProp ertyBackgroundRepeat,
369 CSSPropertyBackgroundAttachment, CSSPropertyB ackgroundPosition, CSSPropertyBackgroundOrigin,
370 CSSPropertyBackgroundClip, CSSPropertyBackgro undColor, CSSPropertyBackgroundSize };
371 return parseFillShorthand(propertyID, properties, WTF_ARRAY_LENGTH(prope rties), important);
372 }
373 case CSSPropertyWebkitMask: {
374 const CSSPropertyID properties[] = { CSSPropertyWebkitMaskImage, CSSProp ertyWebkitMaskRepeat,
375 CSSPropertyWebkitMaskPosition, CSSPropertyWebkitMaskOrigin, CSSPrope rtyWebkitMaskClip, CSSPropertyWebkitMaskSize };
376 return parseFillShorthand(propertyID, properties, WTF_ARRAY_LENGTH(prope rties), important);
377 }
378
379 // The remaining shorthands are handled in CSSPropertyParser.cpp 365 // The remaining shorthands are handled in CSSPropertyParser.cpp
380 default: 366 default:
381 return false; 367 return false;
382 } 368 }
383 } 369 }
384 370
385 void CSSPropertyParser::addFillValue(RefPtrWillBeRawPtr<CSSValue>& lval, PassRef PtrWillBeRawPtr<CSSValue> rval) 371 void CSSPropertyParser::addFillValue(RefPtrWillBeRawPtr<CSSValue>& lval, PassRef PtrWillBeRawPtr<CSSValue> rval)
Timothy Loh 2016/03/07 03:55:07 shouldn't we remove all the background parsing log
rwlbuis 2016/03/08 02:51:49 I prefer to do that in a separate patch, I already
386 { 372 {
387 if (lval) { 373 if (lval) {
388 if (lval->isBaseValueList()) 374 if (lval->isBaseValueList())
389 toCSSValueList(lval.get())->append(rval); 375 toCSSValueList(lval.get())->append(rval);
390 else { 376 else {
391 PassRefPtrWillBeRawPtr<CSSValue> oldlVal(lval.release()); 377 PassRefPtrWillBeRawPtr<CSSValue> oldlVal(lval.release());
392 PassRefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createComm aSeparated(); 378 PassRefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createComm aSeparated();
393 list->append(oldlVal); 379 list->append(oldlVal);
394 list->append(rval); 380 list->append(rval);
395 lval = list; 381 lval = list;
(...skipping 2705 matching lines...) Expand 10 before | Expand all | Expand 10 after
3101 ASSERT(!m_parsedCalculation); 3087 ASSERT(!m_parsedCalculation);
3102 m_parsedCalculation = CSSCalcValue::create(args, range); 3088 m_parsedCalculation = CSSCalcValue::create(args, range);
3103 3089
3104 if (!m_parsedCalculation) 3090 if (!m_parsedCalculation)
3105 return false; 3091 return false;
3106 3092
3107 return true; 3093 return true;
3108 } 3094 }
3109 3095
3110 } // namespace blink 3096 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698