Bug 895567 - Fix for start page flashing into view during initial load of a page. r=sfoster

This commit is contained in:
Jim Mathies 2013-07-25 19:25:13 -05:00
parent c16e244bd6
commit 309bb1adbb
2 changed files with 21 additions and 13 deletions

View File

@ -141,15 +141,20 @@ const WebProgress = {
_networkStart: function _networkStart(aJson, aTab) {
aTab.startLoading();
if (aTab == Browser.selectedTab)
BrowserUI.update(TOOLBARSTATE_LOADING);
if (aTab == Browser.selectedTab) {
// NO_STARTUI_VISIBILITY since the current uri for the tab has not
// been updated yet. If we're coming off of the start page, this
// would briefly show StartUI until _locationChange is called.
BrowserUI.update(BrowserUI.NO_STARTUI_VISIBILITY);
}
},
_networkStop: function _networkStop(aJson, aTab) {
aTab.endLoading();
if (aTab == Browser.selectedTab)
BrowserUI.update(TOOLBARSTATE_LOADED);
if (aTab == Browser.selectedTab) {
BrowserUI.update();
}
},
_windowStart: function _windowStart(aJson, aTab) {

View File

@ -11,11 +11,6 @@ Cu.import("resource://gre/modules/devtools/dbg-server.jsm")
* Constants
*/
// BrowserUI.update(state) constants. Currently passed in
// but update doesn't pay attention to them. Can we remove?
const TOOLBARSTATE_LOADING = 1;
const TOOLBARSTATE_LOADED = 2;
// Page for which the start UI is shown
const kStartOverlayURI = "about:start";
@ -297,11 +292,19 @@ var BrowserUI = {
* Navigation
*/
/* Updates the overall state of the toolbar, but not the URL bar. */
update: function(aState) {
let uri = this.getDisplayURI(Browser.selectedBrowser);
StartUI.update(uri);
// BrowserUI update bit flags
NO_STARTUI_VISIBILITY: 1, // don't change the start ui visibility
/*
* Updates the overall state of startui visibility and the toolbar, but not
* the URL bar.
*/
update: function(aFlags) {
let flags = aFlags || 0;
if (!(flags & this.NO_STARTUI_VISIBILITY)) {
let uri = this.getDisplayURI(Browser.selectedBrowser);
StartUI.update(uri);
}
this._updateButtons();
this._updateToolbar();
},