Bug 1313421 part 1: Unconditionally cache a FlexItem's ascent, after it's been reflowed. r=mats

This removes a (very minor) optimization. The optimization was simply that we
avoided storing this nscoord value, if we could tell that we weren't ever going
to need it. Now it's becoming a bit more complicated to prove that we'll never
need it, so we might as well just store it unconditionally.

MozReview-Commit-ID: 94FFc9SO516
This commit is contained in:
Daniel Holbert 2016-10-27 18:56:41 -07:00
Родитель 9fa3ebe028
Коммит 0f4079b53d
1 изменённых файлов: 3 добавлений и 19 удалений

Просмотреть файл

@ -1645,14 +1645,7 @@ nsFlexContainerFrame::
0, 0, flags);
aFlexItem.SetHadMeasuringReflow();
// If this is the first child, save its ascent, since it may be what
// establishes the container's baseline. Also save the ascent if this child
// needs to be baseline-aligned. (Else, we don't care about ascent/baseline.)
if (aFlexItem.Frame() == mFrames.FirstChild() ||
aFlexItem.GetAlignSelf() == NS_STYLE_ALIGN_BASELINE) {
aFlexItem.SetAscent(childDesiredSize.BlockStartAscent());
}
aFlexItem.SetAscent(childDesiredSize.BlockStartAscent());
// Subtract border/padding in vertical axis, to get _just_
// the effective computed value of the "height" property.
@ -3782,13 +3775,7 @@ nsFlexContainerFrame::SizeItemInCrossAxis(
aItem.SetCrossSize(childDesiredSize.Height() - crossAxisBorderPadding);
}
// If this is the first child, save its ascent, since it may be what
// establishes the container's baseline. Also save the ascent if this child
// needs to be baseline-aligned. (Else, we don't care about baseline/ascent.)
if (aItem.Frame() == mFrames.FirstChild() ||
aItem.GetAlignSelf() == NS_STYLE_ALIGN_BASELINE) {
aItem.SetAscent(childDesiredSize.BlockStartAscent());
}
aItem.SetAscent(childDesiredSize.BlockStartAscent());
}
void
@ -4451,10 +4438,7 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
childDesiredSize, &childReflowInput,
outerWM, aFramePos, aContainerSize, 0);
// Save the first child's ascent; it may establish container's baseline.
if (aItem.Frame() == mFrames.FirstChild()) {
aItem.SetAscent(childDesiredSize.BlockStartAscent());
}
aItem.SetAscent(childDesiredSize.BlockStartAscent());
}
/* virtual */ nscoord