Commit d4f40018 authored by Rob Campbell's avatar Rob Campbell
Browse files

merge m-c to fx-team

parents 81fe0db7 6d09b2c2
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -611,7 +611,6 @@ WebConsole.prototype = {

    let position = Services.prefs.getCharPref("devtools.webconsole.position");
    this.positionConsole(position);
    this._currentUIPosition = position;
  },

  /**
@@ -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();
  },

@@ -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);
@@ -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");
@@ -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);
@@ -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".
@@ -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;
+9 −6
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ function waitForPosition(aPosition, aCallback) {
    {
      return hudRef._currentUIPosition == aPosition;
    },
    successFn: aCallback,
    successFn: executeSoon.bind(null, aCallback),
    failureFn: finishTest,
  });
}
@@ -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() {
@@ -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() {