Bug 1144501 - Take account of orthogonal writing modes when adjusting available size to reflow a child frame. r=smontagu

This commit is contained in:
Jonathan Kew 2015-04-07 15:35:30 +01:00
Родитель 21b7ceb7e9
Коммит a97792aed1
1 изменённых файлов: 9 добавлений и 3 удалений

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

@ -245,10 +245,16 @@ nsBlockReflowContext::ReflowBlock(const LogicalRect& aSpace,
printf(" margin => %d, clearance => %d\n", mBStartMargin.get(), aClearance); printf(" margin => %d, clearance => %d\n", mBStartMargin.get(), aClearance);
#endif #endif
// Adjust the available block size if it's constrained so that the // Adjust the available size if it's constrained so that the
// child frame doesn't think it can reflow into its margin area. // child frame doesn't think it can reflow into its margin area.
if (NS_UNCONSTRAINEDSIZE != aFrameRS.AvailableBSize()) { if (mWritingMode.IsOrthogonalTo(mFrame->GetWritingMode())) {
aFrameRS.AvailableBSize() -= mBStartMargin.get() + aClearance; if (NS_UNCONSTRAINEDSIZE != aFrameRS.AvailableISize()) {
aFrameRS.AvailableISize() -= mBStartMargin.get() + aClearance;
}
} else {
if (NS_UNCONSTRAINEDSIZE != aFrameRS.AvailableBSize()) {
aFrameRS.AvailableBSize() -= mBStartMargin.get() + aClearance;
}
} }
} }