diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index 93f659b6395..32ed9f970db 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,4 +1,4 @@
{
- "revision": "9919e96678a4fc08ffe6ca9068bfc245394fa5e3",
+ "revision": "2cc6e0988688b33fa46e3a05a726fb7919d7420e",
"repo_path": "/integration/gaia-central"
}
diff --git a/browser/base/content/browser-customization.js b/browser/base/content/browser-customization.js
index 369f6cbd22c..4d15dea8c8d 100644
--- a/browser/base/content/browser-customization.js
+++ b/browser/base/content/browser-customization.js
@@ -40,6 +40,7 @@ let CustomizationHandler = {
}
CombinedStopReload.uninit();
+ CombinedBackForward.uninit();
PlacesToolbarHelper.customizeStart();
BookmarkingUI.customizeStart();
DownloadsButton.customizeStart();
@@ -76,6 +77,7 @@ let CustomizationHandler = {
// The url bar splitter state is dependent on whether stop/reload
// and the location bar are combined, so we need this ordering
CombinedStopReload.init();
+ CombinedBackForward.init();
UpdateUrlbarSearchSplitterState();
// Update the urlbar
diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
index a4e70625e72..5beac53e6d5 100644
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -251,7 +251,15 @@ function UpdateBackForwardCommands(aWebNavigation) {
backBroadcaster.setAttribute("disabled", true);
}
- if (forwardDisabled == aWebNavigation.canGoForward) {
+ let canGoForward = aWebNavigation.canGoForward;
+ if (forwardDisabled) {
+ // Force the button to either be hidden (if we are already disabled,
+ // and should be), or to show if we're about to un-disable it:
+ // otherwise no transition will occur and it'll never show:
+ CombinedBackForward.setForwardButtonOcclusion(!canGoForward);
+ }
+
+ if (forwardDisabled == canGoForward) {
if (forwardDisabled)
forwardBroadcaster.removeAttribute("disabled");
else
@@ -904,6 +912,7 @@ var gBrowserInit = {
// Misc. inits.
CombinedStopReload.init();
+ CombinedBackForward.init();
gPrivateBrowsingUI.init();
TabsInTitlebar.init();
@@ -1221,6 +1230,7 @@ var gBrowserInit = {
// uninit methods don't depend on the services having been initialized).
CombinedStopReload.uninit();
+ CombinedBackForward.uninit();
gGestureSupport.init(false);
@@ -2940,13 +2950,11 @@ const BrowserSearch = {
openSearchPageIfFieldIsNotActive(searchBar);
};
if (placement && placement.area == CustomizableUI.AREA_PANEL) {
- PanelUI.show().then(() => {
- // The panel is not constructed until the first time it is shown.
- focusSearchBar();
- });
+ // The panel is not constructed until the first time it is shown.
+ PanelUI.show().then(focusSearchBar);
return;
}
- if (placement.area == CustomizableUI.AREA_NAVBAR && searchBar &&
+ if (placement && placement.area == CustomizableUI.AREA_NAVBAR && searchBar &&
searchBar.parentNode.classList.contains("overflowedItem")) {
let navBar = document.getElementById(CustomizableUI.AREA_NAVBAR);
navBar.overflowable.show().then(() => {
@@ -3775,6 +3783,7 @@ var XULBrowserWindow = {
onUpdateCurrentBrowser: function XWB_onUpdateCurrentBrowser(aStateFlags, aStatus, aMessage, aTotalProgress) {
if (FullZoom.updateBackgroundTabs)
FullZoom.onLocationChange(gBrowser.currentURI, true);
+ CombinedBackForward.setForwardButtonOcclusion(!gBrowser.webProgress.canGoForward);
var nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
var loadingDone = aStateFlags & nsIWebProgressListener.STATE_STOP;
// use a pseudo-object instead of a (potentially nonexistent) channel for getting
@@ -3849,6 +3858,43 @@ var LinkTargetDisplay = {
}
};
+let CombinedBackForward = {
+ init: function() {
+ this.forwardButton = document.getElementById("forward-button");
+ // Add a transition listener to the url bar to hide the forward button
+ // when necessary
+ if (gURLBar)
+ gURLBar.addEventListener("transitionend", this);
+ // On startup, or if the user customizes, our listener isn't attached,
+ // and no transitions fire anyway, so we need to make sure we've hidden the
+ // button if necessary:
+ if (this.forwardButton && this.forwardButton.hasAttribute("disabled")) {
+ this.setForwardButtonOcclusion(true);
+ }
+ },
+ uninit: function() {
+ if (gURLBar)
+ gURLBar.removeEventListener("transitionend", this);
+ },
+ handleEvent: function(aEvent) {
+ if (aEvent.type == "transitionend" &&
+ (aEvent.propertyName == "margin-left" || aEvent.propertyName == "margin-right") &&
+ this.forwardButton.hasAttribute("disabled")) {
+ this.setForwardButtonOcclusion(true);
+ }
+ },
+ setForwardButtonOcclusion: function(shouldBeOccluded) {
+ if (!this.forwardButton)
+ return;
+
+ let hasAttribute = this.forwardButton.hasAttribute("occluded-by-urlbar");
+ if (shouldBeOccluded && !hasAttribute)
+ this.forwardButton.setAttribute("occluded-by-urlbar", "true");
+ else if (!shouldBeOccluded && hasAttribute)
+ this.forwardButton.removeAttribute("occluded-by-urlbar");
+ }
+}
+
var CombinedStopReload = {
init: function () {
if (this._initialized)
@@ -4211,10 +4257,10 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) {
}
- let addToPanel = popup.querySelector(".customize-context-addToPanel");
+ let moveToPanel = popup.querySelector(".customize-context-moveToPanel");
let removeFromToolbar = popup.querySelector(".customize-context-removeFromToolbar");
- // View -> Toolbars menu doesn't have the addToPanel or removeFromToolbar items.
- if (!addToPanel || !removeFromToolbar) {
+ // View -> Toolbars menu doesn't have the moveToPanel or removeFromToolbar items.
+ if (!moveToPanel || !removeFromToolbar) {
return;
}
@@ -4241,10 +4287,10 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) {
let movable = toolbarItem && toolbarItem.parentNode &&
CustomizableUI.isWidgetRemovable(toolbarItem);
if (movable) {
- addToPanel.removeAttribute("disabled");
+ moveToPanel.removeAttribute("disabled");
removeFromToolbar.removeAttribute("disabled");
} else {
- addToPanel.setAttribute("disabled", true);
+ moveToPanel.setAttribute("disabled", true);
removeFromToolbar.setAttribute("disabled", true);
}
}
diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul
index 4dab60e2f0b..3d8376fe13c 100644
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -246,8 +246,8 @@
onpopupshowing="onViewToolbarsPopupShowing(event, document.getElementById('viewToolbarsMenuSeparator'));">
+ label="&customizeMenu.moveToPanel.label;"
+ class="customize-context-moveToPanel"/>