From 4fd939e8c9dd97c45e7fcd1314f3ab482a2cf23d Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Thu, 10 Aug 2017 18:01:49 +0200 Subject: JS - make window.pageYOffset/pageXOffset/scrollX/scrollY double --- layout/forms/test/test_bug562447.html | 6 +++--- layout/forms/test/test_bug564115.html | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'layout/forms/test') diff --git a/layout/forms/test/test_bug562447.html b/layout/forms/test/test_bug562447.html index 53f84428e..99f691871 100644 --- a/layout/forms/test/test_bug562447.html +++ b/layout/forms/test/test_bug562447.html @@ -23,7 +23,7 @@ addLoadEvent(function() { setTimeout(function() { // Make sure that we're scrolled by 5000px - is(window.pageYOffset, 5000, "Make sure we're scrolled correctly"); + is(Math.round(window.pageYOffset), 5000, "Make sure we're scrolled correctly"); // Scroll back up, and mess with the input box along the way var input = document.getElementById("WhyDoYouFocusMe"); @@ -38,14 +38,14 @@ addLoadEvent(function() { window.scrollTo(0, 5000); setTimeout(function() { - is(window.pageYOffset, 5000, "Sanity check"); + is(Math.round(window.pageYOffset), 5000, "Sanity check"); window.scrollTo(0, 0); input.focus(); input.blur(); setTimeout(function() { - isnot(window.pageYOffset, 0, "This time we shouldn't be scrolled up"); + isnot(Math.round(window.pageYOffset), 0, "This time we shouldn't be scrolled up"); SimpleTest.finish(); }, 0); diff --git a/layout/forms/test/test_bug564115.html b/layout/forms/test/test_bug564115.html index 5723b55d5..ffd4222ca 100644 --- a/layout/forms/test/test_bug564115.html +++ b/layout/forms/test/test_bug564115.html @@ -30,12 +30,12 @@ addLoadEvent(function() { win.scrollTo(0, 5000); setTimeout(function() { - is(win.pageYOffset, 5000, "Page should be scrolled correctly"); + is(Math.round(win.pageYOffset), 5000, "Page should be scrolled correctly"); // Refocus the window SimpleTest.waitForFocus(function() { SimpleTest.waitForFocus(function() { - is(win.pageYOffset, 5000, + is(Math.round(win.pageYOffset), 5000, "The page's scroll offset should not have been changed"); win.close(); -- cgit v1.2.3