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

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

Issue 144143005: Preserve shape-box order in non-computed values (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updating patch to trunk 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.h ('k') | Source/core/rendering/style/BasicShapes.h » ('j') | 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 4416 matching lines...) Expand 10 before | Expand all | Expand 10 after
4427 m_valueList->next(); 4427 m_valueList->next();
4428 return keywordValue.release(); 4428 return keywordValue.release();
4429 } 4429 }
4430 4430
4431 RefPtrWillBeRawPtr<CSSValue> imageValue; 4431 RefPtrWillBeRawPtr<CSSValue> imageValue;
4432 if (valueId != CSSValueNone && parseFillImage(m_valueList.get(), imageValue) ) { 4432 if (valueId != CSSValueNone && parseFillImage(m_valueList.get(), imageValue) ) {
4433 m_valueList->next(); 4433 m_valueList->next();
4434 return imageValue.release(); 4434 return imageValue.release();
4435 } 4435 }
4436 4436
4437 if (value->unit == CSSParserValue::Function) { 4437 return parseBasicShapeAndOrBox();
4438 shapeValue = parseBasicShape(); 4438 }
4439 if (!shapeValue)
4440 return nullptr;
4441 } else if (isBoxValue(valueId)) {
4442 boxValue = parseValidPrimitive(valueId, value);
4443 m_valueList->next();
4444 } else {
4445 return nullptr;
4446 }
4447 4439
4448 ASSERT(shapeValue || boxValue); 4440 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseBasicShapeAndOrBox()
4449 value = m_valueList->current(); 4441 {
4442 CSSParserValue* value = m_valueList->current();
4450 4443
4451 if (value) { 4444 bool shapeFound = false;
4445 bool boxFound = false;
4446 CSSValueID valueId;
4447
4448 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
4449 for (unsigned i = 0; i < 2; ++i) {
4450 if (!value)
4451 break;
4452 valueId = value->id; 4452 valueId = value->id;
4453 if (boxValue && value->unit == CSSParserValue::Function) { 4453 if (value->unit == CSSParserValue::Function && !shapeFound) {
4454 shapeValue = parseBasicShape(); 4454 // parseBasicShape already asks for the next value list item.
4455 RefPtr<CSSPrimitiveValue> shapeValue = parseBasicShape();
4455 if (!shapeValue) 4456 if (!shapeValue)
4456 return nullptr; 4457 return nullptr;
4457 } else if (shapeValue && isBoxValue(valueId)) { 4458 list->append(shapeValue.release());
4458 boxValue = parseValidPrimitive(valueId, value); 4459 shapeFound = true;
4460 } else if (isBoxValue(valueId) && !boxFound) {
4461 list->append(parseValidPrimitive(valueId, value));
4462 boxFound = true;
4459 m_valueList->next(); 4463 m_valueList->next();
4460 } else { 4464 } else {
4461 return nullptr; 4465 return nullptr;
4462 } 4466 }
4463 4467
4464 ASSERT(shapeValue && boxValue); 4468 value = m_valueList->current();
4465 shapeValue->getShapeValue()->setLayoutBox(boxValue.release());
4466 } 4469 }
4467 4470
4468 if (shapeValue) 4471 if (m_valueList->current())
4469 return shapeValue.release(); 4472 return nullptr;
4470 return boxValue.release(); 4473 return list.release();
4471 } 4474 }
4472 4475
4473 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseBasicShape() 4476 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseBasicShape()
4474 { 4477 {
4475 CSSParserValue* value = m_valueList->current(); 4478 CSSParserValue* value = m_valueList->current();
4476 ASSERT(value->unit == CSSParserValue::Function); 4479 ASSERT(value->unit == CSSParserValue::Function);
4477 CSSParserValueList* args = value->function->args.get(); 4480 CSSParserValueList* args = value->function->args.get();
4478 4481
4479 if (!args) 4482 if (!args)
4480 return nullptr; 4483 return nullptr;
(...skipping 3956 matching lines...) Expand 10 before | Expand all | Expand 10 after
8437 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill)); 8440 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill));
8438 if (!seenStroke) 8441 if (!seenStroke)
8439 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke) ); 8442 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke) );
8440 if (!seenMarkers) 8443 if (!seenMarkers)
8441 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers )); 8444 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers ));
8442 8445
8443 return parsedValues.release(); 8446 return parsedValues.release();
8444 } 8447 }
8445 8448
8446 } // namespace WebCore 8449 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.h ('k') | Source/core/rendering/style/BasicShapes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698