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:
@@ -75,6 +75,9 @@
|
||||
|
||||
- (void)insertElement:(HTMLElement *)element atIndex:(NSUInteger)index
|
||||
{
|
||||
if (index > _list.count) {
|
||||
index = _list.count;
|
||||
}
|
||||
[_list insertObject:element atIndex:index];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user