Bug 1158290 part 2: Use logical (not physical) skipsides & borderpadding when chipping away from available BSize. r=mats

This commit is contained in:
Daniel Holbert 2015-05-12 13:34:23 -07:00
Родитель f82cdd0c52
Коммит 44b034651d
1 изменённых файлов: 8 добавлений и 6 удалений

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

@ -3533,14 +3533,16 @@ nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
const FlexboxAxisTracker axisTracker(aReflowState.mStylePosition,
aReflowState.GetWritingMode());
// If we're being fragmented into a constrained height, subtract off
// borderpadding-top from it, to get the available height for our
// content box. (Don't subtract if we're skipping top border/padding,
// though.)
// If we're being fragmented into a constrained BSize, then subtract off
// borderpadding BStart from that constrained BSize, to get the available
// BSize for our content box. (No need to subtract the borderpadding BStart
// if we're already skipping it via GetLogicalSkipSides, though.)
nscoord availableBSizeForContent = aReflowState.AvailableBSize();
if (availableBSizeForContent != NS_UNCONSTRAINEDSIZE &&
!GetSkipSides().Top()) {
availableBSizeForContent -= aReflowState.ComputedPhysicalBorderPadding().top;
!(GetLogicalSkipSides(&aReflowState).BStart())) {
WritingMode wm = aReflowState.GetWritingMode();
availableBSizeForContent -=
aReflowState.ComputedLogicalBorderPadding().BStart(wm);
// (Don't let that push availableBSizeForContent below zero, though):
availableBSizeForContent = std::max(availableBSizeForContent, 0);
}