Merge fx-team to m-c
authorWes Kocher <wkocher@mozilla.com>
Tue, 13 May 2014 18:49:09 -0700
changeset 183047 2f8af55d6e9ae67b0e317e403c58adec42c21fd4
parent 183036 add23139044f89ebb7d69a727a796adc38902c90 (current diff)
parent 183046 5b65a96a2b0c215f621c733891af6615104e198f (diff)
child 183048 a12aae28523e033a70a31d8add9ba5e8a8bfe1f1
child 183067 c0efb7fe87e37d23b2f6d968092d0eab7971177b
child 183087 a6e2576fa44f9f47235191103a5858d51ee87680
push id43451
push userkwierso@gmail.com
push dateWed, 14 May 2014 01:56:44 +0000
treeherdermozilla-inbound@a12aae28523e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone32.0a1
first release with
nightly linux32
2f8af55d6e9a / 32.0a1 / 20140514030203 / files
nightly linux64
2f8af55d6e9a / 32.0a1 / 20140514030203 / files
nightly mac
2f8af55d6e9a / 32.0a1 / 20140514030203 / files
nightly win32
2f8af55d6e9a / 32.0a1 / 20140514030203 / files
nightly win64
2f8af55d6e9a / 32.0a1 / 20140514030203 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge fx-team to m-c
browser/base/content/test/newtab/searchEngineLogo.xml
toolkit/themes/osx/global/icons/close-sidebar.png
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -71,16 +71,19 @@ XPCOMUtils.defineLazyGetter(this, "libcu
 #endif
 
 #ifdef MOZ_CAPTIVEDETECT
 XPCOMUtils.defineLazyServiceGetter(Services, 'captivePortalDetector',
                                   '@mozilla.org/toolkit/captive-detector;1',
                                   'nsICaptivePortalDetector');
 #endif
 
+let devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
+let { RootActor } = devtools.require("devtools/server/actors/root");
+
 function getContentWindow() {
   return shell.contentBrowser.contentWindow;
 }
 
 function debug(str) {
   dump(' -*- Shell.js: ' + str + '\n');
 }
 
@@ -963,17 +966,17 @@ let RemoteDebugger = {
           },
           // Use an explicit global actor list to prevent exposing
           // unexpected actors
           globalActorFactories: restrictPrivileges ? {
             webappsActor: DebuggerServer.globalActorFactories.webappsActor,
             deviceActor: DebuggerServer.globalActorFactories.deviceActor,
           } : DebuggerServer.globalActorFactories
         };
-        let root = new DebuggerServer.RootActor(connection, parameters);
+        let root = new RootActor(connection, parameters);
         root.applicationType = "operating-system";
         return root;
       };
 
 #ifdef MOZ_WIDGET_GONK
       DebuggerServer.on("connectionchange", function() {
         AdbController.updateState();
       });
--- a/browser/base/content/browser-social.js
+++ b/browser/base/content/browser-social.js
@@ -610,38 +610,56 @@ SocialShare = {
           pageData[p] = graphData[p];
         }
       }
     }
     this.currentShare = pageData;
 
     let shareEndpoint = OpenGraphBuilder.generateEndpointURL(provider.shareURL, pageData);
 
-    this._dynamicResizer = new DynamicResizeWatcher();
+    let size = provider.getPageSize("share");
+    if (size) {
+      if (this._dynamicResizer) {
+        this._dynamicResizer.stop();
+        this._dynamicResizer = null;
+      }
+      let {width, height} = size;
+      width += this.panel.boxObject.width - iframe.boxObject.width;
+      height += this.panel.boxObject.height - iframe.boxObject.height;
+      this.panel.sizeTo(width, height);
+    } else {
+      this._dynamicResizer = new DynamicResizeWatcher();
+    }
+
     // if we've already loaded this provider/page share endpoint, we don't want
     // to add another load event listener.
     let reload = true;
     let endpointMatch = shareEndpoint == iframe.getAttribute("src");
     let docLoaded = iframe.contentDocument && iframe.contentDocument.readyState == "complete";
     if (endpointMatch && docLoaded) {
       reload = shareEndpoint != iframe.contentDocument.location.spec;
     }
     if (!reload) {
-      this._dynamicResizer.start(this.panel, iframe);
+      if (this._dynamicResizer)
+        this._dynamicResizer.start(this.panel, iframe);
       iframe.docShell.isActive = true;
       iframe.docShell.isAppTab = true;
       let evt = iframe.contentDocument.createEvent("CustomEvent");
       evt.initCustomEvent("OpenGraphData", true, true, JSON.stringify(pageData));
       iframe.contentDocument.documentElement.dispatchEvent(evt);
     } else {
       // first time load, wait for load and dispatch after load
       iframe.addEventListener("load", function panelBrowserOnload(e) {
         iframe.removeEventListener("load", panelBrowserOnload, true);
         iframe.docShell.isActive = true;
         iframe.docShell.isAppTab = true;
+        // to support standard share endpoints mimick window.open by setting
+        // window.opener, some share endpoints rely on w.opener to know they
+        // should close the window when done.
+        iframe.contentWindow.opener = iframe.contentWindow;
         setTimeout(function() {
           if (SocialShare._dynamicResizer) { // may go null if hidden quickly
             SocialShare._dynamicResizer.start(iframe.parentNode, iframe);
           }
         }, 0);
         let evt = iframe.contentDocument.createEvent("CustomEvent");
         evt.initCustomEvent("OpenGraphData", true, true, JSON.stringify(pageData));
         iframe.contentDocument.documentElement.dispatchEvent(evt);
@@ -1125,31 +1143,35 @@ SocialStatus = {
     // iframe and start fresh.
     if (frame && frame.parentNode != aParent) {
       SharedFrame.forgetGroup(frame.id);
       frame.parentNode.removeChild(frame);
       frame = null;
     }
 
     if (!frame) {
+      let size = provider.getPageSize("status");
+      let {width, height} = size ? size : {width: PANEL_MIN_WIDTH, height: PANEL_MIN_HEIGHT};
+
       frame = SharedFrame.createFrame(
         notificationFrameId, /* frame name */
         aParent, /* parent */
         {
           "type": "content",
           "mozbrowser": "true",
           "class": "social-panel-frame",
           "id": notificationFrameId,
           "tooltip": "aHTMLTooltip",
           "context": "contentAreaContextMenu",
           "flex": "1",
 
           // work around bug 793057 - by making the panel roughly the final size
           // we are more likely to have the anchor in the correct position.
-          "style": "width: " + PANEL_MIN_WIDTH + "px;",
+          "style": "width: " + width + "px; height: " + height + "px;",
+          "dynamicresizer": !size,
 
           "origin": provider.origin,
           "src": provider.statusURL
         }
       );
 
       if (frame.socialErrorListener)
         frame.socialErrorListener.remove();
@@ -1241,17 +1263,20 @@ SocialStatus = {
 
     function dispatchPanelEvent(name) {
       let evt = notificationFrame.contentDocument.createEvent("CustomEvent");
       evt.initCustomEvent(name, true, true, {});
       notificationFrame.contentDocument.documentElement.dispatchEvent(evt);
     }
 
     // we only use a dynamic resizer when we're located the toolbar.
-    let dynamicResizer = inMenuPanel ? null : this._dynamicResizer;
+    let dynamicResizer;
+    if (!inMenuPanel && notificationFrame.getAttribute("dynamicresizer") == "true") {
+      dynamicResizer = this._dynamicResizer;
+    }
     panel.addEventListener(hidingEvent, function onpopuphiding() {
       panel.removeEventListener(hidingEvent, onpopuphiding);
       aToolbarButton.removeAttribute("open");
       if (dynamicResizer)
         dynamicResizer.stop();
       notificationFrame.docShell.isActive = false;
       dispatchPanelEvent("socialFrameHide");
     });
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -239,17 +239,17 @@
     <panel id="social-share-panel"
            class="social-panel"
            type="arrow"
            orient="horizontal"
            onpopupshowing="SocialShare.onShowing()"
            onpopuphidden="SocialShare.onHidden()"
            hidden="true">
       <vbox class="social-share-toolbar">
-        <vbox id="social-share-provider-buttons" flex="1"/>
+        <arrowscrollbox id="social-share-provider-buttons" orient="vertical" flex="1"/>
       </vbox>
     </panel>
 
     <panel id="social-notification-panel"
            class="social-panel"
            type="arrow"
            hidden="true"
            noautofocus="true"/>
--- a/browser/base/content/newtab/search.js
+++ b/browser/base/content/newtab/search.js
@@ -141,17 +141,17 @@ let gSearch = {
     return box;
   },
 
   _setCurrentEngine: function (engine) {
     this.currentEngineName = engine.name;
 
     // Set the logo.
     let logoURI = window.devicePixelRatio == 2 ? engine.logo2xURI :
-                  engine.logoURI;
+                  engine.logoURI || engine.logo2xURI;
     if (logoURI) {
       this._nodes.logo.hidden = false;
       this._nodes.logo.style.backgroundImage = "url(" + logoURI + ")";
       this._nodes.text.placeholder = "";
     }
     else {
       this._nodes.logo.hidden = true;
       this._nodes.text.placeholder = engine.name;
--- a/browser/base/content/socialmarks.xml
+++ b/browser/base/content/socialmarks.xml
@@ -12,16 +12,17 @@
       <xul:panel anonid="panel" hidden="true" type="arrow" class="social-panel"/>
       <xul:image class="toolbarbutton-icon" xbl:inherits="validate,src=image,label"/>
       <xul:label class="toolbarbutton-text" crop="right" flex="1"
                  xbl:inherits="value=label,accesskey,crop,wrap"/>
       <xul:label class="toolbarbutton-multiline-text" flex="1"
                  xbl:inherits="xbl:text=label,accesskey,wrap"/>
     </content>
     <implementation implements="nsIDOMEventListener, nsIObserver">
+      <field name="_useDynamicResizer">false</field>
       <field name="inMenuPanel">false</field>
 
       <property name="panel">
         <getter>
           let widgetGroup = CustomizableUI.getWidget(this.getAttribute("id"));
           let widget = widgetGroup.forWindow(window);
           this.inMenuPanel = widgetGroup.areaType == CustomizableUI.TYPE_MENU_PANEL;
           if (this.inMenuPanel) {
@@ -32,29 +33,35 @@
         </getter>
       </property>
 
       <property name="content">
         <getter><![CDATA[
           if (this._frame)
             return this._frame;
           let notificationFrameId = "social-mark-frame-" + this.getAttribute("origin");
+          let provider = Social._getProviderFromOrigin(this.getAttribute("origin"));
+          let size = provider.getPageSize("marks");
+          let {width, height} = size ? size : {width: 330, height: 100};
+          this._useDynamicResizer = !size;
+
           this._frame = SharedFrame.createFrame(
             notificationFrameId, /* frame name */
             this.panel, /* parent */
             {
               "type": "content",
               "mozbrowser": "true",
               "class": "social-panel-frame",
               "id": notificationFrameId,
               "tooltip": "aHTMLTooltip",
               "flex": "1",
               "context": "contentAreaContextMenu",
               "origin": this.getAttribute("origin"),
-              "src": "about:blank"
+              "src": "about:blank",
+              "style": "width: " + width + "px; height: " + height + "px;",
             }
           );
           this._frame.addEventListener("DOMLinkAdded", this);
           this.setAttribute("notificationFrameId", notificationFrameId);
           return this._frame;
         ]]></getter>
       </property>
 
@@ -145,17 +152,17 @@
 
         // setup listeners
         let DOMContentLoaded = (event) => {
           if (event.target != this.contentDocument)
             return;
           this._loading = false;
           this.content.removeEventListener("DOMContentLoaded", DOMContentLoaded, true);
           // add our resizer after the dom is ready
-          if (!this.inMenuPanel) {
+          if (!this.inMenuPanel && this._useDynamicResizer) {
             let DynamicResizeWatcher = Cu.import("resource:///modules/Social.jsm", {}).DynamicResizeWatcher;
             this._dynamicResizer = new DynamicResizeWatcher();
             this._dynamicResizer.start(this.panel, this.content);
           } else if (this._dynamicResizer) {
             this._dynamicResizer.stop();
             this._dynamicResizer = null;
           }
           // send the opengraph data
@@ -275,23 +282,23 @@
       <method name="onShown">
         <body><![CDATA[
         // because the panel may be preloaded, we need to size the panel when
         // showing as well as after load
         let sizeSocialPanelToContent = Cu.import("resource:///modules/Social.jsm", {}).sizeSocialPanelToContent;
         if (!this._loading && this.contentDocument &&
             this.contentDocument.readyState == "complete") {
           this.dispatchPanelEvent("socialFrameShow");
-          if (!this.inMenuPanel)
+          if (!this.inMenuPanel && this._useDynamicResizer)
             sizeSocialPanelToContent(this.panel, this.content);
         } else {
           let panelBrowserOnload = (e) => {
             this.content.removeEventListener("load", panelBrowserOnload, true);
             this.dispatchPanelEvent("socialFrameShow");
-            if (!this.inMenuPanel)
+            if (!this.inMenuPanel && this._useDynamicResizer)
               sizeSocialPanelToContent(this.panel, this.content);
           };
           this.content.addEventListener("load", panelBrowserOnload, true);
         }
         ]]></body>
       </method>
 
       <method name="handleEvent">
--- a/browser/base/content/test/newtab/browser.ini
+++ b/browser/base/content/test/newtab/browser.ini
@@ -1,14 +1,12 @@
 [DEFAULT]
 skip-if = e10s # Bug ?????? - about:newtab tests don't work in e10s
 support-files =
   head.js
-  searchEngineLogo.xml
-  searchEngineNoLogo.xml
 
 [browser_newtab_background_captures.js]
 [browser_newtab_block.js]
 [browser_newtab_bug721442.js]
 [browser_newtab_bug722273.js]
 [browser_newtab_bug723102.js]
 [browser_newtab_bug723121.js]
 [browser_newtab_bug725996.js]
@@ -25,13 +23,18 @@ skip-if = os == "mac" # Intermittent fai
 [browser_newtab_disable.js]
 [browser_newtab_drag_drop.js]
 [browser_newtab_drag_drop_ext.js]
 [browser_newtab_drop_preview.js]
 [browser_newtab_focus.js]
 [browser_newtab_perwindow_private_browsing.js]
 [browser_newtab_reset.js]
 [browser_newtab_search.js]
+support-files =
+  searchEngineNoLogo.xml
+  searchEngine1xLogo.xml
+  searchEngine2xLogo.xml
+  searchEngine1x2xLogo.xml
 [browser_newtab_sponsored_icon_click.js]
 [browser_newtab_tabsync.js]
 [browser_newtab_undo.js]
 [browser_newtab_unpin.js]
 [browser_newtab_update.js]
--- a/browser/base/content/test/newtab/browser_newtab_search.js
+++ b/browser/base/content/test/newtab/browser_newtab_search.js
@@ -1,21 +1,23 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // See browser/components/search/test/browser_*_behavior.js for tests of actual
 // searches.
 
-const ENGINE_LOGO = "searchEngineLogo.xml";
 const ENGINE_NO_LOGO = "searchEngineNoLogo.xml";
+const ENGINE_1X_LOGO = "searchEngine1xLogo.xml";
+const ENGINE_2X_LOGO = "searchEngine2xLogo.xml";
+const ENGINE_1X_2X_LOGO = "searchEngine1x2xLogo.xml";
 
 const SERVICE_EVENT_NAME = "ContentSearchService";
 
-const LOGO_LOW_DPI_SIZE = [65, 26];
-const LOGO_HIGH_DPI_SIZE = [130, 52];
+const LOGO_1X_DPI_SIZE = [65, 26];
+const LOGO_2X_DPI_SIZE = [130, 52];
 
 // The test has an expected search event queue and a search event listener.
 // Search events that are expected to happen are added to the queue, and the
 // listener consumes the queue and ensures that each event it receives is at
 // the head of the queue.
 //
 // Each item in the queue is an object { type, deferred }.  type is the
 // expected search event type.  deferred is a Promise.defer() value that is
@@ -37,41 +39,71 @@ function runTests() {
 
   let panel = searchPanel();
   is(panel.state, "closed", "Search panel should be closed initially");
 
   // The panel's animation often is not finished when the test clicks on panel
   // children, which makes the test click the wrong children, so disable it.
   panel.setAttribute("animate", "false");
 
-  // Add the two test engines.
-  let logoEngine = null;
-  yield promiseNewSearchEngine(true).then(engine => {
-    logoEngine = engine;
-    TestRunner.next();
-  });
-  ok(!!logoEngine.getIconURLBySize(...LOGO_LOW_DPI_SIZE),
-     "Sanity check: engine should have 1x logo");
-  ok(!!logoEngine.getIconURLBySize(...LOGO_HIGH_DPI_SIZE),
-     "Sanity check: engine should have 2x logo");
-
+  // Add the engine without any logos and switch to it.
   let noLogoEngine = null;
-  yield promiseNewSearchEngine(false).then(engine => {
+  yield promiseNewSearchEngine(ENGINE_NO_LOGO, 0).then(engine => {
     noLogoEngine = engine;
     TestRunner.next();
   });
-  ok(!noLogoEngine.getIconURLBySize(...LOGO_LOW_DPI_SIZE),
+  ok(!noLogoEngine.getIconURLBySize(...LOGO_1X_DPI_SIZE),
      "Sanity check: engine should not have 1x logo");
-  ok(!noLogoEngine.getIconURLBySize(...LOGO_HIGH_DPI_SIZE),
+  ok(!noLogoEngine.getIconURLBySize(...LOGO_2X_DPI_SIZE),
      "Sanity check: engine should not have 2x logo");
+  Services.search.currentEngine = noLogoEngine;
+  yield promiseSearchEvents(["CurrentEngine"]).then(TestRunner.next);
+  checkCurrentEngine(ENGINE_NO_LOGO, false, false);
+
+  // Add the engine with a 1x-DPI logo and switch to it.
+  let logo1xEngine = null;
+  yield promiseNewSearchEngine(ENGINE_1X_LOGO, 1).then(engine => {
+    logo1xEngine = engine;
+    TestRunner.next();
+  });
+  ok(!!logo1xEngine.getIconURLBySize(...LOGO_1X_DPI_SIZE),
+     "Sanity check: engine should have 1x logo");
+  ok(!logo1xEngine.getIconURLBySize(...LOGO_2X_DPI_SIZE),
+     "Sanity check: engine should not have 2x logo");
+  Services.search.currentEngine = logo1xEngine;
+  yield promiseSearchEvents(["CurrentEngine"]).then(TestRunner.next);
+  checkCurrentEngine(ENGINE_1X_LOGO, true, false);
 
-  // Use the search service to change the current engine to the logo engine.
-  Services.search.currentEngine = logoEngine;
+  // Add the engine with a 2x-DPI logo and switch to it.
+  let logo2xEngine = null;
+  yield promiseNewSearchEngine(ENGINE_2X_LOGO, 1).then(engine => {
+    logo2xEngine = engine;
+    TestRunner.next();
+  });
+  ok(!logo2xEngine.getIconURLBySize(...LOGO_1X_DPI_SIZE),
+     "Sanity check: engine should not have 1x logo");
+  ok(!!logo2xEngine.getIconURLBySize(...LOGO_2X_DPI_SIZE),
+     "Sanity check: engine should have 2x logo");
+  Services.search.currentEngine = logo2xEngine;
   yield promiseSearchEvents(["CurrentEngine"]).then(TestRunner.next);
-  checkCurrentEngine(ENGINE_LOGO);
+  checkCurrentEngine(ENGINE_2X_LOGO, false, true);
+
+  // Add the engine with 1x- and 2x-DPI logos and switch to it.
+  let logo1x2xEngine = null;
+  yield promiseNewSearchEngine(ENGINE_1X_2X_LOGO, 2).then(engine => {
+    logo1x2xEngine = engine;
+    TestRunner.next();
+  });
+  ok(!!logo1x2xEngine.getIconURLBySize(...LOGO_1X_DPI_SIZE),
+     "Sanity check: engine should have 1x logo");
+  ok(!!logo1x2xEngine.getIconURLBySize(...LOGO_2X_DPI_SIZE),
+     "Sanity check: engine should have 2x logo");
+  Services.search.currentEngine = logo1x2xEngine;
+  yield promiseSearchEvents(["CurrentEngine"]).then(TestRunner.next);
+  checkCurrentEngine(ENGINE_1X_2X_LOGO, true, true);
 
   // Click the logo to open the search panel.
   yield Promise.all([
     promisePanelShown(panel),
     promiseClick(logoImg()),
   ]).then(TestRunner.next);
 
   // In the search panel, click the no-logo engine.  It should become the
@@ -84,22 +116,22 @@ function runTests() {
     }
   }
   ok(noLogoBox, "Search panel should contain the no-logo engine");
   yield Promise.all([
     promiseSearchEvents(["CurrentEngine"]),
     promiseClick(noLogoBox),
   ]).then(TestRunner.next);
 
-  checkCurrentEngine(ENGINE_NO_LOGO);
+  checkCurrentEngine(ENGINE_NO_LOGO, false, false);
 
-  // Switch back to the logo engine.
-  Services.search.currentEngine = logoEngine;
+  // Switch back to the 1x-and-2x logo engine.
+  Services.search.currentEngine = logo1x2xEngine;
   yield promiseSearchEvents(["CurrentEngine"]).then(TestRunner.next);
-  checkCurrentEngine(ENGINE_LOGO);
+  checkCurrentEngine(ENGINE_1X_2X_LOGO, true, true);
 
   // Open the panel again.
   yield Promise.all([
     promisePanelShown(panel),
     promiseClick(logoImg()),
   ]).then(TestRunner.next);
 
   // In the search panel, click the Manage Engines box.
@@ -152,26 +184,25 @@ function $(idSuffix) {
 
 function promiseSearchEvents(events) {
   info("Expecting search events: " + events);
   events = events.map(e => ({ type: e, deferred: Promise.defer() }));
   gExpectedSearchEventQueue.push(...events);
   return Promise.all(events.map(e => e.deferred.promise));
 }
 
-function promiseNewSearchEngine(withLogo) {
-  let basename = withLogo ? ENGINE_LOGO : ENGINE_NO_LOGO;
+function promiseNewSearchEngine(basename, numLogos) {
   info("Waiting for engine to be added: " + basename);
 
   // Wait for the search events triggered by adding the new engine.
   // engine-added engine-loaded
   let expectedSearchEvents = ["State", "State"];
-  if (withLogo) {
-    // an engine-changed for each of the two logos
-    expectedSearchEvents.push("State", "State");
+  // engine-changed for each of the logos
+  for (let i = 0; i < numLogos; i++) {
+    expectedSearchEvents.push("State");
   }
   let eventPromise = promiseSearchEvents(expectedSearchEvents);
 
   // Wait for addEngine().
   let addDeferred = Promise.defer();
   let url = getRootDirectory(gTestPath) + basename;
   Services.search.addEngine(url, Ci.nsISearchEngine.TYPE_MOZSEARCH, "", false, {
     onSuccess: function (engine) {
@@ -192,29 +223,44 @@ function promiseNewSearchEngine(withLogo
   let deferred = Promise.defer();
   Promise.all([addDeferred.promise, eventPromise]).then(values => {
     let newEngine = values[0];
     deferred.resolve(newEngine);
   }, () => deferred.reject());
   return deferred.promise;
 }
 
-function checkCurrentEngine(basename) {
+function checkCurrentEngine(basename, has1xLogo, has2xLogo) {
   let engine = Services.search.currentEngine;
   ok(engine.name.contains(basename),
      "Sanity check: current engine: engine.name=" + engine.name +
      " basename=" + basename);
 
   // gSearch.currentEngineName
   is(gSearch().currentEngineName, engine.name,
      "currentEngineName: " + engine.name);
 
   // search bar logo
-  let logoSize = [px * window.devicePixelRatio for (px of LOGO_LOW_DPI_SIZE)];
-  let logoURI = engine.getIconURLBySize(...logoSize);
+  let logoURI = null;
+  if (window.devicePixelRatio == 2) {
+    if (has2xLogo) {
+      logoURI = engine.getIconURLBySize(...LOGO_2X_DPI_SIZE);
+      ok(!!logoURI, "Sanity check: engine should have 2x logo");
+    }
+  }
+  else {
+    if (has1xLogo) {
+      logoURI = engine.getIconURLBySize(...LOGO_1X_DPI_SIZE);
+      ok(!!logoURI, "Sanity check: engine should have 1x logo");
+    }
+    else if (has2xLogo) {
+      logoURI = engine.getIconURLBySize(...LOGO_2X_DPI_SIZE);
+      ok(!!logoURI, "Sanity check: engine should have 2x logo");
+    }
+  }
   let logo = logoImg();
   is(logo.hidden, !logoURI,
      "Logo should be visible iff engine has a logo: " + engine.name);
   if (logoURI) {
     is(logo.style.backgroundImage, 'url("' + logoURI + '")', "Logo URI");
   }
 
   // "selected" attributes of engines in the panel
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/newtab/searchEngine1x2xLogo.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>browser_newtab_search searchEngine1x2xLogo.xml</ShortName>
+<Url type="text/html" method="GET" template="http://browser-newtab-search.com/1x2xlogo" rel="searchform"/>
+<Image width="65" height="26">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAAAaCAYAAADovjFxAAAMR2lDQ1BJQ0MgUHJvZmlsZQAASA2tV3dYU1cbf+9IAiEJIyECMsJeouwpewsKMoU6CEkgYcQQCCpua2kF60DFgaOiVRGrVisgdSDitihu6/hQi4JSiwMXKt+5YdinT7//vvs859xffu973vt733vuyTkA2nZChSIP1wHIlxcpEyJDBJPS0gWM+4CDMfDAEnhCUaEiOD4+Fv7n9eYGYJTxqhMV63+6/btBVywpFAFg8cicKS4U5SP8CwDJESmURQC0FsRbzihSULgTYZ4SCUT4I4Wz1ZiO1AMvcwBbqX2SEkIB6N4AGiyhUJkNwAlDvKBYlI3icMQIO8vFMjnCqxEOEEmFiONcQ3hUfv50hLURBLvMv8XJ/hsWCjOHYwqF2cN4IBdqKGiEyQoVecJZ6h//zy4/T4Xqpb7MUc+SKqMS0J2H6rYxd3oMhVkI75dnTohDWA/hIzIq4wHcKlVFJSNM+beLCkN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j/12Z4N6baKkzbasspgWFobVzPT6yCMZZBVSW95ECZgoo1GBsNSnkO96jIIYxl8Veb5929DpAlw3yb6PQ5EU4NYdjoG+RPajn+HM8/wBy3+Gl99yL4tAAAAAElFTkSuQmCC</Image>
+</SearchPlugin>
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/newtab/searchEngine1xLogo.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>browser_newtab_search searchEngine1xLogo.xml</ShortName>
+<Url type="text/html" method="GET" template="http://browser-newtab-search.com/1xlogo" rel="searchform"/>
+<Image width="65" height="26">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAAAaCAYAAADovjFxAAAMR2lDQ1BJQ0MgUHJvZmlsZQAASA2tV3dYU1cbf+9IAiEJIyECMsJeouwpewsKMoU6CEkgYcQQCCpua2kF60DFgaOiVRGrVisgdSDitihu6/hQi4JSiwMXKt+5YdinT7//vvs859xffu973vt733vuyTkA2nZChSIP1wHIlxcpEyJDBJPS0gWM+4CDMfDAEnhCUaEiOD4+Fv7n9eYGYJTxqhMV63+6/btBVywpFAFg8cicKS4U5SP8CwDJESmURQC0FsRbzihSULgTYZ4SCUT4I4Wz1ZiO1AMvcwBbqX2SEkIB6N4AGiyhUJkNwAlDvKBYlI3icMQIO8vFMjnCqxEOEEmFiONcQ3hUfv50hLURBLvMv8XJ/hsWCjOHYwqF2cN4IBdqKGiEyQoVecJZ6h//zy4/T4Xqpb7MUc+SKqMS0J2H6rYxd3oMhVkI75dnTohDWA/hIzIq4wHcKlVFJSNM+beLCkNRLYGP8GuxMCwGYWMAnKnKTQ4exDZCJUJqfzxEVhSdNIhTlNMTBuPjOfK8CdT8QHHwOVJJ9BCukBSGJyIeacBzsmQR0Qijd4XvKpEmpSKMdOINxbKUCQhzEG4pzE2kNFBxrpRIQyle7aNUJVCarRDfmaWMoHJEPgQrvxAhdXzCQiR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8XZd1ZOLGfiiDnOP7hkJZDoLvNaCXcJNhdnshK0xOLyZhnmDP4nz9kNdXI4yHvwb7dDaFwc8aXhBSR3ikj9dMV3RqhrA08FdyX/OLlpy64Qq3t+CiBXBIKWJCg+XIm+6uA9bVJqGxpltEMsn/vwz258uIdy3HT1a4zLxicb490KYmuMelrjFNimhnMbnlX7Ptb2JSkse0Fol5pWpwf/2hhJdtf59HGouSV6JrcF/+kk9AzwKtu/22HJdHUloGmxgZ3fIWmBe+z15D9UCXvPYdsAcI+Vv1btRpX4o0qQPbIfqNZc//Un+KMk9A/z+xgOHYfvC+OcR8k/UPhCw4FgaZYoiAeOOirDCcYQCVbEYJ0a1C3hqEs8nqmjsjK/98WoBtIOl7q56Meo2kb2Kf6uPQFBxSnh/vWfa/mzSUjtSju3y7VxJf8bg8fWe97jWoEAAAAASUVORK5CYII=</Image>
+</SearchPlugin>
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/newtab/searchEngine2xLogo.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>browser_newtab_search searchEngine2xLogo.xml</ShortName>
+<Url type="text/html" method="GET" template="http://browser-newtab-search.com/2xlogo" rel="searchform"/>
+<Image width="130" height="52">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIIAAAA0CAIAAADJ8nfCAAAMR2lDQ1BJQ0MgUHJvZmlsZQAASA2tV3dYU1cbf+9IAiEJIyECMsJeouwpewsKMoU6CEkgYcQQCCpua2kF60DFgaOiVRGrVisgdSDitihu6/hQi4JSiwMXKt+5YdinT7//vvs859xffu973vt733vuyTkA2nZChSIP1wHIlxcpEyJDBJPS0gWM+4CDMfDAEnhCUaEiOD4+Fv7n9eYGYJTxqhMV63+6/btBVywpFAFg8cicKS4U5SP8CwDJESmURQC0FsRbzihSULgTYZ4SCUT4I4Wz1ZiO1AMvcwBbqX2SEkIB6N4AGiyhUJkNwAl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PTvaik/PClP70Pz7b9GTiJ6mCBzrJG5qtcpPTT5RrPpW9arFKj/12Z4N6baKkzbasspgWFobVzPT6yCMZZBVSW95ECZgoo1GBsNSnkO96jIIYxl8Veb5929DpAlw3yb6PQ5EU4NYdjoG+RPajn+HM8/wBy3+Gl99yL4tAAAAAElFTkSuQmCC</Image>
+</SearchPlugin>
deleted file mode 100644
--- a/browser/base/content/test/newtab/searchEngineLogo.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
-<ShortName>browser_newtab_search searchEngineLogo.xml</ShortName>
-<Url type="text/html" method="GET" template="http://browser-newtab-search.com/logo" rel="searchform"/>
-<Image width="65" height="26">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAAAaCAYAAADovjFxAAAMR2lDQ1BJQ0MgUHJvZmlsZQAASA2tV3dYU1cbf+9IAiEJIyECMsJeouwpewsKMoU6CEkgYcQQCCpua2kF60DFgaOiVRGrVisgdSDitihu6/hQi4JSiwMXKt+5YdinT7//vvs859xffu973vt733vuyTkA2nZChSIP1wHIlxcpEyJDBJPS0gWM+4CDMfDAEnhCUaEiOD4+Fv7n9eYGYJTxqhMV63+6/btBVywpFAFg8cicKS4U5SP8CwDJESmURQC0FsRbzihSULgTYZ4SCUT4I4Wz1ZiO1AMvcwBbqX2SEkIB6N4AGiyhUJkNwAlDvKBYlI3icMQIO8vFMjnCqxEOEEmFiONcQ3hUfv50hLURBLvMv8XJ/hsWCjOHYwqF2cN4IBdqKGiEyQoVecJZ6h//zy4/T4Xqpb7MUc+SKqMS0J2H6rYxd3oMhVkI75dnTohDWA/hIzIq4wHcKlVFJSNM+beLCkNRLYGP8GuxMCwGYWMAnKnKTQ4exDZCJUJqfzxEVhSdNIhTlNMTBuPjOfK8CdT8QHHwOVJJ9BCukBSGJyIeacBzsmQR0Qijd4XvKpEmpSKMdOINxbKUCQhzEG4pzE2kNFB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
-</SearchPlugin>
--- a/browser/components/customizableui/src/CustomizableUI.jsm
+++ b/browser/components/customizableui/src/CustomizableUI.jsm
@@ -487,16 +487,17 @@ let CustomizableUIInternal = {
     }
   },
 
   buildArea: function(aArea, aPlacements, aAreaNode) {
     let document = aAreaNode.ownerDocument;
     let window = document.defaultView;
     let inPrivateWindow = PrivateBrowsingUtils.isWindowPrivate(window);
     let container = aAreaNode.customizationTarget;
+    let areaIsPanel = gAreas.get(aArea).get("type") == CustomizableUI.TYPE_MENU_PANEL;
 
     if (!container) {
       throw new Error("Expected area " + aArea
                       + " to have a customizationTarget attribute.");
     }
 
     // Restore nav-bar visibility since it may have been hidden
     // through a migration path (bug 938980) or an add-on.
@@ -514,16 +515,21 @@ let CustomizableUIInternal = {
           currentNode = currentNode.nextSibling;
         }
 
         if (currentNode && currentNode.id == id) {
           currentNode = currentNode.nextSibling;
           continue;
         }
 
+        if (this.isSpecialWidget(id) && areaIsPanel) {
+          placementsToRemove.add(id);
+          continue;
+        }
+
         let [provider, node] = this.getWidgetNode(id, window);
         if (!node) {
           LOG("Unknown widget: " + id);
           continue;
         }
 
         // If the placements have items in them which are (now) no longer removable,
         // we shouldn't be moving them:
@@ -543,17 +549,17 @@ let CustomizableUIInternal = {
           let widget = gPalette.get(id);
           if (!widget.showInPrivateBrowsing && inPrivateWindow) {
             continue;
           }
         }
 
         this.ensureButtonContextMenu(node, aAreaNode);
         if (node.localName == "toolbarbutton") {
-          if (aArea == CustomizableUI.AREA_PANEL) {
+          if (areaIsPanel) {
             node.setAttribute("wrap", "true");
           } else {
             node.removeAttribute("wrap");
           }
         }
 
         this.insertWidgetBefore(node, currentNode, container, aArea);
         if (gResetting) {
@@ -1550,16 +1556,23 @@ let CustomizableUIInternal = {
     return true;
   },
 
   addWidgetToArea: function(aWidgetId, aArea, aPosition, aInitialAdd) {
     if (!gAreas.has(aArea)) {
       throw new Error("Unknown customization area: " + aArea);
     }
 
+    // Hack: don't want special widgets in the panel (need to check here as well
+    // as in canWidgetMoveToArea because the menu panel is lazy):
+    if (gAreas.get(aArea).get("type") == CustomizableUI.TYPE_MENU_PANEL &&
+        this.isSpecialWidget(aWidgetId)) {
+      return;
+    }
+
     // If this is a lazy area that hasn't been restored yet, we can't yet modify
     // it - would would at least like to add to it. So we keep track of it in
     // gFuturePlacements,  and use that to add it when restoring the area. We
     // throw away aPosition though, as that can only be bogus if the area hasn't
     // yet been restorted (caller can't possibly know where its putting the
     // widget in relation to other widgets).
     if (this.isAreaLazy(aArea)) {
       gFuturePlacements.get(aArea).add(aWidgetId);
@@ -2368,20 +2381,26 @@ let CustomizableUIInternal = {
     // an API widget which has already been removed from gPalette. Returning true
     // here allows us to then remove its ID from any placements where it might
     // still occur.
     return true;
   },
 
   canWidgetMoveToArea: function(aWidgetId, aArea) {
     let placement = this.getPlacementOfWidget(aWidgetId);
-    if (placement && placement.area != aArea &&
-        !this.isWidgetRemovable(aWidgetId)) {
-      return false;
+    if (placement && placement.area != aArea) {
+      // Special widgets can't move to the menu panel.
+      if (this.isSpecialWidget(aWidgetId) && gAreas.has(aArea) &&
+          gAreas.get(aArea).get("type") == CustomizableUI.TYPE_MENU_PANEL) {
+        return false;
+      }
+      // For everything else, just return whether the widget is removable.
+      return this.isWidgetRemovable(aWidgetId);
     }
+
     return true;
   },
 
   ensureWidgetPlacedInWindow: function(aWidgetId, aWindow) {
     let placement = this.getPlacementOfWidget(aWidgetId);
     if (!placement) {
       return false;
     }
--- a/browser/components/customizableui/test/browser.ini
+++ b/browser/components/customizableui/test/browser.ini
@@ -103,11 +103,12 @@ skip-if = os == "linux"
 [browser_987177_destroyWidget_xul.js]
 [browser_987177_xul_wrapper_updating.js]
 [browser_987492_window_api.js]
 [browser_987640_charEncoding.js]
 [browser_992747_toggle_noncustomizable_toolbar.js]
 [browser_993322_widget_notoolbar.js]
 [browser_995164_registerArea_during_customize_mode.js]
 [browser_996364_registerArea_different_properties.js]
+[browser_1003588_no_specials_in_panel.js]
 [browser_1008559_anchor_undo_restore.js]
 [browser_bootstrapped_custom_toolbar.js]
 [browser_panel_toggle.js]
new file mode 100644
--- /dev/null
+++ b/browser/components/customizableui/test/browser_1003588_no_specials_in_panel.js
@@ -0,0 +1,92 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+
+add_task(function* checkNoAddingToPanel() {
+  let area = CustomizableUI.AREA_PANEL;
+  let previousPlacements = getAreaWidgetIds(area);
+  CustomizableUI.addWidgetToArea("separator", area);
+  CustomizableUI.addWidgetToArea("spring", area);
+  CustomizableUI.addWidgetToArea("spacer", area);
+  assertAreaPlacements(area, previousPlacements);
+
+  let oldNumberOfItems = previousPlacements.length;
+  if (getAreaWidgetIds(area).length != oldNumberOfItems) {
+    CustomizableUI.reset();
+  }
+});
+
+add_task(function* checkAddingToToolbar() {
+  let area = CustomizableUI.AREA_NAVBAR;
+  let previousPlacements = getAreaWidgetIds(area);
+  CustomizableUI.addWidgetToArea("separator", area);
+  CustomizableUI.addWidgetToArea("spring", area);
+  CustomizableUI.addWidgetToArea("spacer", area);
+  let expectedPlacements = [...previousPlacements].concat([
+    /separator/,
+    /spring/,
+    /spacer/
+  ]);
+  assertAreaPlacements(area, expectedPlacements);
+
+  let newlyAddedElements = getAreaWidgetIds(area).slice(-3);
+  while (newlyAddedElements.length) {
+    CustomizableUI.removeWidgetFromArea(newlyAddedElements.shift());
+  }
+
+  assertAreaPlacements(area, previousPlacements);
+
+  let oldNumberOfItems = previousPlacements.length;
+  if (getAreaWidgetIds(area).length != oldNumberOfItems) {
+    CustomizableUI.reset();
+  }
+});
+
+
+add_task(function* checkDragging() {
+  let startArea = CustomizableUI.AREA_NAVBAR;
+  let targetArea = CustomizableUI.AREA_PANEL;
+  let startingToolbarPlacements = getAreaWidgetIds(startArea);
+  let startingTargetPlacements = getAreaWidgetIds(targetArea);
+
+  CustomizableUI.addWidgetToArea("separator", startArea);
+  CustomizableUI.addWidgetToArea("spring", startArea);
+  CustomizableUI.addWidgetToArea("spacer", startArea);
+
+  let placementsWithSpecials = getAreaWidgetIds(startArea);
+  let elementsToMove = [];
+  for (let id of placementsWithSpecials) {
+    if (CustomizableUI.isSpecialWidget(id)) {
+      elementsToMove.push(id);
+    }
+  }
+  is(elementsToMove.length, 3, "Should have 3 elements to try and drag.");
+
+  yield startCustomizing();
+  for (let id of elementsToMove) {
+    simulateItemDrag(document.getElementById(id), PanelUI.contents);
+  }
+
+  assertAreaPlacements(startArea, placementsWithSpecials);
+  assertAreaPlacements(targetArea, startingTargetPlacements);
+
+  for (let id of elementsToMove) {
+    simulateItemDrag(document.getElementById(id), gCustomizeMode.visiblePalette);
+  }
+
+  assertAreaPlacements(startArea, startingToolbarPlacements);
+  assertAreaPlacements(targetArea, startingTargetPlacements);
+
+  ok(!gCustomizeMode.visiblePalette.querySelector("toolbarspring,toolbarseparator,toolbarspacer"),
+     "No specials should make it to the palette alive.");
+  yield endCustomizing();
+});
+
+
+add_task(function* asyncCleanup() {
+  yield endCustomizing();
+  CustomizableUI.reset();
+});
+
--- a/browser/components/search/test/browser_google.js
+++ b/browser/components/search/test/browser_google.js
@@ -62,16 +62,18 @@ function test() {
   url = engine.getSubmission("foo", null, "contextmenu").uri.spec;
   is(url, base + "&channel=rcs", "Check context menu search URL for 'foo'");
   url = engine.getSubmission("foo", null, "keyword").uri.spec;
   is(url, base + "&channel=fflb", "Check keyword search URL for 'foo'");
   url = engine.getSubmission("foo", null, "searchbar").uri.spec;
   is(url, base + "&channel=sb", "Check search bar search URL for 'foo'");
   url = engine.getSubmission("foo", null, "homepage").uri.spec;
   is(url, base + "&channel=np&source=hp", "Check homepage search URL for 'foo'");
+  url = engine.getSubmission("foo", null, "newtab").uri.spec;
+  is(url, base + "&channel=nts", "Check newtab search URL for 'foo'");
 
   // Check search suggestion URL.
   url = engine.getSubmission("foo", "application/x-suggestions+json").uri.spec;
   is(url, "https://www.google.com/complete/search?client=firefox&q=foo", "Check search suggestion URL for 'foo'");
 
   // Check all other engine properties.
   const EXPECTED_ENGINE = {
     name: "Google",
@@ -141,16 +143,21 @@ function test() {
               "purpose": "searchbar",
             },
             {
               "name": "channel",
               "value": "np",
               "purpose": "homepage",
             },
             {
+              "name": "channel",
+              "value": "nts",
+              "purpose": "newtab",
+            },
+            {
               "name": "source",
               "value": "hp",
               "purpose": "homepage",
             },
           ],
           mozparams: {
             "client": {
               "name": "client",
--- a/browser/components/search/test/browser_google_behavior.js
+++ b/browser/components/search/test/browser_google_behavior.js
@@ -92,17 +92,17 @@ function test() {
         registerCleanupFunction(function () {
           sb.value = "";
         });
         EventUtils.synthesizeKey("VK_RETURN", {});
       }
     },
     {
       name: "new tab search",
-      searchURL: base,
+      searchURL: base + "&channel=nts",
       run: function () {
         function doSearch(doc) {
           // Re-add the listener, and perform a search
           gBrowser.addProgressListener(listener);
           doc.getElementById("newtab-search-text").value = "foo";
           doc.getElementById("newtab-search-submit").click();
         }
 
--- a/browser/devtools/debugger/test/browser_dbg_listtabs-02.js
+++ b/browser/devtools/debugger/test/browser_dbg_listtabs-02.js
@@ -1,15 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Make sure the root actor's live tab list implementation works as specified.
  */
 
+let devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
+let { BrowserTabList } = devtools.require("devtools/server/actors/webbrowser");
+
 let gTestPage = "data:text/html;charset=utf-8," + encodeURIComponent(
   "<title>JS Debugger BrowserTabList test page</title><body>Yo.</body>");
 
 // The tablist object whose behavior we observe.
 let gTabList;
 let gFirstActor, gActorA;
 let gTabA, gTabB, gTabC;
 let gNewWindow;
@@ -21,17 +24,17 @@ function onListChangedHandler() {
 }
 
 function test() {
   if (!DebuggerServer.initialized) {
     DebuggerServer.init(() => true);
     DebuggerServer.addBrowserActors();
   }
 
-  gTabList = new DebuggerServer.BrowserTabList("fake DebuggerServerConnection");
+  gTabList = new BrowserTabList("fake DebuggerServerConnection");
   gTabList._testing = true;
   gTabList.onListChanged = onListChangedHandler;
 
   checkSingleTab()
     .then(addTabA)
     .then(testTabA)
     .then(addTabB)
     .then(testTabB)
--- a/browser/devtools/markupview/markup-view.css
+++ b/browser/devtools/markupview/markup-view.css
@@ -160,8 +160,12 @@
   position: absolute;
   top: 0;
   right: 5px;
   width: 80px;
   border: 1px dashed #888;
   background: rgba(205,205,255,0.2);
   outline: 1px solid transparent;
 }
+
+.tag-line .open, .tag-line .close, .comment {
+  cursor: default;
+}
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -625,16 +625,23 @@
 @BINPATH@/chrome/recording.manifest
 @BINPATH@/chrome/recording/*
 #ifdef MOZ_GTK
 @BINPATH@/browser/chrome/icons/default/default16.png
 @BINPATH@/browser/chrome/icons/default/default32.png
 @BINPATH@/browser/chrome/icons/default/default48.png
 #endif
 
+; [Webide Files]
+#ifdef MOZ_DEVTOOLS_WEBIDE
+@BINPATH@/browser/chrome/webide@JAREXT@
+@BINPATH@/browser/chrome/webide.manifest
+@BINPATH@/browser/@PREF_DIR@/webide-prefs.js
+#endif
+
 ; shell icons
 #ifdef XP_UNIX
 #ifndef XP_MACOSX
 ; shell icons
 @BINPATH@/browser/icons/*.png
 #ifdef MOZ_UPDATER
 ; updater icon
 @BINPATH@/icons/updater.png
--- a/browser/locales/en-US/searchplugins/google.xml
+++ b/browser/locales/en-US/searchplugins/google.xml
@@ -22,12 +22,13 @@
   <MozParam name="client" condition="defaultEngine" trueValue="firefox-nightly" falseValue="firefox"/>
 #else
   <MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/>
 #endif
   <MozParam name="channel" condition="purpose" purpose="contextmenu" value="rcs"/>
   <MozParam name="channel" condition="purpose" purpose="keyword" value="fflb"/>
   <MozParam name="channel" condition="purpose" purpose="searchbar" value="sb"/>
   <MozParam name="channel" condition="purpose" purpose="homepage" value="np"/>
+  <MozParam name="channel" condition="purpose" purpose="newtab" value="nts"/>
   <MozParam name="source" condition="purpose" purpose="homepage" value="hp"/>
 </Url>
 <Url type="text/html" method="GET" template="https://www.google.com/" rel="searchform"/>
 </SearchPlugin>
--- a/browser/modules/Social.jsm
+++ b/browser/modules/Social.jsm
@@ -408,21 +408,26 @@ function sizeSocialPanelToContent(panel,
   // if the panel is preloaded prior to being shown, cs will be null.  in that
   // case use the minimum size for the panel until it is shown.
   if (cs) {
     let computedHeight = parseInt(cs.marginTop) + body.offsetHeight + parseInt(cs.marginBottom);
     height = Math.max(computedHeight, height);
     let computedWidth = parseInt(cs.marginLeft) + body.offsetWidth + parseInt(cs.marginRight);
     width = Math.max(computedWidth, width);
   }
-  iframe.style.width = width + "px";
-  iframe.style.height = height + "px";
-  // since we do not use panel.sizeTo, we need to adjust the arrow ourselves
-  if (panel.state == "open")
-    panel.adjustArrowPosition();
+  // add extra space the panel needs if any
+  width += panel.boxObject.width - iframe.boxObject.width;
+  height += panel.boxObject.height - iframe.boxObject.height;
+
+  // when size is computed, we want to be sure changes are "significant" since
+  // some sites will resize when the iframe is resized by a small amount, making
+  // the panel slowely shrink to some minimum.
+  if (Math.abs(panel.boxObject.width - width) > 2 || Math.abs(panel.boxObject.height - height) > 2) {
+    panel.sizeTo(width, height);
+  }
 }
 
 function DynamicResizeWatcher() {
   this._mutationObserver = null;
 }
 
 DynamicResizeWatcher.prototype = {
   start: function DynamicResizeWatcher_start(panel, iframe) {
@@ -463,17 +468,20 @@ this.OpenGraphBuilder = {
     if (queryString) {
       queryString.split('&').forEach(function (val) {
         let [name, value] = val.split('=');
         let p = /%\{(.+)\}/.exec(value);
         if (!p) {
           // preserve non-template query vars
           query[name] = value;
         } else if (pageData[p[1]]) {
-          query[name] = pageData[p[1]];
+          if (p[1] == "previews")
+            query[name] = pageData[p[1]][0];
+          else
+            query[name] = pageData[p[1]];
         } else if (p[1] == "body") {
           // build a body for emailers
           let body = "";
           if (pageData.title)
             body += pageData.title + "\n\n";
           if (pageData.description)
             body += pageData.description + "\n\n";
           if (pageData.text)
--- a/toolkit/components/social/SocialService.jsm
+++ b/toolkit/components/social/SocialService.jsm
@@ -787,16 +787,23 @@ SocialProvider.prototype = {
       this._terminate();
     }
   },
 
   get manifest() {
     return SocialService.getManifestByOrigin(this.origin);
   },
 
+  getPageSize: function(name) {
+    let manifest = this.manifest;
+    if (manifest && manifest.pageSize)
+      return manifest.pageSize[name];
+    return undefined;
+  },
+
   // Reference to a workerAPI object for this provider. Null if the provider has
   // no FrameWorker, or is disabled.
   workerAPI: null,
 
   // Contains information related to the user's profile. Populated by the
   // workerAPI via updateUserProfile.
   // Properties:
   //   iconURL, portrait, userName, displayName, profileURL
--- a/toolkit/devtools/server/actors/childtab.js
+++ b/toolkit/devtools/server/actors/childtab.js
@@ -1,14 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
+let { TabActor } = require("devtools/server/actors/webbrowser");
+
 /**
  * Tab actor for documents living in a child process.
  *
  * Depends on TabActor, defined in webbrowser.js.
  */
 
 /**
  * Creates a tab actor for handling requests to the single tab, like
--- a/toolkit/devtools/server/actors/webapps.js
+++ b/toolkit/devtools/server/actors/webapps.js
@@ -4,22 +4,21 @@
 
 "use strict";
 
 let Cu = Components.utils;
 let Cc = Components.classes;
 let Ci = Components.interfaces;
 let CC = Components.Constructor;
 
+Cu.import("resource://gre/modules/NetUtil.jsm");
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
-let {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
-
-let promise;
+let {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
 
 function debug(aMsg) {
   /*
   Cc["@mozilla.org/consoleservice;1"]
     .getService(Ci.nsIConsoleService)
     .logStringMessage("--*-- WebappsActor : " + aMsg);
   */
 }
--- a/toolkit/devtools/server/actors/webbrowser.js
+++ b/toolkit/devtools/server/actors/webbrowser.js
@@ -3,31 +3,33 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 let { Ci, Cu } = require("chrome");
 let Services = require("Services");
-let { createExtraActors, appendExtraActors } = require("devtools/server/actors/common");
+let { ActorPool, createExtraActors, appendExtraActors } = require("devtools/server/actors/common");
 let { RootActor } = require("devtools/server/actors/root");
 let { AddonThreadActor, ThreadActor } = require("devtools/server/actors/script");
+let { DebuggerServer } = require("devtools/server/main");
 let DevToolsUtils = require("devtools/toolkit/DevToolsUtils");
+let { dbg_assert, dumpn } = DevToolsUtils;
 
 let {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm");
 
 // Assumptions on events module:
 // events needs to be dispatched synchronously,
 // by calling the listeners in the order or registration.
 XPCOMUtils.defineLazyGetter(this, "events", () => {
-  return devtools.require("sdk/event/core");
+  return require("sdk/event/core");
 });
 
 // Also depends on following symbols, shared by common scope with main.js:
 // DebuggerServer, CommonCreateExtraActors, CommonAppendExtraActors, ActorPool,
 // ThreadActor
 
 /**
  * Browser-specific actors.
@@ -485,16 +487,18 @@ BrowserTabList.prototype.onCloseWindow =
       /* The browser document of a closed window has no default view. */
       if (!browser.ownerDocument.defaultView) {
         this._handleActorClose(actor, browser);
       }
     }
   }, "BrowserTabList.prototype.onCloseWindow's delayed body"), 0);
 }, "BrowserTabList.prototype.onCloseWindow");
 
+exports.BrowserTabList = BrowserTabList;
+
 /**
  * Creates a tab actor for handling requests to a browser tab, like
  * attaching and detaching. TabActor respects the actor factories
  * registered with DebuggerServer.addTabActor.
  *
  * This class is subclassed by BrowserTabActor and
  * ContentActor. Subclasses are expected to implement a getter
  * the docShell properties.
@@ -1070,16 +1074,18 @@ TabActor.prototype = {
 TabActor.prototype.requestTypes = {
   "attach": TabActor.prototype.onAttach,
   "detach": TabActor.prototype.onDetach,
   "reload": TabActor.prototype.onReload,
   "navigateTo": TabActor.prototype.onNavigateTo,
   "reconfigure": TabActor.prototype.onReconfigure
 };
 
+exports.TabActor = TabActor;
+
 /**
  * Creates a tab actor for handling requests to a single in-process
  * <browser> tab. Most of the implementation comes from TabActor.
  *
  * @param aConnection DebuggerServerConnection
  *        The conection to the client.
  * @param aBrowser browser
  *        The browser instance that contains this tab.
@@ -1449,8 +1455,16 @@ DebuggerProgressListener.prototype = {
       let newURI = aRequest instanceof Ci.nsIChannel ? aRequest.URI.spec : null;
       this._tabActor._willNavigate(window, newURI, aRequest);
     }
     if (isWindow && isStop) {
       this._tabActor._navigate(window);
     }
   }, "DebuggerProgressListener.prototype.onStateChange")
 };
+
+exports.register = function(handle) {
+  handle.setRootActor(createRootActor);
+};
+
+exports.unregister = function(handle) {
+  handle.setRootActor(null);
+};
--- a/toolkit/devtools/server/main.js
+++ b/toolkit/devtools/server/main.js
@@ -41,19 +41,17 @@ this.dbg_assert = dbg_assert;
 // object usage
 Object.defineProperty(this, "Components", {
   get: function () require("chrome").components
 });
 
 const DBG_STRINGS_URI = "chrome://global/locale/devtools/debugger.properties";
 
 const nsFile = CC("@mozilla.org/file/local;1", "nsIFile", "initWithPath");
-Cu.import("resource://gre/modules/reflect.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
 dumpn.wantLogging = Services.prefs.getBoolPref("devtools.debugger.log");
 
 Cu.import("resource://gre/modules/devtools/deprecated-sync-thenables.js");
 
 function loadSubScript(aURL)
 {
   try {
     let loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
@@ -103,16 +101,21 @@ var gRegisteredModules = Object.create(n
  * when the module is unregistered or when the server is
  * destroyed.
  */
 function ModuleAPI() {
   let activeTabActors = new Set();
   let activeGlobalActors = new Set();
 
   return {
+    // See DebuggerServer.setRootActor for a description.
+    setRootActor: function(factory) {
+      DebuggerServer.setRootActor(factory);
+    },
+
     // See DebuggerServer.addGlobalActor for a description.
     addGlobalActor: function(factory, name) {
       DebuggerServer.addGlobalActor(factory, name);
       activeGlobalActors.add(factory);
     },
     // See DebuggerServer.removeGlobalActor for a description.
     removeGlobalActor: function(factory) {
       DebuggerServer.removeGlobalActor(factory);
@@ -336,17 +339,17 @@ var DebuggerServer = {
    * Any new global actor will be exposed and returned by the root actor.
    *
    * That's the reason why tab actors aren't loaded on demand via
    * restrictPrivileges=true, to prevent exposing them on b2g parent process's
    * root actor.
    */
   addBrowserActors: function(aWindowType = "navigator:browser", restrictPrivileges = false) {
     this.chromeWindowType = aWindowType;
-    this.addActors("resource://gre/modules/devtools/server/actors/webbrowser.js");
+    this.registerModule("devtools/server/actors/webbrowser");
 
     if (!restrictPrivileges) {
       this.addTabActors();
       let { ChromeDebuggerActor } = require("devtools/server/actors/script");
       this.addGlobalActor(ChromeDebuggerActor, "chromeDebugger");
       this.registerModule("devtools/server/actors/preference");
     }
 
@@ -360,18 +363,18 @@ var DebuggerServer = {
   addChildActors: function () {
     // In case of apps being loaded in parent process, DebuggerServer is already
     // initialized and browser actors are already loaded,
     // but childtab.js hasn't been loaded yet.
     if (!DebuggerServer.tabActorFactories.hasOwnProperty("consoleActor")) {
       this.addTabActors();
     }
     // But webbrowser.js and childtab.js aren't loaded from shell.js.
-    if (!("BrowserTabActor" in this)) {
-      this.addActors("resource://gre/modules/devtools/server/actors/webbrowser.js");
+    if (!this.isModuleRegistered("devtools/server/actors/webbrowser")) {
+      this.registerModule("devtools/server/actors/webbrowser");
     }
     if (!("ContentActor" in this)) {
       this.addActors("resource://gre/modules/devtools/server/actors/childtab.js");
     }
   },
 
   /**
    * Install tab actors.
@@ -722,16 +725,20 @@ var DebuggerServer = {
    */
   _connectionClosed: function DS_connectionClosed(aConnection) {
     delete this._connections[aConnection.prefix];
     this.emit("connectionchange", "closed", aConnection);
   },
 
   // DebuggerServer extension API.
 
+  setRootActor: function DS_setRootActor(aFunction) {
+    this.createRootActor = aFunction;
+  },
+
   /**
    * Registers handlers for new tab-scoped request types defined dynamically.
    * This is used for example by add-ons to augment the functionality of the tab
    * actor. Note that the name or actorPrefix of the request type is not allowed
    * to clash with existing protocol packet properties, like 'title', 'url' or
    * 'actor', since that would break the protocol.
    *
    * @param aFunction function
--- a/toolkit/devtools/server/tests/unit/head_dbg.js
+++ b/toolkit/devtools/server/tests/unit/head_dbg.js
@@ -180,25 +180,25 @@ function attachTestTabAndResume(aClient,
 }
 
 /**
  * Initialize the testing debugger server.
  */
 function initTestDebuggerServer()
 {
   DebuggerServer.registerModule("devtools/server/actors/script");
-  DebuggerServer.addActors("resource://test/testactors.js");
+  DebuggerServer.registerModule("xpcshell-test/testactors");
   // Allow incoming connections.
   DebuggerServer.init(function () { return true; });
 }
 
 function initTestTracerServer()
 {
   DebuggerServer.registerModule("devtools/server/actors/script");
-  DebuggerServer.addActors("resource://test/testactors.js");
+  DebuggerServer.registerModule("xpcshell-test/testactors");
   DebuggerServer.registerModule("devtools/server/actors/tracer");
   // Allow incoming connections.
   DebuggerServer.init(function () { return true; });
 }
 
 function finishClient(aClient)
 {
   aClient.close(function() {
--- a/toolkit/devtools/server/tests/unit/test_dbgglobal.js
+++ b/toolkit/devtools/server/tests/unit/test_dbgglobal.js
@@ -20,17 +20,17 @@ function run_test()
   // These should still fail because we haven't added a createRootActor
   // implementation yet.
   check_except(function() {
     DebuggerServer.openListener(-1);
   });
   check_except(DebuggerServer.closeListener);
   check_except(DebuggerServer.connectPipe);
 
-  DebuggerServer.addActors("resource://test/testactors.js");
+  DebuggerServer.registerModule("xpcshell-test/testactors");
 
   // Now they should work.
   DebuggerServer.openListener(-1);
   DebuggerServer.closeListener();
 
   // Make sure we got the test's root actor all set up.
   let client1 = DebuggerServer.connectPipe();
   client1.hooks = {
--- a/toolkit/devtools/server/tests/unit/testactors.js
+++ b/toolkit/devtools/server/tests/unit/testactors.js
@@ -1,16 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-const Cu = Components.utils;
-const devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
 const { ActorPool, appendExtraActors, createExtraActors } = require("devtools/server/actors/common");
-const { RootActor } = devtools.require("devtools/server/actors/root");
-const { ThreadActor } = devtools.require("devtools/server/actors/script");
+const { RootActor } = require("devtools/server/actors/root");
+const { ThreadActor } = require("devtools/server/actors/script");
+const { DebuggerServer } = require("devtools/server/main");
 
 var gTestGlobals = [];
 DebuggerServer.addTestGlobal = function(aGlobal) {
   gTestGlobals.push(aGlobal);
 };
 
 // A mock tab list, for use by tests. This simply presents each global in
 // gTestGlobals as a tab, and the list is fixed: it never calls its
@@ -116,8 +115,16 @@ TestTabActor.prototype = {
   _createExtraActors: createExtraActors,
   _appendExtraActors: appendExtraActors
 };
 
 TestTabActor.prototype.requestTypes = {
   "attach": TestTabActor.prototype.onAttach,
   "detach": TestTabActor.prototype.onDetach
 };
+
+exports.register = function(handle) {
+  handle.setRootActor(createRootActor);
+};
+
+exports.unregister = function(handle) {
+  handle.setRootActor(null);
+};
deleted file mode 100644
index 0b95e1788759e6826bb498298b6c7914cf4a3f6b..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
--- a/toolkit/themes/osx/global/jar.mn
+++ b/toolkit/themes/osx/global/jar.mn
@@ -94,17 +94,16 @@ toolkit.jar:
   skin/classic/global/icons/autocomplete-dropmarker.png              (icons/autocomplete-dropmarker.png)
   skin/classic/global/icons/autoscroll.png                           (icons/autoscroll.png)
   skin/classic/global/icons/blacklist_favicon.png                    (icons/blacklist_favicon.png)
   skin/classic/global/icons/blacklist_64.png                         (icons/blacklist_64.png)
   skin/classic/global/icons/chevron.png                              (icons/chevron.png)
   skin/classic/global/icons/chevron@2x.png                           (icons/chevron@2x.png)
   skin/classic/global/icons/checkbox.png                             (icons/checkbox.png)
   skin/classic/global/icons/checkbox@2x.png                          (icons/checkbox@2x.png)
-  skin/classic/global/icons/close-sidebar.png                        (icons/close-sidebar.png)
   skin/classic/global/icons/close.png                                (icons/close.png)
   skin/classic/global/icons/close@2x.png                             (icons/close@2x.png)
   skin/classic/global/icons/find-arrows.png                          (icons/find-arrows.png)
   skin/classic/global/icons/information-16.png                       (icons/information-16.png)
   skin/classic/global/icons/information-24.png                       (icons/information-24.png)
   skin/classic/global/icons/information-32.png                       (icons/information-32.png)
   skin/classic/global/icons/information-64.png                       (icons/information-64.png)
   skin/classic/global/icons/information-large.png                    (icons/information-large.png)