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

Unified Diff: Source/core/css/resolver/StyleBuilderConverter.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/resolver/FontBuilder.cpp ('k') | Source/core/css/resolver/StyleBuilderCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleBuilderConverter.cpp
diff --git a/Source/core/css/resolver/StyleBuilderConverter.cpp b/Source/core/css/resolver/StyleBuilderConverter.cpp
index fe94e10930e76b2430007d71c23528bd9feaf08d..09a4e19b33f0d8e0002e1316ab7edc835793afbe 100644
--- a/Source/core/css/resolver/StyleBuilderConverter.cpp
+++ b/Source/core/css/resolver/StyleBuilderConverter.cpp
@@ -168,8 +168,8 @@ GridTrackSize StyleBuilderConverter::convertGridTrackSize(StyleResolverState& st
CSSFunctionValue* minmaxFunction = toCSSFunctionValue(value);
CSSValueList* arguments = minmaxFunction->arguments();
ASSERT_WITH_SECURITY_IMPLICATION(arguments->length() == 2);
- GridLength minTrackBreadth(convertGridTrackBreadth(state, toCSSPrimitiveValue(arguments->itemWithoutBoundsCheck(0))));
- GridLength maxTrackBreadth(convertGridTrackBreadth(state, toCSSPrimitiveValue(arguments->itemWithoutBoundsCheck(1))));
+ GridLength minTrackBreadth(convertGridTrackBreadth(state, toCSSPrimitiveValue(arguments->item(0))));
+ GridLength maxTrackBreadth(convertGridTrackBreadth(state, toCSSPrimitiveValue(arguments->item(1))));
return GridTrackSize(minTrackBreadth, maxTrackBreadth);
}
@@ -343,7 +343,7 @@ PassRefPtr<QuotesData> StyleBuilderConverter::convertQuotes(StyleResolverState&,
CSSValueList* list = toCSSValueList(value);
RefPtr<QuotesData> quotes = QuotesData::create();
for (size_t i = 0; i < list->length(); i += 2) {
- CSSValue* first = list->itemWithoutBoundsCheck(i);
+ CSSValue* first = list->item(i);
// item() returns null if out of bounds so this is safe.
CSSValue* second = list->item(i + 1);
if (!second)
@@ -418,11 +418,11 @@ PassRefPtr<SVGLengthList> StyleBuilderConverter::convertStrokeDasharray(StyleRes
RefPtr<SVGLengthList> array = SVGLengthList::create();
size_t length = dashes->length();
for (size_t i = 0; i < length; ++i) {
- CSSValue* currValue = dashes->itemWithoutBoundsCheck(i);
+ CSSValue* currValue = dashes->item(i);
if (!currValue->isPrimitiveValue())
continue;
- CSSPrimitiveValue* dash = toCSSPrimitiveValue(dashes->itemWithoutBoundsCheck(i));
+ CSSPrimitiveValue* dash = toCSSPrimitiveValue(dashes->item(i));
array->append(SVGLength::fromCSSPrimitiveValue(dash));
}
« no previous file with comments | « Source/core/css/resolver/FontBuilder.cpp ('k') | Source/core/css/resolver/StyleBuilderCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698