mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1166805 part 2 - Call SetCapacity before calling DOMSVGXXXList::MaybeInsertNullInAnimValListAt, to prevent fallible InsertElementAt calls from failing r=dholbert
This commit is contained in:
parent
cc78dd2bcf
commit
9e27700875
@ -260,6 +260,13 @@ DOMSVGLengthList::InsertItemBefore(DOMSVGLength& newItem,
|
||||
error.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
return nullptr;
|
||||
}
|
||||
if (AnimListMirrorsBaseList()) {
|
||||
if (!mAList->mAnimVal->mItems.SetCapacity(
|
||||
mAList->mAnimVal->mItems.Length() + 1, fallible)) {
|
||||
error.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
AutoChangeLengthListNotifier notifier(this);
|
||||
// Now that we know we're inserting, keep animVal list in sync as necessary.
|
||||
|
@ -244,6 +244,13 @@ DOMSVGNumberList::InsertItemBefore(DOMSVGNumber& aItem,
|
||||
error.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
return nullptr;
|
||||
}
|
||||
if (AnimListMirrorsBaseList()) {
|
||||
if (!mAList->mAnimVal->mItems.SetCapacity(
|
||||
mAList->mAnimVal->mItems.Length() + 1, fallible)) {
|
||||
error.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
AutoChangeNumberListNotifier notifier(this);
|
||||
// Now that we know we're inserting, keep animVal list in sync as necessary.
|
||||
|
@ -382,6 +382,15 @@ DOMSVGPathSegList::InsertItemBefore(DOMSVGPathSeg& aNewItem,
|
||||
aError.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
return nullptr;
|
||||
}
|
||||
if (AnimListMirrorsBaseList()) {
|
||||
DOMSVGPathSegList *animVal =
|
||||
GetDOMWrapperIfExists(InternalAList().GetAnimValKey());
|
||||
if (!animVal->mItems.SetCapacity(
|
||||
animVal->mItems.Length() + 1, fallible)) {
|
||||
aError.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
AutoChangePathSegListNotifier notifier(this);
|
||||
// Now that we know we're inserting, keep animVal list in sync as necessary.
|
||||
|
@ -318,6 +318,15 @@ DOMSVGPointList::InsertItemBefore(nsISVGPoint& aNewItem, uint32_t aIndex,
|
||||
aError.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
return nullptr;
|
||||
}
|
||||
if (AnimListMirrorsBaseList()) {
|
||||
DOMSVGPointList *animVal =
|
||||
GetDOMWrapperIfExists(InternalAList().GetAnimValKey());
|
||||
if (!animVal->mItems.SetCapacity(
|
||||
animVal->mItems.Length() + 1, fallible)) {
|
||||
aError.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
AutoChangePointListNotifier notifier(this);
|
||||
// Now that we know we're inserting, keep animVal list in sync as necessary.
|
||||
|
@ -252,6 +252,13 @@ DOMSVGTransformList::InsertItemBefore(SVGTransform& newItem,
|
||||
error.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
return nullptr;
|
||||
}
|
||||
if (AnimListMirrorsBaseList()) {
|
||||
if (!mAList->mAnimVal->mItems.SetCapacity(
|
||||
mAList->mAnimVal->mItems.Length() + 1, fallible)) {
|
||||
error.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
AutoChangeTransformListNotifier notifier(this);
|
||||
// Now that we know we're inserting, keep animVal list in sync as necessary.
|
||||
|
Loading…
Reference in New Issue
Block a user