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

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

Issue 1318543010: Change first() and second() in CSSPairValue to return const references (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review feedback Created 5 years, 3 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/CSSValuePair.h ('k') | Source/core/css/resolver/CSSToStyleMap.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 2566 matching lines...) Expand 10 before | Expand all | Expand 10 after
2577 return; 2577 return;
2578 2578
2579 value1 = CSSValuePair::create(parsedValue1, firstPositionValue, CSSValue Pair::DropIdenticalValues); 2579 value1 = CSSValuePair::create(parsedValue1, firstPositionValue, CSSValue Pair::DropIdenticalValues);
2580 value2 = CSSValuePair::create(cssValuePool().createIdentifierValue(secon dPositionKeyword), secondPositionValue, CSSValuePair::DropIdenticalValues); 2580 value2 = CSSValuePair::create(cssValuePool().createIdentifierValue(secon dPositionKeyword), secondPositionValue, CSSValuePair::DropIdenticalValues);
2581 } 2581 }
2582 2582
2583 if (ident1 == CSSValueTop || ident1 == CSSValueBottom || swapNeeded) 2583 if (ident1 == CSSValueTop || ident1 == CSSValueBottom || swapNeeded)
2584 value1.swap(value2); 2584 value1.swap(value2);
2585 2585
2586 #if ENABLE(ASSERT) 2586 #if ENABLE(ASSERT)
2587 const CSSValuePair* first = toCSSValuePair(value1.get()); 2587 const CSSValuePair& first = toCSSValuePair(*value1);
2588 const CSSValuePair* second = toCSSValuePair(value2.get()); 2588 const CSSValuePair& second = toCSSValuePair(*value2);
2589 ident1 = toCSSPrimitiveValue(first->first())->getValueID(); 2589 ident1 = toCSSPrimitiveValue(first.first()).getValueID();
2590 ident2 = toCSSPrimitiveValue(second->first())->getValueID(); 2590 ident2 = toCSSPrimitiveValue(second.first()).getValueID();
2591 ASSERT(ident1 == CSSValueLeft || ident1 == CSSValueRight); 2591 ASSERT(ident1 == CSSValueLeft || ident1 == CSSValueRight);
2592 ASSERT(ident2 == CSSValueBottom || ident2 == CSSValueTop); 2592 ASSERT(ident2 == CSSValueBottom || ident2 == CSSValueTop);
2593 #endif 2593 #endif
2594 } 2594 }
2595 2595
2596 inline bool CSSPropertyParser::isPotentialPositionValue(CSSParserValue* value) 2596 inline bool CSSPropertyParser::isPotentialPositionValue(CSSParserValue* value)
2597 { 2597 {
2598 return isFillPositionKeyword(value->id) || validUnit(value, FPercent | FLeng th, ReleaseParsedCalcValue); 2598 return isFillPositionKeyword(value->id) || validUnit(value, FPercent | FLeng th, ReleaseParsedCalcValue);
2599 } 2599 }
2600 2600
(...skipping 5491 matching lines...) Expand 10 before | Expand all | Expand 10 after
8092 } 8092 }
8093 } 8093 }
8094 8094
8095 if (!list->length()) 8095 if (!list->length())
8096 return nullptr; 8096 return nullptr;
8097 8097
8098 return list.release(); 8098 return list.release();
8099 } 8099 }
8100 8100
8101 } // namespace blink 8101 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/CSSValuePair.h ('k') | Source/core/css/resolver/CSSToStyleMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698