Bug 486065. Hack nsCSSOffsetState::InitOffsets to zero out computed padding and borders when the scrollbar size is zero. r=dbaron

--HG--
extra : rebase_source : 92bcaee46ded00722e3fc86b4ca538e5f90f16ef
This commit is contained in:
Zack Weinberg 2009-07-30 15:43:22 +12:00
Родитель a9abb503c1
Коммит d859d678de
1 изменённых файлов: 19 добавлений и 1 удалений

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

@ -1925,7 +1925,8 @@ nsCSSOffsetState::InitOffsets(nscoord aContainingBlockWidth,
}
mComputedBorderPadding += mComputedPadding;
if (frame->GetType() == nsGkAtoms::tableFrame) {
nsIAtom* frameType = frame->GetType();
if (frameType == nsGkAtoms::tableFrame) {
nsTableFrame *tableFrame = static_cast<nsTableFrame*>(frame);
if (tableFrame->IsBorderCollapse()) {
@ -1936,6 +1937,23 @@ nsCSSOffsetState::InitOffsets(nscoord aContainingBlockWidth,
mComputedPadding.SizeTo(0,0,0,0);
mComputedBorderPadding = tableFrame->GetIncludedOuterBCBorder();
}
} 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.
nsSize size(frame->GetSize());
if (size.width == 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;
mComputedBorderPadding.bottom = 0;
}
}
}