Bug 510748 - still get assertions "reflow state computed incorrect width" and "non-root frame's desired size changed during an incremental reflow"; Don't report any padding or border on both axes if scrollbars are hidden; r=dbaron

This commit is contained in:
Timothy Nikkel 2009-08-18 00:38:12 +02:00
parent d93f991e14
commit 80119bbe6d

View File

@ -1940,15 +1940,13 @@ nsCSSOffsetState::InitOffsets(nscoord aContainingBlockWidth,
} else if (frameType == nsGkAtoms::scrollbarFrame) {
// scrollbars may have had their width or height smashed to zero
// by the associated scrollframe, in which case we must not report
// any padding or border on that axis.
// any padding or border.
nsSize size(frame->GetSize());
if (size.width == 0) {
if (size.width == 0 || size.height == 0) {
mComputedPadding.left = 0;
mComputedPadding.right = 0;
mComputedBorderPadding.left = 0;
mComputedBorderPadding.right = 0;
}
if (size.height == 0) {
mComputedPadding.top = 0;
mComputedPadding.bottom = 0;
mComputedBorderPadding.top = 0;