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

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

Issue 333163004: Remove explicit bounds check from CSSValueList::item (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address comment Created 6 years, 6 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 | « Source/core/css/StylePropertySerializer.cpp ('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 3742 matching lines...) Expand 10 before | Expand all | Expand 10 after
3753 repeatedValues->append(trackSize); 3753 repeatedValues->append(trackSize);
3754 3754
3755 // This takes care of any trailing <ident>* in the grammar. 3755 // This takes care of any trailing <ident>* in the grammar.
3756 currentValue = arguments->current(); 3756 currentValue = arguments->current();
3757 if (currentValue && currentValue->unit == CSSParserValue::ValueList) 3757 if (currentValue && currentValue->unit == CSSParserValue::ValueList)
3758 parseGridLineNames(*arguments, *repeatedValues); 3758 parseGridLineNames(*arguments, *repeatedValues);
3759 } 3759 }
3760 3760
3761 for (size_t i = 0; i < repetitions; ++i) { 3761 for (size_t i = 0; i < repetitions; ++i) {
3762 for (size_t j = 0; j < repeatedValues->length(); ++j) 3762 for (size_t j = 0; j < repeatedValues->length(); ++j)
3763 list.append(repeatedValues->itemWithoutBoundsCheck(j)); 3763 list.append(repeatedValues->item(j));
3764 } 3764 }
3765 3765
3766 // parseGridTrackSize iterated over the repeat arguments, move to the next v alue. 3766 // parseGridTrackSize iterated over the repeat arguments, move to the next v alue.
3767 m_valueList->next(); 3767 m_valueList->next();
3768 return true; 3768 return true;
3769 } 3769 }
3770 3770
3771 3771
3772 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridTrackSize(CSSParser ValueList& inputList) 3772 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridTrackSize(CSSParser ValueList& inputList)
3773 { 3773 {
(...skipping 3546 matching lines...) Expand 10 before | Expand all | Expand 10 after
7320 filterValue->append(createPrimitiveNumericValue(argument)); 7320 filterValue->append(createPrimitiveNumericValue(argument));
7321 } 7321 }
7322 break; 7322 break;
7323 } 7323 }
7324 case CSSFilterValue::DropShadowFilterOperation: { 7324 case CSSFilterValue::DropShadowFilterOperation: {
7325 // drop-shadow() takes a single shadow. 7325 // drop-shadow() takes a single shadow.
7326 RefPtrWillBeRawPtr<CSSValueList> shadowValueList = parseShadow(args, CSS PropertyWebkitFilter); 7326 RefPtrWillBeRawPtr<CSSValueList> shadowValueList = parseShadow(args, CSS PropertyWebkitFilter);
7327 if (!shadowValueList || shadowValueList->length() != 1) 7327 if (!shadowValueList || shadowValueList->length() != 1)
7328 return nullptr; 7328 return nullptr;
7329 7329
7330 filterValue->append((shadowValueList.release())->itemWithoutBoundsCheck( 0)); 7330 filterValue->append((shadowValueList.release())->item(0));
7331 break; 7331 break;
7332 } 7332 }
7333 default: 7333 default:
7334 ASSERT_NOT_REACHED(); 7334 ASSERT_NOT_REACHED();
7335 } 7335 }
7336 return filterValue.release(); 7336 return filterValue.release();
7337 } 7337 }
7338 7338
7339 PassRefPtrWillBeRawPtr<CSSValueList> CSSPropertyParser::parseFilter() 7339 PassRefPtrWillBeRawPtr<CSSValueList> CSSPropertyParser::parseFilter()
7340 { 7340 {
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after
8431 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill)); 8431 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill));
8432 if (!seenStroke) 8432 if (!seenStroke)
8433 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke) ); 8433 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke) );
8434 if (!seenMarkers) 8434 if (!seenMarkers)
8435 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers )); 8435 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers ));
8436 8436
8437 return parsedValues.release(); 8437 return parsedValues.release();
8438 } 8438 }
8439 8439
8440 } // namespace WebCore 8440 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/StylePropertySerializer.cpp ('k') | Source/core/css/resolver/CSSToStyleMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698