Bug 522529: Diagonal panning is jerky (and a few other issues) [r=mark.finkle]

This commit is contained in:
Benjamin Stover 2009-10-15 15:00:39 -04:00
parent 2fbdff31a5
commit b9c2b4a527
2 changed files with 64 additions and 43 deletions

View File

@ -193,51 +193,53 @@
</vbox>
<!-- Content Area -->
<scrollbox id="tile-container-container" style="overflow: hidden; -moz-box-orient: vertical;">
<!-- Main Toolbar -->
<box id="toolbar-container" class="panel-dark toolbar-height">
<box id="toolbar-moveable-container">
<toolbar id="toolbar-main" class="panel-dark window-width">
<scrollbox id="tile-container-container" class="window-width window-height" style="overflow: hidden;">
<vbox>
<!-- Main Toolbar -->
<box id="toolbar-container" class="panel-dark toolbar-height">
<box id="toolbar-moveable-container">
<toolbar id="toolbar-main" class="panel-dark window-width">
#ifdef MOZ_PLATFORM_HILDON
<toolbarbutton id="tool-app-switch" class="button-image" oncommand="BrowserUI.switchTask();"/>
<toolbarbutton id="tool-app-switch" class="button-image" oncommand="BrowserUI.switchTask();"/>
#endif
<hbox id="urlbar-container" flex="1">
<box id="identity-box"
onclick="getIdentityHandler().handleIdentityButtonEvent(event);"
onkeypress="getIdentityHandler().handleIdentityButtonEvent(event);">
<box id="urlbar-image-box">
<image id="urlbar-throbber"/>
<image id="urlbar-favicon" hidden="true"/>
<hbox id="urlbar-container" flex="1">
<box id="identity-box"
onclick="getIdentityHandler().handleIdentityButtonEvent(event);"
onkeypress="getIdentityHandler().handleIdentityButtonEvent(event);">
<box id="urlbar-image-box">
<image id="urlbar-throbber"/>
<image id="urlbar-favicon" hidden="true"/>
</box>
</box>
</box>
<hbox id="urlbar-editarea" flex="1">
<textbox id="urlbar-edit"
type="autocomplete"
autocompletesearch="history"
autocompletepopup="popup_autocomplete"
enablehistory="false"
maxrows="6"
completeselectedindex="true"
minresultsforpopup="0"
flex="1"
ontextentered="BrowserUI.goToURI();"
clickSelectsAll="true"/>
<hbox id="urlbar-editarea" flex="1">
<textbox id="urlbar-edit"
type="autocomplete"
autocompletesearch="history"
autocompletepopup="popup_autocomplete"
enablehistory="false"
maxrows="6"
completeselectedindex="true"
minresultsforpopup="0"
flex="1"
ontextentered="BrowserUI.goToURI();"
clickSelectsAll="true"/>
</hbox>
<hbox id="urlbar-icons" mode="view">
<toolbarbutton id="tool-reload" class="urlbar-cap-button" command="cmd_reload"/>
<toolbarbutton id="tool-stop" class="urlbar-cap-button" command="cmd_stop"/>
<toolbarbutton id="tool-go" class="urlbar-cap-button" command="cmd_go"/>
</hbox>
</hbox>
<hbox id="urlbar-icons" mode="view">
<toolbarbutton id="tool-reload" class="urlbar-cap-button" command="cmd_reload"/>
<toolbarbutton id="tool-stop" class="urlbar-cap-button" command="cmd_stop"/>
<toolbarbutton id="tool-go" class="urlbar-cap-button" command="cmd_go"/>
</hbox>
</hbox>
<toolbarbutton id="tool-app-close" class="urlbar-button button-image" command="cmd_close"/>
</toolbar>
<toolbarbutton id="tool-app-close" class="urlbar-button button-image" command="cmd_close"/>
</toolbar>
</box>
</box>
</box>
<notificationbox id="notifications"/>
<notificationbox id="notifications"/>
<!-- Content viewport -->
<html:div id="tile-container" class="window-height" style="overflow: hidden;"/>
<!-- Content viewport -->
<html:div id="tile-container" style="overflow: hidden;"/>
</vbox>
</scrollbox>
<!-- Right toolbar -->

View File

@ -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);
}
}