relanding with a function returning early to test impact on Linux Txul
This commit is contained in:
@@ -4610,6 +4610,7 @@ var gHomeButton = {
|
||||
|
||||
updatePersonalToolbarStyle: function (homeButton)
|
||||
{
|
||||
return; // xxxmpc temp hack for perf testing
|
||||
if (!homeButton)
|
||||
homeButton = document.getElementById("home-button");
|
||||
if (homeButton)
|
||||
|
||||
@@ -291,7 +291,7 @@
|
||||
command="Browser:Stop"
|
||||
tooltiptext="&stopButton.tooltip;"/>
|
||||
|
||||
<toolbarbutton id="home-button" class="bookmark-item chromeclass-toolbar-additional"
|
||||
<toolbarbutton id="home-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
persist="class"
|
||||
label="&homeButton.label;"
|
||||
ondragover="nsDragAndDrop.dragOver(event, homeButtonObserver);"
|
||||
@@ -451,9 +451,9 @@
|
||||
fullscreentoolbar="true" mode="icons" iconsize="large"
|
||||
customizable="true"
|
||||
#ifdef XP_MACOSX
|
||||
defaultset="unified-back-forward-button,reload-button,stop-button,urlbar-container,search-container,throbber-box"
|
||||
defaultset="unified-back-forward-button,reload-button,stop-button,home-button,urlbar-container,search-container,throbber-box"
|
||||
#else
|
||||
defaultset="unified-back-forward-button,reload-button,stop-button,urlbar-container,search-container,fullscreenflex,window-controls"
|
||||
defaultset="unified-back-forward-button,reload-button,stop-button,home-button,urlbar-container,search-container,fullscreenflex,window-controls"
|
||||
#endif
|
||||
context="toolbar-context-menu">
|
||||
#ifndef XP_MACOSX
|
||||
@@ -480,7 +480,7 @@
|
||||
mode="icons" iconsize="small" defaulticonsize="small"
|
||||
class="chromeclass-directories"
|
||||
context="toolbar-context-menu"
|
||||
defaultset="home-button,personal-bookmarks"
|
||||
defaultset="personal-bookmarks"
|
||||
toolbarname="&personalbarCmd.label;" accesskey="&personalbarCmd.accesskey;"
|
||||
customizable="true"/>
|
||||
</toolbox>
|
||||
|
||||
@@ -503,49 +503,12 @@ BrowserGlue.prototype = {
|
||||
this._dirty = false;
|
||||
|
||||
var currentSet = this._rdf.GetResource("currentset");
|
||||
var collapsed = this._rdf.GetResource("collapsed");
|
||||
var target;
|
||||
var moveHome;
|
||||
var homePattern = /(?:^|,)home-button(?:$|,)/;
|
||||
|
||||
// get an nsIRDFResource for the PersonalToolbar item
|
||||
var personalBar = this._rdf.GetResource("chrome://browser/content/browser.xul#PersonalToolbar");
|
||||
var personalBarCollapsed = this._getPersist(personalBar, collapsed) == "true";
|
||||
|
||||
// get an nsIRDFResource for the nav-bar item
|
||||
var navBar = this._rdf.GetResource("chrome://browser/content/browser.xul#nav-bar");
|
||||
target = this._getPersist(navBar, currentSet);
|
||||
if (target) {
|
||||
let originalTarget = target;
|
||||
|
||||
// move Home if we find it in the nav-bar and the personal toolbar isn't collapsed
|
||||
if (!personalBarCollapsed)
|
||||
target = target.replace(homePattern, ",");
|
||||
moveHome = (target != originalTarget);
|
||||
|
||||
// add the new combined back and forward button
|
||||
if (!/(?:^|,)unified-back-forward-button(?:$|,)/.test(target))
|
||||
target = "unified-back-forward-button," + target;
|
||||
|
||||
if (target != originalTarget)
|
||||
this._setPersist(navBar, currentSet, target);
|
||||
} else {
|
||||
// nav-bar doesn't have a currentset, so the defaultset will be used,
|
||||
// which means Home will be moved
|
||||
moveHome = true;
|
||||
}
|
||||
|
||||
if (moveHome) {
|
||||
// If the personal toolbar has a currentset, add Home. The defaultset will be
|
||||
// used otherwise.
|
||||
target = this._getPersist(personalBar, currentSet);
|
||||
if (target && !homePattern.test(target))
|
||||
this._setPersist(personalBar, currentSet, "home-button," + target);
|
||||
|
||||
// uncollapse the personal toolbar
|
||||
if (personalBarCollapsed)
|
||||
this._setPersist(personalBar, collapsed, "false");
|
||||
}
|
||||
var target = this._getPersist(navBar, currentSet);
|
||||
if (target && !/(?:^|,)unified-back-forward-button(?:$|,)/.test(target))
|
||||
this._setPersist(navBar, currentSet, "unified-back-forward-button," + target);
|
||||
|
||||
// force the RDF to be saved
|
||||
if (this._dirty)
|
||||
|
||||
Reference in New Issue
Block a user