From ee526cd913350fdc36278f771d25af41e70960b1 Mon Sep 17 00:00:00 2001 From: Benjamin Stover Date: Thu, 15 Oct 2009 15:00:39 -0400 Subject: [PATCH] Bug 522529: Diagonal panning is jerky (and a few other issues) [r=mark.finkle] --- mobile/chrome/content/browser.xul | 78 ++++++++++++++------------- mobile/chrome/tests/browser_mainui.js | 29 ++++++++-- 2 files changed, 64 insertions(+), 43 deletions(-) diff --git a/mobile/chrome/content/browser.xul b/mobile/chrome/content/browser.xul index b0541c5a8d6a..766f01c634d3 100644 --- a/mobile/chrome/content/browser.xul +++ b/mobile/chrome/content/browser.xul @@ -193,51 +193,53 @@ - - - - - + + + + + + #ifdef MOZ_PLATFORM_HILDON - + #endif - - - - - + + + + + + - - - + + + + + + + + - - - - - - - - + + + - - + - - + + + diff --git a/mobile/chrome/tests/browser_mainui.js b/mobile/chrome/tests/browser_mainui.js index cbea35f7b957..79d34b22cd92 100644 --- a/mobile/chrome/tests/browser_mainui.js +++ b/mobile/chrome/tests/browser_mainui.js @@ -6,12 +6,31 @@ const Ci = Components.interfaces; //------------------------------------------------------------------------------ // Entry point (must be named "test") function test() { - is(window.location.href, "chrome://browser/content/browser.xul", "Main window should be browser.xul"); + is(window.location.href, "chrome://browser/content/browser.xul", "Main window should be browser.xul"); - window.focus(); + window.focus(); - let browser = Browser.selectedBrowser; - isnot(browser, null, "Should have a browser"); + let browser = Browser.selectedBrowser; + isnot(browser, null, "Should have a browser"); - is(browser.currentURI.spec, Browser.selectedTab.browser.currentURI.spec, "selectedBrowser == selectedTab.browser"); + is(browser.currentURI.spec, Browser.selectedTab.browser.currentURI.spec, "selectedBrowser == selectedTab.browser"); + + testContentContainerSize(); +} + +function testContentContainerSize() { + let tiles = document.getElementById("tile-container"); + let oldtilesstyle = tiles.getAttribute("style"); + + try { + tiles.style.width = (window.innerWidth + 100) + "px"; + tiles.style.height = (window.innerHeight + 100) + "px"; + let container = document.getElementById("tile-container-container"); + let rect = container.getBoundingClientRect(); + ok(rect.width == window.innerWidth, "Content container is same width as window"); + ok(rect.height == window.innerHeight, "Content container is same height as window"); + } + finally { + tiles.setAttribute("style", oldtilesstyle); + } }