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

Unified Diff: Source/core/css/resolver/CSSToStyleMap.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.cpp ('k') | Source/core/css/resolver/FilterOperationResolver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/CSSToStyleMap.cpp
diff --git a/Source/core/css/resolver/CSSToStyleMap.cpp b/Source/core/css/resolver/CSSToStyleMap.cpp
index 465a89e1bbf4302285892589f870d75c2be163aa..8ab3274129b3609a6529247a2f3e04f9885caa01 100644
--- a/Source/core/css/resolver/CSSToStyleMap.cpp
+++ b/Source/core/css/resolver/CSSToStyleMap.cpp
@@ -463,16 +463,17 @@ void CSSToStyleMap::mapNinePieceImage(RenderStyle* mutableStyle, CSSPropertyID p
mapNinePieceImageSlice(current, image);
else if (current->isValueList()) {
CSSValueList* slashList = toCSSValueList(current);
+ size_t length = slashList->length();
// Map in the image slices.
- if (slashList->item(0) && slashList->item(0)->isBorderImageSliceValue())
+ if (length && slashList->item(0)->isBorderImageSliceValue())
mapNinePieceImageSlice(slashList->item(0), image);
// Map in the border slices.
- if (slashList->item(1))
+ if (length > 1)
image.setBorderSlices(mapNinePieceImageQuad(slashList->item(1)));
// Map in the outset.
- if (slashList->item(2))
+ if (length > 2)
image.setOutset(mapNinePieceImageQuad(slashList->item(2)));
} else if (current->isPrimitiveValue()) {
// Set the appropriate rules for stretch/round/repeat of the slices.
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.cpp ('k') | Source/core/css/resolver/FilterOperationResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698