Add index-bounds-check to the list of active formatting elements when inserting at index

In some cases the bookmark-index in the adoption-agency-algorithm lies outside the lists bounds, in this
case the new elements is to be inserted at the end of the list.
This commit is contained in:
iska
2015-04-05 13:31:59 +02:00
parent c369abbfee
commit 664e555347
@@ -75,6 +75,9 @@
- (void)insertElement:(HTMLElement *)element atIndex:(NSUInteger)index
{
if (index > _list.count) {
index = _list.count;
}
[_list insertObject:element atIndex:index];
}