Bug 681192. Part 15: Fix test now that scrollbox scrollWidth/Heights isn't special. r=matspal

--HG--
extra : rebase_source : d77548c8b7b2c62a66070a4cd8414cdf1f7819e6
This commit is contained in:
Robert O'Callahan 2012-05-10 17:24:20 +12:00
parent 390dee1351
commit f8e0bb41da

View File

@ -32,11 +32,6 @@ function toNearestAppunit(v)
return Math.round(v*60)/60; return Math.round(v*60)/60;
} }
function floorToNearestAppunit(v)
{
return Math.floor(toNearestAppunit(v));
}
function isEqualAppunits(a, b, msg) function isEqualAppunits(a, b, msg)
{ {
is(toNearestAppunit(a), toNearestAppunit(b), msg); is(toNearestAppunit(a), toNearestAppunit(b), msg);
@ -67,11 +62,11 @@ function testElement(element)
var scrollWidth, scrollHeight, clientWidth, clientHeight; var scrollWidth, scrollHeight, clientWidth, clientHeight;
if (element.id == "scrollbox") { if (element.id == "scrollbox") {
var lastchild = $("lastline"); var lastchild = $("lastline");
scrollWidth = floorToNearestAppunit(lastchild.getBoundingClientRect().width + paddingLeft + paddingRight); scrollWidth = lastchild.getBoundingClientRect().width + paddingLeft + paddingRight;
var top = element.firstChild.getBoundingClientRect().top; var top = element.firstChild.getBoundingClientRect().top;
var bottom = element.lastChild.getBoundingClientRect().bottom; var bottom = element.lastChild.getBoundingClientRect().bottom;
var contentsHeight = bottom - top; var contentsHeight = bottom - top;
scrollHeight = floorToNearestAppunit(contentsHeight + paddingTop + paddingBottom); scrollHeight = contentsHeight + paddingTop + paddingBottom;
clientWidth = paddingLeft + width + paddingRight - scrollbarWidth; clientWidth = paddingLeft + width + paddingRight - scrollbarWidth;
clientHeight = paddingTop + height + paddingBottom - scrollbarHeight; clientHeight = paddingTop + height + paddingBottom - scrollbarHeight;
} }