mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 969879 - Use infallible allocation to store the style information for CSS transitions and animations; r=dbaron
This commit is contained in:
parent
a5346a9f51
commit
fbb338d533
@ -4746,18 +4746,7 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
|
||||
display, parentDisplay, aRuleData,
|
||||
canStoreInRuleTree);
|
||||
|
||||
if (!display->mTransitions.SetLength(numTransitions)) {
|
||||
NS_WARNING("failed to allocate transitions array");
|
||||
display->mTransitions.SetLength(1);
|
||||
NS_ABORT_IF_FALSE(display->mTransitions.Length() == 1,
|
||||
"could not allocate using auto array buffer");
|
||||
numTransitions = 1;
|
||||
FOR_ALL_TRANSITION_PROPS(p) {
|
||||
TransitionPropData& d = transitionPropData[p];
|
||||
|
||||
d.num = 1;
|
||||
}
|
||||
}
|
||||
display->mTransitions.SetLength(numTransitions);
|
||||
|
||||
FOR_ALL_TRANSITION_PROPS(p) {
|
||||
const TransitionPropInfo& i = transitionPropInfo[p];
|
||||
@ -4913,18 +4902,7 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
|
||||
display, parentDisplay, aRuleData,
|
||||
canStoreInRuleTree);
|
||||
|
||||
if (!display->mAnimations.SetLength(numAnimations)) {
|
||||
NS_WARNING("failed to allocate animations array");
|
||||
display->mAnimations.SetLength(1);
|
||||
NS_ABORT_IF_FALSE(display->mAnimations.Length() == 1,
|
||||
"could not allocate using auto array buffer");
|
||||
numAnimations = 1;
|
||||
FOR_ALL_ANIMATION_PROPS(p) {
|
||||
TransitionPropData& d = animationPropData[p];
|
||||
|
||||
d.num = 1;
|
||||
}
|
||||
}
|
||||
display->mAnimations.SetLength(numAnimations);
|
||||
|
||||
FOR_ALL_ANIMATION_PROPS(p) {
|
||||
const TransitionPropInfo& i = animationPropInfo[p];
|
||||
|
@ -1819,7 +1819,7 @@ struct nsStyleDisplay {
|
||||
nsStyleCoord mChildPerspective; // [reset] coord
|
||||
nsStyleCoord mPerspectiveOrigin[2]; // [reset] percent, coord, calc
|
||||
|
||||
AutoFallibleTArray<nsTransition, 1> mTransitions; // [reset]
|
||||
nsAutoTArray<nsTransition, 1> mTransitions; // [reset]
|
||||
// The number of elements in mTransitions that are not from repeating
|
||||
// a list due to another property being longer.
|
||||
uint32_t mTransitionTimingFunctionCount,
|
||||
@ -1827,7 +1827,7 @@ struct nsStyleDisplay {
|
||||
mTransitionDelayCount,
|
||||
mTransitionPropertyCount;
|
||||
|
||||
AutoFallibleTArray<nsAnimation, 1> mAnimations; // [reset]
|
||||
nsAutoTArray<nsAnimation, 1> mAnimations; // [reset]
|
||||
// The number of elements in mAnimations that are not from repeating
|
||||
// a list due to another property being longer.
|
||||
uint32_t mAnimationTimingFunctionCount,
|
||||
|
Loading…
Reference in New Issue
Block a user