Bug 526394. Part 36: Store the overflow area explicitly whenever it's not exactly equal to the border-box; if they're both empty but with different dimensions or position, we should still store the explicit overflow area. Also fix test_offsets to compute the expected scrolled area correctly. r=mats

This commit is contained in:
Robert O'Callahan 2010-01-12 10:45:21 +13:00
parent 8d3cbbd5d2
commit 68f4784a75
2 changed files with 7 additions and 6 deletions

View File

@ -51,9 +51,10 @@ function testElement(element)
var scrollWidth, scrollHeight, clientWidth, clientHeight;
if (element.id == "scrollbox") {
var lastchild = $("lastline");
scrollWidth = Math.round(lastchild.getBoundingClientRect().width) + paddingLeft + paddingRight;
scrollHeight = Math.round(element.lastChild.getBoundingClientRect().bottom) -
Math.round(element.firstChild.getBoundingClientRect().top) + paddingTop + paddingBottom;
scrollWidth = Math.floor(lastchild.getBoundingClientRect().width) + paddingLeft + paddingRight;
var contentsHeight = element.lastChild.getBoundingClientRect().bottom -
element.firstChild.getBoundingClientRect().top;
scrollHeight = Math.floor(contentsHeight) + paddingTop + paddingBottom;
clientWidth = paddingLeft + width + paddingRight - scrollbarWidth;
clientHeight = paddingTop + height + paddingBottom - scrollbarHeight;
}

View File

@ -5589,7 +5589,7 @@ nsIFrame::FinishAndStoreOverflow(nsRect* aOverflowArea, nsSize aNewSize)
if (presContext->GetTheme()->
GetWidgetOverflow(presContext->DeviceContext(), this,
disp->mAppearance, &r)) {
aOverflowArea->UnionRect(*aOverflowArea, r);
aOverflowArea->UnionRectIncludeEmpty(*aOverflowArea, r);
}
}
@ -5633,8 +5633,8 @@ nsIFrame::FinishAndStoreOverflow(nsRect* aOverflowArea, nsSize aNewSize)
}
PRBool overflowChanged;
if (*aOverflowArea != nsRect(nsPoint(0, 0), aNewSize)) {
overflowChanged = *aOverflowArea != GetOverflowRect();
if (!aOverflowArea->IsExactEqual(nsRect(nsPoint(0, 0), aNewSize))) {
overflowChanged = !aOverflowArea->IsExactEqual(GetOverflowRect());
SetOverflowRect(*aOverflowArea);
}
else {