Loading browser/devtools/webconsole/HUDService.jsm +11 −9 Original line number Diff line number Diff line Loading @@ -611,7 +611,6 @@ WebConsole.prototype = { let position = Services.prefs.getCharPref("devtools.webconsole.position"); this.positionConsole(position); this._currentUIPosition = position; }, /** Loading @@ -622,8 +621,10 @@ WebConsole.prototype = { { this.iframe.removeEventListener("load", this._onIframeLoad, true); let position = Services.prefs.getCharPref("devtools.webconsole.position"); this.iframeWindow = this.iframe.contentWindow.wrappedJSObject; this.ui = new this.iframeWindow.WebConsoleFrame(this, this._currentUIPosition); this.ui = new this.iframeWindow.WebConsoleFrame(this, position); this._setupMessageManager(); }, Loading Loading @@ -695,8 +696,6 @@ WebConsole.prototype = { this.iframe.flex = 1; panel.setAttribute("height", height); this._afterPositionConsole("window", lastIndex); }).bind(this); panel.addEventListener("popupshown", onPopupShown,false); Loading Loading @@ -736,6 +735,9 @@ WebConsole.prototype = { if (this.splitter.parentNode) { this.splitter.parentNode.removeChild(this.splitter); } this._beforePositionConsole("window", lastIndex); panel.appendChild(this.iframe); let space = this.chromeDocument.createElement("spacer"); Loading Loading @@ -822,6 +824,8 @@ WebConsole.prototype = { this.splitter.parentNode.removeChild(this.splitter); } this._beforePositionConsole(aPosition, lastIndex); if (aPosition == "below") { nBox.appendChild(this.splitter); nBox.appendChild(this.iframe); Loading @@ -841,12 +845,10 @@ WebConsole.prototype = { this.iframe.removeAttribute("height"); this.iframe.style.height = height + "px"; } this._afterPositionConsole(aPosition, lastIndex); }, /** * Common code that needs to execute after the Web Console is repositioned. * Common code that needs to execute before the Web Console is repositioned. * @private * @param string aPosition * The new position: "above", "below" or "window". Loading @@ -854,8 +856,8 @@ WebConsole.prototype = { * The last visible message in the console output before repositioning * occurred. */ _afterPositionConsole: function WC__afterPositionConsole(aPosition, aLastIndex) _beforePositionConsole: function WC__beforePositionConsole(aPosition, aLastIndex) { if (!this.ui) { return; Loading browser/devtools/webconsole/test/browser_webconsole_position_ui.js +9 −6 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ function waitForPosition(aPosition, aCallback) { { return hudRef._currentUIPosition == aPosition; }, successFn: aCallback, successFn: executeSoon.bind(null, aCallback), failureFn: finishTest, }); } Loading @@ -55,9 +55,10 @@ function consoleOpened(aHudRef) { "position menu checkbox is below"); is(Services.prefs.getCharPref(POSITION_PREF), "below", "pref is below"); executeSoon(function() { hudRef.positionConsole("above"); waitForPosition("above", onPositionAbove); }); } function onPositionAbove() { Loading @@ -81,8 +82,10 @@ function onPositionAbove() { Services.prefs.setIntPref(TOP_PREF, 50); Services.prefs.setIntPref(LEFT_PREF, 51); executeSoon(function() { hudRef.positionConsole("window"); waitForPosition("window", onPositionWindow); }); } function onPositionWindow() { Loading Loading
browser/devtools/webconsole/HUDService.jsm +11 −9 Original line number Diff line number Diff line Loading @@ -611,7 +611,6 @@ WebConsole.prototype = { let position = Services.prefs.getCharPref("devtools.webconsole.position"); this.positionConsole(position); this._currentUIPosition = position; }, /** Loading @@ -622,8 +621,10 @@ WebConsole.prototype = { { this.iframe.removeEventListener("load", this._onIframeLoad, true); let position = Services.prefs.getCharPref("devtools.webconsole.position"); this.iframeWindow = this.iframe.contentWindow.wrappedJSObject; this.ui = new this.iframeWindow.WebConsoleFrame(this, this._currentUIPosition); this.ui = new this.iframeWindow.WebConsoleFrame(this, position); this._setupMessageManager(); }, Loading Loading @@ -695,8 +696,6 @@ WebConsole.prototype = { this.iframe.flex = 1; panel.setAttribute("height", height); this._afterPositionConsole("window", lastIndex); }).bind(this); panel.addEventListener("popupshown", onPopupShown,false); Loading Loading @@ -736,6 +735,9 @@ WebConsole.prototype = { if (this.splitter.parentNode) { this.splitter.parentNode.removeChild(this.splitter); } this._beforePositionConsole("window", lastIndex); panel.appendChild(this.iframe); let space = this.chromeDocument.createElement("spacer"); Loading Loading @@ -822,6 +824,8 @@ WebConsole.prototype = { this.splitter.parentNode.removeChild(this.splitter); } this._beforePositionConsole(aPosition, lastIndex); if (aPosition == "below") { nBox.appendChild(this.splitter); nBox.appendChild(this.iframe); Loading @@ -841,12 +845,10 @@ WebConsole.prototype = { this.iframe.removeAttribute("height"); this.iframe.style.height = height + "px"; } this._afterPositionConsole(aPosition, lastIndex); }, /** * Common code that needs to execute after the Web Console is repositioned. * Common code that needs to execute before the Web Console is repositioned. * @private * @param string aPosition * The new position: "above", "below" or "window". Loading @@ -854,8 +856,8 @@ WebConsole.prototype = { * The last visible message in the console output before repositioning * occurred. */ _afterPositionConsole: function WC__afterPositionConsole(aPosition, aLastIndex) _beforePositionConsole: function WC__beforePositionConsole(aPosition, aLastIndex) { if (!this.ui) { return; Loading
browser/devtools/webconsole/test/browser_webconsole_position_ui.js +9 −6 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ function waitForPosition(aPosition, aCallback) { { return hudRef._currentUIPosition == aPosition; }, successFn: aCallback, successFn: executeSoon.bind(null, aCallback), failureFn: finishTest, }); } Loading @@ -55,9 +55,10 @@ function consoleOpened(aHudRef) { "position menu checkbox is below"); is(Services.prefs.getCharPref(POSITION_PREF), "below", "pref is below"); executeSoon(function() { hudRef.positionConsole("above"); waitForPosition("above", onPositionAbove); }); } function onPositionAbove() { Loading @@ -81,8 +82,10 @@ function onPositionAbove() { Services.prefs.setIntPref(TOP_PREF, 50); Services.prefs.setIntPref(LEFT_PREF, 51); executeSoon(function() { hudRef.positionConsole("window"); waitForPosition("window", onPositionWindow); }); } function onPositionWindow() { Loading