From 4b7ef956c763161c02d29c93c61bf2300e1aaee1 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Mon, 14 Mar 2016 14:07:16 -0400 Subject: [PATCH] Bug 1255997 - Account for scrollbar dimensions when testing the size of the displayport. r=botond MozReview-Commit-ID: 8SrIfA8xuqq --- gfx/layers/apz/test/mochitest/helper_bug982141.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gfx/layers/apz/test/mochitest/helper_bug982141.html b/gfx/layers/apz/test/mochitest/helper_bug982141.html index 4565f9e25c31..4167e64935cf 100644 --- a/gfx/layers/apz/test/mochitest/helper_bug982141.html +++ b/gfx/layers/apz/test/mochitest/helper_bug982141.html @@ -82,7 +82,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=982141 SimpleTest.is(dpFields.length, 4, "expected displayport string of form (x,y,w,h)"); var dpWidth = dpFields[2]; var dpHeight = dpFields[3]; - SimpleTest.ok(dpWidth >= 50 && dpHeight >= 50, + var subframe = document.getElementById('subframe'); + // The clientWidth and clientHeight may be less than 50 if there are scrollbars showing. + // In general they will be (50 - , 50 - ). + SimpleTest.ok(subframe.clientWidth > 0, "Expected a non-zero clientWidth, got: " + subframe.clientWidth); + SimpleTest.ok(subframe.clientHeight > 0, "Expected a non-zero clientHeight, got: " + subframe.clientHeight); + SimpleTest.ok(dpWidth >= subframe.clientWidth && dpHeight >= subframe.clientHeight, "expected a displayport at least as large as the scrollable element, got " + childDisplayport); window.opener.finishTest(); @@ -92,7 +97,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=982141 Mozilla Bug 982141 -
+
Wide content so that the vertical scrollbar for the parent div doesn't eat into the 50px width and reduce the width of the