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

Side by Side Diff: Source/core/css/parser/CSSPropertyParser.cpp

Issue 196533005: skip unused value in CSSPropertyParser::parse2ValuesFillPosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | 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 2674 matching lines...) Expand 10 before | Expand all | Expand 10 after
2685 return; 2685 return;
2686 2686
2687 if (numberOfValues == 3) 2687 if (numberOfValues == 3)
2688 parse3ValuesFillPosition(valueList, value1, value2, parsedValue1.release (), parsedValue2.release()); 2688 parse3ValuesFillPosition(valueList, value1, value2, parsedValue1.release (), parsedValue2.release());
2689 else 2689 else
2690 parse4ValuesFillPosition(valueList, value1, value2, parsedValue1.release (), parsedValue2.release()); 2690 parse4ValuesFillPosition(valueList, value1, value2, parsedValue1.release (), parsedValue2.release());
2691 } 2691 }
2692 2692
2693 void CSSPropertyParser::parse2ValuesFillPosition(CSSParserValueList* valueList, RefPtrWillBeRawPtr<CSSValue>& value1, RefPtrWillBeRawPtr<CSSValue>& value2) 2693 void CSSPropertyParser::parse2ValuesFillPosition(CSSParserValueList* valueList, RefPtrWillBeRawPtr<CSSValue>& value1, RefPtrWillBeRawPtr<CSSValue>& value2)
2694 { 2694 {
2695 CSSParserValue* value = valueList->current();
2696
2697 // Parse the first value. We're just making sure that it is one of the vali d keywords or a percentage/length. 2695 // Parse the first value. We're just making sure that it is one of the vali d keywords or a percentage/length.
2698 unsigned cumulativeFlags = 0; 2696 unsigned cumulativeFlags = 0;
2699 FillPositionFlag value1Flag = InvalidFillPosition; 2697 FillPositionFlag value1Flag = InvalidFillPosition;
2700 FillPositionFlag value2Flag = InvalidFillPosition; 2698 FillPositionFlag value2Flag = InvalidFillPosition;
2701 value1 = parseFillPositionComponent(valueList, cumulativeFlags, value1Flag); 2699 value1 = parseFillPositionComponent(valueList, cumulativeFlags, value1Flag);
2702 if (!value1) 2700 if (!value1)
2703 return; 2701 return;
2704 2702
2705 // It only takes one value for background-position to be correctly parsed if it was specified in a shorthand (since we 2703 // It only takes one value for background-position to be correctly parsed if it was specified in a shorthand (since we
2706 // can assume that any other values belong to the rest of the shorthand). I f we're not parsing a shorthand, though, the 2704 // can assume that any other values belong to the rest of the shorthand). I f we're not parsing a shorthand, though, the
2707 // value was explicitly specified for our property. 2705 // value was explicitly specified for our property.
2708 value = valueList->next(); 2706 CSSParserValue* value = valueList->next();
2709 2707
2710 // First check for the comma. If so, we are finished parsing this value or value pair. 2708 // First check for the comma. If so, we are finished parsing this value or value pair.
2711 if (isComma(value)) 2709 if (isComma(value))
2712 value = 0; 2710 value = 0;
2713 2711
2714 if (value) { 2712 if (value) {
2715 value2 = parseFillPositionComponent(valueList, cumulativeFlags, value2Fl ag); 2713 value2 = parseFillPositionComponent(valueList, cumulativeFlags, value2Fl ag);
2716 if (value2) 2714 if (value2)
2717 valueList->next(); 2715 valueList->next();
2718 else { 2716 else {
(...skipping 5738 matching lines...) Expand 10 before | Expand all | Expand 10 after
8457 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill)); 8455 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill));
8458 if (!seenStroke) 8456 if (!seenStroke)
8459 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke) ); 8457 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke) );
8460 if (!seenMarkers) 8458 if (!seenMarkers)
8461 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers )); 8459 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers ));
8462 8460
8463 return parsedValues.release(); 8461 return parsedValues.release();
8464 } 8462 }
8465 8463
8466 } // namespace WebCore 8464 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698