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

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

Issue 775153002: Implement unset value handling (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add test Created 6 years 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 | « Source/core/css/CSSValuePool.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 462
463 CSSValueID id = value->id; 463 CSSValueID id = value->id;
464 464
465 int num = inShorthand() ? 1 : m_valueList->size(); 465 int num = inShorthand() ? 1 : m_valueList->size();
466 466
467 if (id == CSSValueInherit) { 467 if (id == CSSValueInherit) {
468 if (num != 1) 468 if (num != 1)
469 return false; 469 return false;
470 addExpandedPropertyForValue(propId, cssValuePool().createInheritedValue( ), important); 470 addExpandedPropertyForValue(propId, cssValuePool().createInheritedValue( ), important);
471 return true; 471 return true;
472 } 472 } else if (id == CSSValueInitial) {
473 else if (id == CSSValueInitial) {
474 if (num != 1) 473 if (num != 1)
475 return false; 474 return false;
476 addExpandedPropertyForValue(propId, cssValuePool().createExplicitInitial Value(), important); 475 addExpandedPropertyForValue(propId, cssValuePool().createExplicitInitial Value(), important);
477 return true; 476 return true;
477 } else if (id == CSSValueUnset) {
478 if (num != 1)
479 return false;
480 addExpandedPropertyForValue(propId, cssValuePool().createUnsetValue(), i mportant);
481 return true;
478 } 482 }
479 483
480 if (CSSParserFastPaths::isKeywordPropertyID(propId)) { 484 if (CSSParserFastPaths::isKeywordPropertyID(propId)) {
481 if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(propId, id)) 485 if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(propId, id))
482 return false; 486 return false;
483 if (m_valueList->next() && !inShorthand()) 487 if (m_valueList->next() && !inShorthand())
484 return false; 488 return false;
485 addProperty(propId, cssValuePool().createIdentifierValue(id), important) ; 489 addProperty(propId, cssValuePool().createIdentifierValue(id), important) ;
486 return true; 490 return true;
487 } 491 }
(...skipping 7983 matching lines...) Expand 10 before | Expand all | Expand 10 after
8471 return nullptr; 8475 return nullptr;
8472 a = args->next(); 8476 a = args->next();
8473 8477
8474 argNumber++; 8478 argNumber++;
8475 } 8479 }
8476 8480
8477 return transformValue.release(); 8481 return transformValue.release();
8478 } 8482 }
8479 8483
8480 } // namespace blink 8484 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/CSSValuePool.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698