зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1420928 - Templatize functions that ensures nsStyleAutoArray length. r=boris
MozReview-Commit-ID: 7MvW9OCBkCP --HG-- extra : rebase_source : 723092199ce780058b0f87bfd0c208987c847e47
This commit is contained in:
Родитель
9070574de9
Коммит
ff1b1ade87
|
@ -1802,19 +1802,25 @@ Gecko_EnsureImageLayersLength(nsStyleImageLayers* aLayers, size_t aLen,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename StyleType>
|
||||||
|
static void
|
||||||
|
EnsureStyleAutoArrayLength(StyleType* aArray, size_t aLen)
|
||||||
|
{
|
||||||
|
size_t oldLength = aArray->Length();
|
||||||
|
|
||||||
|
aArray->EnsureLengthAtLeast(aLen);
|
||||||
|
|
||||||
|
for (size_t i = oldLength; i < aLen; ++i) {
|
||||||
|
(*aArray)[i].SetInitialValues();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Gecko_EnsureStyleAnimationArrayLength(void* aArray, size_t aLen)
|
Gecko_EnsureStyleAnimationArrayLength(void* aArray, size_t aLen)
|
||||||
{
|
{
|
||||||
auto base =
|
auto base =
|
||||||
static_cast<nsStyleAutoArray<StyleAnimation>*>(aArray);
|
static_cast<nsStyleAutoArray<StyleAnimation>*>(aArray);
|
||||||
|
EnsureStyleAutoArrayLength(base, aLen);
|
||||||
size_t oldLength = base->Length();
|
|
||||||
|
|
||||||
base->EnsureLengthAtLeast(aLen);
|
|
||||||
|
|
||||||
for (size_t i = oldLength; i < aLen; ++i) {
|
|
||||||
(*base)[i].SetInitialValues();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1822,14 +1828,7 @@ Gecko_EnsureStyleTransitionArrayLength(void* aArray, size_t aLen)
|
||||||
{
|
{
|
||||||
auto base =
|
auto base =
|
||||||
reinterpret_cast<nsStyleAutoArray<StyleTransition>*>(aArray);
|
reinterpret_cast<nsStyleAutoArray<StyleTransition>*>(aArray);
|
||||||
|
EnsureStyleAutoArrayLength(base, aLen);
|
||||||
size_t oldLength = base->Length();
|
|
||||||
|
|
||||||
base->EnsureLengthAtLeast(aLen);
|
|
||||||
|
|
||||||
for (size_t i = oldLength; i < aLen; ++i) {
|
|
||||||
(*base)[i].SetInitialValues();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Загрузка…
Ссылка в новой задаче