Lines Matching refs:index

138     bool canGetItem(PropertyType& values, unsigned index, ExceptionCode& ec)
140 if (index >= values.size()) {
148 ListItemType getItemValues(PropertyType& values, unsigned index, ExceptionCode& ec)
150 if (!canGetItem(values, index, ec))
154 return values.at(index);
157 PassListItemTearOff getItemValuesAndWrappers(AnimatedListPropertyTearOff* animatedList, unsigned index, ExceptionCode& ec)
161 if (!canGetItem(values, index, ec))
169 RefPtr<ListItemTearOff> wrapper = wrappers.at(index);
174 wrapper = ListItemTearOff::create(animatedList, UndefinedRole, values.at(index));
175 wrappers.at(index) = wrapper;
182 ListItemType insertItemBeforeValues(PropertyType& values, const ListItemType& newItem, unsigned index, ExceptionCode& ec)
187 // Spec: If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list.
188 if (index > values.size())
189 index = values.size();
192 processIncomingListItemValue(newItem, &index);
194 // Spec: Inserts a new item into the list at the specified position. The index of the item before which the new item is to be
195 // inserted. The first item is number 0. If the index is equal to 0, then the new item is inserted at the front of the list.
196 values.insert(index, newItem);
202 PassListItemTearOff insertItemBeforeValuesAndWrappers(AnimatedListPropertyTearOff* animatedList, PassListItemTearOff passNewItem, unsigned index, ExceptionCode& ec)
217 // Spec: If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list.
218 if (index > values.size())
219 index = values.size();
225 processIncomingListItemWrapper(newItem, &index);
227 // Spec: Inserts a new item into the list at the specified position. The index of the item before which the new item is to be
228 // inserted. The first item is number 0. If the index is equal to 0, then the new item is inserted at the front of the list.
229 values.insert(index, newItem->propertyReference());
231 // Store new wrapper at position 'index', change its underlying value, so mutations of newItem, directly affect the item in the list.
232 wrappers.insert(index, newItem);
239 bool canReplaceItem(PropertyType& values, unsigned index, ExceptionCode& ec)
244 if (index >= values.size()) {
252 ListItemType replaceItemValues(PropertyType& values, const ListItemType& newItem, unsigned index, ExceptionCode& ec)
254 if (!canReplaceItem(values, index, ec))
258 // Spec: If the item is already in this list, note that the index of the item to replace is before the removal of the item.
259 processIncomingListItemValue(newItem, &index);
267 // Update the value at the desired position 'index'.
268 values.at(index) = newItem;
274 PassListItemTearOff replaceItemValuesAndWrappers(AnimatedListPropertyTearOff* animatedList, PassListItemTearOff passNewItem, unsigned index, ExceptionCode& ec)
278 if (!canReplaceItem(values, index, ec))
292 // Spec: If the item is already in this list, note that the index of the item to replace is before the removal of the item.
293 processIncomingListItemWrapper(newItem, &index);
303 RefPtr<ListItemTearOff> oldItem = wrappers.at(index);
307 // Update the value and the wrapper at the desired position 'index'.
308 values.at(index) = newItem->propertyReference();
309 wrappers.at(index) = newItem;
316 bool canRemoveItem(PropertyType& values, unsigned index, ExceptionCode& ec)
321 if (index >= values.size()) {
329 ListItemType removeItemValues(PropertyType& values, unsigned index, ExceptionCode& ec)
331 if (!canRemoveItem(values, index, ec))
334 ListItemType oldItem = values.at(index);
335 values.remove(index);
341 PassListItemTearOff removeItemValuesAndWrappers(AnimatedListPropertyTearOff* animatedList, unsigned index, ExceptionCode& ec)
345 if (!canRemoveItem(values, index, ec))
352 RefPtr<ListItemTearOff> oldItem = wrappers.at(index);
354 oldItem = ListItemTearOff::create(animatedList, UndefinedRole, values.at(index));
357 wrappers.remove(index);
358 values.remove(index);