diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index c684168d1527..faa86541ceb0 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -878,3 +878,13 @@ pref("identity.fxaccounts.auth.uri", "https://api-accounts.dev.lcip.org/v1"); // Gaia relies heavily on scroll events for now, so lets fire them // more often than the default value (100). pref("apz.asyncscroll.throttle", 40); + +// This preference allows FirefoxOS apps (and content, I think) to force +// the use of software (instead of hardware accelerated) 2D canvases by +// creating a context like this: +// +// canvas.getContext('2d', { willReadFrequently: true }) +// +// Using a software canvas can save memory when JS calls getImageData() +// on the canvas frequently. See bug 884226. +pref("gfx.canvas.willReadFrequently.enable", true); diff --git a/b2g/chrome/content/ErrorPage.js b/b2g/chrome/content/ErrorPage.js index 3461da061ff6..cf8fc3532eac 100644 --- a/b2g/chrome/content/ErrorPage.js +++ b/b2g/chrome/content/ErrorPage.js @@ -8,6 +8,8 @@ let Cu = Components.utils; let Cc = Components.classes; let Ci = Components.interfaces; +dump("############ ErrorPage.js\n"); + let ErrorPageHandler = { _reload: function() { docShell.QueryInterface(Ci.nsIWebNavigation).reload(Ci.nsIWebNavigation.LOAD_FLAGS_NONE); @@ -31,12 +33,8 @@ let ErrorPageHandler = { } }, - domContentLoadedHandler: function(e) { - let target = e.originalTarget; - let targetDocShell = target.defaultView - .QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIWebNavigation); - if (targetDocShell != docShell) { + _bindPageEvent: function(target) { + if (!target) { return; } @@ -52,11 +50,23 @@ let ErrorPageHandler = { } }, + domContentLoadedHandler: function(e) { + let target = e.originalTarget; + let targetDocShell = target.defaultView + .QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIWebNavigation); + if (targetDocShell != docShell) { + return; + } + this._bindPageEvent(target); + }, + init: function() { addMessageListener("ErrorPage:ReloadPage", this._reload.bind(this)); addEventListener('DOMContentLoaded', this.domContentLoadedHandler.bind(this), true); + this._bindPageEvent(content.document); } }; diff --git a/b2g/components/ErrorPage.jsm b/b2g/components/ErrorPage.jsm index 1dbcb5334dcb..8d9c05516c42 100644 --- a/b2g/components/ErrorPage.jsm +++ b/b2g/components/ErrorPage.jsm @@ -149,6 +149,26 @@ let ErrorPage = { } }, + _listenError: function(frameLoader) { + let self = this; + let frameElement = frameLoader.ownerElement; + let injectErrorPageScript = function() { + let mm = frameLoader.messageManager; + try { + mm.loadFrameScript(kErrorPageFrameScript, true, true); + } catch (e) { + dump('Error loading ' + kErrorPageFrameScript + ' as frame script: ' + e + '\n'); + } + mm.addMessageListener('ErrorPage:AddCertException', self._addCertException.bind(self)); + frameElement.removeEventListener('mozbrowsererror', injectErrorPageScript, true); + }; + + frameElement.addEventListener('mozbrowsererror', + injectErrorPageScript, + true // use capture + ); + }, + init: function errorPageInit() { Services.obs.addObserver(this, 'in-process-browser-or-app-frame-shown', false); Services.obs.addObserver(this, 'remote-browser-frame-shown', false); @@ -156,17 +176,7 @@ let ErrorPage = { observe: function errorPageObserve(aSubject, aTopic, aData) { let frameLoader = aSubject.QueryInterface(Ci.nsIFrameLoader); - let mm = frameLoader.messageManager; - - // This won't happen from dom/ipc/preload.js in non-OOP builds. - try { - if (Services.prefs.getBoolPref("dom.ipc.tabs.disabled") === true) { - mm.loadFrameScript(kErrorPageFrameScript, true, true); - } - } catch (e) { - dump('Error loading ' + kErrorPageFrameScript + ' as frame script: ' + e + '\n'); - } - mm.addMessageListener('ErrorPage:AddCertException', this._addCertException.bind(this)); + this._listenError(frameLoader); } }; diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 47f1576bf15a..e26bfcab85e9 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "ac80bbe24c39a813ab65b98bb56dce2e42207b22", + "revision": "d5d2b5614c32e17c5c3c736181a66bfa3fc5c3ef", "repo_path": "/integration/gaia-central" } diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 4366cef92297..187df5e33203 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -202,16 +202,8 @@ align="start" orient="vertical" role="alert"> - - - - - - - +