Merge fx-team to m-c a=merge CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Tue, 03 Mar 2015 17:11:40 -0800
changeset 262041 c5b90c003be8ec497f063e3d632574e3b06d84ac
parent 262006 67b9d5593e2cbe8719abdafc95b0655c5246f4ae (current diff)
parent 262040 9740c8bfd125c2834102f96021d5a5513605eed5 (diff)
child 262044 de554b42ef07e1af069bb95965bf3ae28faf7b38
child 262046 a07003e503d672220812801c6eb637387533eda9
child 262126 6dc164972d9a9f9bf50dd91f5c257ecd1f282f49
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone39.0a1
first release with
nightly linux32
c5b90c003be8 / 39.0a1 / 20150304030231 / files
nightly linux64
c5b90c003be8 / 39.0a1 / 20150304030231 / files
nightly mac
c5b90c003be8 / 39.0a1 / 20150304030231 / files
nightly win32
c5b90c003be8 / 39.0a1 / 20150304030231 / files
nightly win64
c5b90c003be8 / 39.0a1 / 20150304030231 / 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 a=merge CLOSED TREE
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1884,13 +1884,15 @@ pref("dom.ipc.processHangMonitor", true)
 #ifdef DEBUG
 // Don't report hangs in DEBUG builds. They're too slow and often a
 // debugger is attached.
 pref("dom.ipc.reportProcessHangs", false);
 #else
 pref("dom.ipc.reportProcessHangs", true);
 #endif
 
+#ifndef NIGHTLY_BUILD
 // Disable reader mode by default.
 pref("reader.parse-on-load.enabled", false);
+#endif
 
 // Disable ReadingList by default.
 pref("browser.readinglist.enabled", false);
--- a/browser/base/content/browser-eme.js
+++ b/browser/base/content/browser-eme.js
@@ -162,16 +162,25 @@ let gEMEHandler = {
 
     let msgPrefix = "emeNotifications.drmContentPlaying.";
     let msgId = msgPrefix + "message2";
     let btnLabelId = msgPrefix + "button.label";
     let btnAccessKeyId = msgPrefix + "button.accesskey";
 
     let message = gNavigatorBundle.getFormattedString(msgId, [this._brandShortName]);
     let anchorId = "eme-notification-icon";
+    let firstPlayPref = "browser.eme.ui.firstContentShown";
+    if (!Services.prefs.getPrefType(firstPlayPref) ||
+        !Services.prefs.getBoolPref(firstPlayPref)) {
+      document.getElementById(anchorId).setAttribute("firstplay", "true");
+      Services.prefs.setBoolPref(firstPlayPref, true);
+    } else {
+      document.getElementById(anchorId).removeAttribute("firstplay");
+    }
+
 
     let mainAction = {
       label: gNavigatorBundle.getString(btnLabelId),
       accessKey: gNavigatorBundle.getString(btnAccessKeyId),
       callback: function() { openPreferences("paneContent"); },
       dismiss: true
     };
     let options = {
--- a/browser/base/content/pageinfo/pageInfo.xul
+++ b/browser/base/content/pageinfo/pageInfo.xul
@@ -150,16 +150,19 @@
             <splitter class="tree-splitter"/>
             <treecol id="meta-content" label="&generalMetaContent;"
                      persist="width" flex="4"
                      onclick="gMetaView.onPageMediaSort('meta-content');"/>
           </treecols>
           <treechildren id="metatreechildren" flex="1"/>
         </tree>        
       </groupbox>
+      <hbox pack="end">
+        <button command="cmd_help" label="&helpButton.label;" dlgtype="help"/>
+      </hbox>
     </vbox>
 
     <!-- Media information -->
     <vbox id="mediaPanel">
       <tree id="imagetree" onselect="onImageSelect();" contextmenu="picontext"
             ondragstart="onBeginLinkDrag(event,'image-address','image-alt')">
         <treecols>
           <treecol sortSeparators="true" primary="true" persist="width" flex="10"
@@ -246,16 +249,19 @@
         </vbox>
       </vbox>
       <hbox id="mediaSaveBox" collapsed="true">
         <spacer id="mediaSaveBoxSpacer" flex="1"/>
         <button label="&mediaSaveAs;" accesskey="&mediaSaveAs2.accesskey;"
                 icon="save" id="mediasaveasbutton"
                 oncommand="saveMedia();"/>
       </hbox>
+      <hbox pack="end">
+        <button command="cmd_help" label="&helpButton.label;" dlgtype="help"/>
+      </hbox>
     </vbox>
 
     <!-- Feeds -->
     <vbox id="feedPanel">
       <richlistbox id="feedListbox" flex="1"/>
     </vbox>
 
     <!-- Permissions -->
@@ -285,16 +291,19 @@
               <radio class="permPluginTemplateRadioDefault" label="&permUseDefault;"/>
               <radio class="permPluginTemplateRadioAsk" label="&permAskAlways;"/>
               <radio class="permPluginTemplateRadioAllow" label="&permAllow;"/>
               <radio class="permPluginTemplateRadioBlock" label="&permBlock;"/>
             </radiogroup>
           </hbox>
         </vbox>
       </vbox>
+      <hbox pack="end">
+        <button command="cmd_help" label="&helpButton.label;" dlgtype="help"/>
+      </hbox>
     </vbox>
 
     <!-- Security & Privacy -->
     <vbox id="securityPanel">
       <!-- Identity Section -->
       <groupbox id="security-identity-groupbox" flex="1">
         <caption id="security-identity" label="&securityView.identity.header;"/>
         <grid id="security-identity-grid" flex="1">
@@ -402,16 +411,19 @@
       <groupbox id="security-technical-groupbox" flex="1">
         <caption id="security-technical" label="&securityView.technical.header;" />
         <vbox id="security-technical-box" flex="1">
           <label id="security-technical-shortform" class="fieldValue"/>
           <description id="security-technical-longform1" class="fieldLabel"/>
           <description id="security-technical-longform2" class="fieldLabel"/>
         </vbox>
       </groupbox>
+      <hbox pack="end">
+        <button command="cmd_help" label="&helpButton.label;" dlgtype="help"/>
+      </hbox>
     </vbox>
     <!-- Others added by overlay -->
   </deck>
 
 #ifdef XP_MACOSX
 #include ../browserMountPoints.inc
 #endif
 
--- a/browser/components/downloads/content/downloads.js
+++ b/browser/components/downloads/content/downloads.js
@@ -971,21 +971,21 @@ const DownloadsView = {
     // We must check for existence synchronously because this is a DOM event.
     let file = new FileUtils.File(DownloadsView.controllerForElement(element)
                                                .download.target.path);
     if (!file.exists()) {
       return;
     }
 
     let dataTransfer = aEvent.dataTransfer;
-    dataTransfer.mozSetDataAt("application/x-moz-file", localFile, 0);
+    dataTransfer.mozSetDataAt("application/x-moz-file", file, 0);
     dataTransfer.effectAllowed = "copyMove";
-    var url = Services.io.newFileURI(localFile).spec;
-    dataTransfer.setData("text/uri-list", url);
-    dataTransfer.setData("text/plain", url);
+    let spec = NetUtil.newURI(file).spec;
+    dataTransfer.setData("text/uri-list", spec);
+    dataTransfer.setData("text/plain", spec);
     dataTransfer.addElement(element);
 
     aEvent.stopPropagation();
   },
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 //// DownloadsViewItem
--- a/browser/components/preferences/in-content/advanced.xul
+++ b/browser/components/preferences/in-content/advanced.xul
@@ -355,17 +355,17 @@
           </hbox>
           <radio value="checkOnly"
                 label="&updateCheck.label;"
                 accesskey="&updateCheck.accesskey;"/>
           <radio value="manual"
                 label="&updateManual.label;"
                 accesskey="&updateManual.accesskey;"/>
         </radiogroup>
-
+        <separator class="thin"/>
         <hbox>
           <button id="showUpdateHistory"
                   label="&updateHistory.label;"
                   accesskey="&updateHistory.accesskey;"
                   preference="app.update.disable_button.showUpdateHistory"/>
         </hbox>
 
 #ifdef MOZ_MAINTENANCE_SERVICE
@@ -382,47 +382,53 @@
                   label="&enableSearchUpdate.label;"
                   accesskey="&enableSearchUpdate.accesskey;"
                   preference="browser.search.update"/>
       </groupbox>
     </tabpanel>
 
     <!-- Certificates -->
     <tabpanel id="encryptionPanel" orient="vertical">
-
+      <groupbox id="certSelection" align="start">
+        <caption><label>&certSelection.label;</label></caption>
         <description id="CertSelectionDesc" control="certSelection">&certSelection.description;</description>
 
         <!--
           The values on these radio buttons may look like l12y issues, but
           they're not - this preference uses *those strings* as its values.
           I KID YOU NOT.
         -->
-        <radiogroup id="certSelection" orient="horizontal" preftype="string"
+        <radiogroup id="certSelection"
+                    preftype="string"
                     preference="security.default_personal_cert"
                     aria-labelledby="CertSelectionDesc">
-          <radio label="&certs.auto;" accesskey="&certs.auto.accesskey;"
-                value="Select Automatically"/>
-          <radio label="&certs.ask;" accesskey="&certs.ask.accesskey;"
-                value="Ask Every Time"/>
+          <radio label="&certs.auto;"
+                 accesskey="&certs.auto.accesskey;"
+                 value="Select Automatically"/>
+          <radio label="&certs.ask;"
+                 accesskey="&certs.ask.accesskey;"
+                 value="Ask Every Time"/>
         </radiogroup>
-
-        <separator/>
-
-        <checkbox id="enableOCSP"
-                  label="&enableOCSP.label;"
-                  accesskey="&enableOCSP.accesskey;"
-                  onsyncfrompreference="return gAdvancedPane.readEnableOCSP();"
-                  onsynctopreference="return gAdvancedPane.writeEnableOCSP();"
-                  preference="security.OCSP.enabled"/>
-
-        <separator/>
-
-        <hbox>
-          <button id="viewCertificatesButton"
-                  label="&viewCerts.label;" accesskey="&viewCerts.accesskey;"
-                  preference="security.disable_button.openCertManager"/>
-          <button id="viewSecurityDevicesButton"
-                  label="&viewSecurityDevices.label;" accesskey="&viewSecurityDevices.accesskey;"
-                  preference="security.disable_button.openDeviceManager"/>
-        </hbox>
+      </groupbox>
+      <separator/>
+      <checkbox id="enableOCSP"
+                label="&enableOCSP.label;"
+                accesskey="&enableOCSP.accesskey;"
+                onsyncfrompreference="return gAdvancedPane.readEnableOCSP();"
+                onsynctopreference="return gAdvancedPane.writeEnableOCSP();"
+                preference="security.OCSP.enabled"/>
+      <separator/>
+      <hbox>
+        <button id="viewCertificatesButton"
+                flex="1"
+                label="&viewCerts.label;"
+                accesskey="&viewCerts.accesskey;"
+                preference="security.disable_button.openCertManager"/>
+        <button id="viewSecurityDevicesButton"
+                flex="1"
+                label="&viewSecurityDevices.label;"
+                accesskey="&viewSecurityDevices.accesskey;"
+                preference="security.disable_button.openDeviceManager"/>
+        <hbox flex="10"/>
+      </hbox>
     </tabpanel>
   </tabpanels>
 </tabbox>
--- a/browser/components/preferences/in-content/content.xul
+++ b/browser/components/preferences/in-content/content.xul
@@ -22,19 +22,19 @@
               type="wstring"/>
 
   <!-- Languages -->
   <preference id="browser.translation.detectLanguage"
               name="browser.translation.detectLanguage"
               type="bool"/>
 </preferences>
 
-<script type="application/javascript" 
+<script type="application/javascript"
         src="chrome://mozapps/content/preferences/fontbuilder.js"/>
-<script type="application/javascript" 
+<script type="application/javascript"
         src="chrome://browser/content/preferences/in-content/content.js"/>
 
 <hbox id="header-content"
       class="header"
       hidden="true"
       data-category="paneContent">
   <label class="header-name">&paneContent.title;</label>
 </hbox>
@@ -82,70 +82,56 @@
       </row>
     </rows>
   </grid>
 </groupbox>
 
 <!-- Fonts and Colors -->
 <groupbox id="fontsGroup" data-category="paneContent" hidden="true">
   <caption><label>&fontsAndColors.label;</label></caption>
-
-  <grid id="fontsGrid">
-    <columns>
-      <column flex="1"/>
-      <column/>
-    </columns>
-    <rows id="fontsRows">
-      <row id="fontRow">
-        <hbox align="center">
-          <label control="defaultFont" accesskey="&defaultFont.accesskey;">&defaultFont.label;</label>
-          <menulist id="defaultFont" />
-          <label control="defaultFontSize" accesskey="&defaultSize.accesskey;">&defaultSize.label;</label>
-          <menulist id="defaultFontSize">
-            <menupopup>
-              <menuitem value="9" label="9"/>
-              <menuitem value="10" label="10"/>
-              <menuitem value="11" label="11"/>
-              <menuitem value="12" label="12"/>
-              <menuitem value="13" label="13"/>
-              <menuitem value="14" label="14"/>
-              <menuitem value="15" label="15"/>
-              <menuitem value="16" label="16"/>
-              <menuitem value="17" label="17"/>
-              <menuitem value="18" label="18"/>
-              <menuitem value="20" label="20"/>
-              <menuitem value="22" label="22"/>
-              <menuitem value="24" label="24"/>
-              <menuitem value="26" label="26"/>
-              <menuitem value="28" label="28"/>
-              <menuitem value="30" label="30"/>
-              <menuitem value="32" label="32"/>
-              <menuitem value="34" label="34"/>
-              <menuitem value="36" label="36"/>
-              <menuitem value="40" label="40"/>
-              <menuitem value="44" label="44"/>
-              <menuitem value="48" label="48"/>
-              <menuitem value="56" label="56"/>
-              <menuitem value="64" label="64"/>
-              <menuitem value="72" label="72"/>
-            </menupopup>
-          </menulist>
-        </hbox>
-        <button id="advancedFonts" icon="select-font"
-                label="&advancedFonts.label;"
-                accesskey="&advancedFonts.accesskey;"/>
-      </row>
-      <row id="colorsRow">
-        <hbox/>
-        <button id="colors" icon="select-color"
-                label="&colors.label;"
-                accesskey="&colors.accesskey;"/>
-      </row>
-    </rows>
-  </grid>
+  <hbox align="center">
+    <label control="defaultFont" accesskey="&defaultFont.accesskey;">&defaultFont.label;</label>
+    <menulist id="defaultFont" flex="1"/>
+    <label control="defaultFontSize" accesskey="&defaultSize.accesskey;">&defaultSize.label;</label>
+    <menulist id="defaultFontSize">
+      <menupopup>
+        <menuitem value="9" label="9"/>
+        <menuitem value="10" label="10"/>
+        <menuitem value="11" label="11"/>
+        <menuitem value="12" label="12"/>
+        <menuitem value="13" label="13"/>
+        <menuitem value="14" label="14"/>
+        <menuitem value="15" label="15"/>
+        <menuitem value="16" label="16"/>
+        <menuitem value="17" label="17"/>
+        <menuitem value="18" label="18"/>
+        <menuitem value="20" label="20"/>
+        <menuitem value="22" label="22"/>
+        <menuitem value="24" label="24"/>
+        <menuitem value="26" label="26"/>
+        <menuitem value="28" label="28"/>
+        <menuitem value="30" label="30"/>
+        <menuitem value="32" label="32"/>
+        <menuitem value="34" label="34"/>
+        <menuitem value="36" label="36"/>
+        <menuitem value="40" label="40"/>
+        <menuitem value="44" label="44"/>
+        <menuitem value="48" label="48"/>
+        <menuitem value="56" label="56"/>
+        <menuitem value="64" label="64"/>
+        <menuitem value="72" label="72"/>
+      </menupopup>
+    </menulist>
+    <button id="advancedFonts" icon="select-font"
+            label="&advancedFonts.label;"
+            accesskey="&advancedFonts.accesskey;"/>
+    <button id="colors" icon="select-color"
+            label="&colors.label;"
+            accesskey="&colors.accesskey;"/>
+  </hbox>
 </groupbox>
 
 <!-- Languages -->
 <groupbox id="languagesGroup" data-category="paneContent" hidden="true">
   <caption><label>&languages.label;</label></caption>
 
   <hbox id="languagesBox" align="center">
     <description flex="1" control="chooseLanguage">&chooseLanguage.label;</description>
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -126,47 +126,43 @@
         <menuitem label="&historyHeader.remember.label;" value="remember"/>
         <menuitem label="&historyHeader.dontremember.label;" value="dontremember"/>
         <menuitem label="&historyHeader.custom.label;" value="custom"/>
       </menupopup>
     </menulist>
     <label>&historyHeader.post.label;</label>
   </hbox>
   <deck id="historyPane">
-    <vbox align="center" id="historyRememberPane">
+    <vbox id="historyRememberPane">
       <hbox align="center" flex="1">
-        <spacer flex="1" class="indent"/>
-        <vbox flex="2">
+        <vbox>
           <description>&rememberDescription.label;</description>
-          <separator/>
+          <separator class="thin"/>
           <description>&rememberActions.pre.label;<html:a
           class="inline-link" id="historyRememberClear" href="#"
           >&rememberActions.clearHistory.label;</html:a>&rememberActions.middle.label;<html:a
           class="inline-link" id="historyRememberCookies" href="#"
           >&rememberActions.removeCookies.label;</html:a>&rememberActions.post.label;</description>
         </vbox>
-        <spacer flex="1" class="indent"/>
       </hbox>
     </vbox>
-    <vbox align="center" id="historyDontRememberPane">
+    <vbox id="historyDontRememberPane">
       <hbox align="center" flex="1">
-        <spacer flex="1" class="indent"/>
-        <vbox flex="2">
+        <vbox>
           <description>&dontrememberDescription.label;</description>
-          <separator/>
+          <separator class="thin"/>
           <description>&dontrememberActions.pre.label;<html:a
           class="inline-link" id="historyDontRememberClear" href="#"
           >&dontrememberActions.clearHistory.label;</html:a>&dontrememberActions.post.label;</description>
         </vbox>
-        <spacer flex="1" class="indent"/>
       </hbox>
     </vbox>
     <vbox id="historyCustomPane">
       <separator class="thin"/>
-      <vbox class="indent">
+      <vbox>
         <vbox align="start">
           <checkbox id="privateBrowsingAutoStart"
                     label="&privateBrowsingPermanent2.label;"
                     accesskey="&privateBrowsingPermanent2.accesskey;"
                     preference="browser.privatebrowsing.autostart"/>
         </vbox>
         <vbox class="indent">
           <vbox align="start">
--- a/browser/components/preferences/in-content/security.xul
+++ b/browser/components/preferences/in-content/security.xul
@@ -1,16 +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/.
 
 <!-- Security panel -->
 
-<script type="application/javascript" 
-        src="chrome://browser/content/preferences/in-content/security.js"/>  
+<script type="application/javascript"
+        src="chrome://browser/content/preferences/in-content/security.js"/>
 
 <preferences id="securityPreferences" hidden="true" data-category="paneSecurity">
   <!-- XXX buttons -->
   <preference id="pref.privacy.disable_button.view_passwords"
               name="pref.privacy.disable_button.view_passwords"
               type="bool"/>
   <preference id="pref.privacy.disable_button.view_passwords_exceptions"
               name="pref.privacy.disable_button.view_passwords_exceptions"
@@ -78,25 +78,34 @@
               preference="signon.rememberSignons"
               onsyncfrompreference="return gSecurityPane.readSavePasswords();"/>
     <spacer flex="1"/>
     <button id="passwordExceptions"
             label="&passwordExceptions.label;"
             accesskey="&passwordExceptions.accesskey;"
             preference="pref.privacy.disable_button.view_passwords_exceptions"/>
   </hbox>
-  <hbox id="masterPasswordBox">
-    <checkbox id="useMasterPassword"
-              label="&useMasterPassword.label;"
-              accesskey="&useMasterPassword.accesskey;"/>
-    <spacer flex="1"/>
-    <button id="changeMasterPassword"
-            label="&changeMasterPassword.label;"
-            accesskey="&changeMasterPassword.accesskey;"/>
-  </hbox>
-
-  <hbox id="showPasswordsBox">
-    <spacer flex="1"/>
-    <button id="showPasswords"
-            label="&savedPasswords.label;" accesskey="&savedPasswords.accesskey;"
-            preference="pref.privacy.disable_button.view_passwords"/>
-  </hbox>
+  <grid id="passwordGrid">
+    <columns>
+      <column flex="1"/>
+      <column/>
+    </columns>
+    <rows id="passwordRows">
+      <row id="masterPasswordRow">
+        <hbox id="masterPasswordBox">
+          <checkbox id="useMasterPassword"
+                    label="&useMasterPassword.label;"
+                    accesskey="&useMasterPassword.accesskey;"/>
+          <spacer flex="1"/>
+        </hbox>
+        <button id="changeMasterPassword"
+                label="&changeMasterPassword.label;"
+                accesskey="&changeMasterPassword.accesskey;"/>
+      </row>
+      <row id="showPasswordRow">
+        <hbox id="showPasswordsBox"/>
+        <button id="showPasswords"
+                label="&savedPasswords.label;" accesskey="&savedPasswords.accesskey;"
+                preference="pref.privacy.disable_button.view_passwords"/>
+      </row>
+    </rows>
+  </grid>
 </groupbox>
--- a/browser/components/preferences/in-content/sync.xul
+++ b/browser/components/preferences/in-content/sync.xul
@@ -168,24 +168,24 @@
         </rows>
       </grid>
       <hbox>
         <label id="unlinkDevice" class="text-link">
           &unlinkDevice.label;
         </label>
       </hbox>
     </groupbox>
-    <hbox id="tosPP-normal" pack="center">
+    <vbox id="tosPP-normal">
       <label id="tosPP-normal-ToS" class="text-link">
         &prefs.tosLink.label;
       </label>
       <label id="tosPP-normal-PP" class="text-link">
         &prefs.ppLink.label;
       </label>
-    </hbox>
+    </vbox>
   </vbox>
 
   <vbox id="needsUpdate" align="center" pack="center">
     <hbox>
       <label id="loginError"/>
       <label id="loginErrorUpdatePass" class="text-link">
         &updatePass.label;
       </label>
@@ -221,44 +221,47 @@
 
   <vbox id="hasFxaAccount">
     <groupbox id="fxaGroup">
       <caption><label>&syncBrand.fxAccount.label;</label></caption>
 
       <deck id="fxaLoginStatus">
 
         <!-- logged in and verified and all is good -->
-        <hbox align="center">
+        <hbox id="fxaLoginVerified"
+              align="center">
           <label id="fxaEmailAddress1"/>
           <spacer flex="1"/>
           <button id="verifiedManage"
                   label="&manage.label;"/>
           <button id="fxaUnlinkButton"
                   label="&disconnect.label;"/>
         </hbox>
 
         <!-- logged in to an unverified account -->
-        <hbox flex="1">
+        <hbox id="fxaLoginUnverified"
+              flex="1">
           <description>
             &signedInUnverified.beforename.label;
             <label id="fxaEmailAddress2"/>
             &signedInUnverified.aftername.label;
           </description>
           <spacer flex="1"/>
           <vbox align="end">
             <button id="verifyFxaAccount"
                     label="&verify.label;"/>
             <label id="unverifiedUnlinkFxaAccount" class="text-link">
               &forget.label;
             </label>
           </vbox>
         </hbox>
 
         <!-- logged in locally but server rejected credentials -->
-        <hbox flex="1">
+        <hbox id="fxaLoginRejected"
+              flex="1">
           <description>
             &signedInLoginFailure.beforename.label;
             <label id="fxaEmailAddress3"/>
             &signedInLoginFailure.aftername.label;
           </description>
           <spacer flex="1"/>
           <vbox align="end">
             <button id="rejectReSignIn"
@@ -301,18 +304,18 @@
       <label accesskey="&syncDeviceName.accesskey;"
              control="syncComputerName">
         &syncDeviceName.label;
       </label>
       <textbox id="fxaSyncComputerName"
                 flex="1"/>
     </hbox>
     <spacer flex="1"/>
-    <hbox id="tosPP-small" pack="center">
+    <vbox id="tosPP-small">
       <label id="tosPP-small-ToS" class="text-link small">
         &prefs.tosLink.label;
       </label>
       <label id="tosPP-small-PP" class="text-link small">
         &fxaPrivacyNotice.link.label;
       </label>
-    </hbox>
+    </vbox>
   </vbox>
 </deck>
--- a/browser/devtools/framework/gDevTools.jsm
+++ b/browser/devtools/framework/gDevTools.jsm
@@ -774,16 +774,21 @@ let gDevToolsBrowser = {
   },
 
   isWebIDEWidgetInstalled: function() {
     let widgetWrapper = CustomizableUI.getWidget("webide-button");
     return !!(widgetWrapper && widgetWrapper.provider == CustomizableUI.PROVIDER_API);
   },
 
   /**
+   * The deferred promise will be resolved by WebIDE's UI.init()
+   */
+  isWebIDEInitialized: promise.defer(),
+
+  /**
    * Uninstall WebIDE widget
    */
   uninstallWebIDEWidget: function() {
     if (this.isWebIDEWidgetInstalled()) {
       CustomizableUI.removeWidgetFromArea("webide-button");
     }
     CustomizableUI.destroyWidget("webide-button");
   },
--- a/browser/devtools/sourceeditor/editor.js
+++ b/browser/devtools/sourceeditor/editor.js
@@ -150,17 +150,17 @@ function Editor(config) {
     mode:              Editor.modes.text,
     indentUnit:        tabSize,
     tabSize:           tabSize,
     contextMenu:       null,
     matchBrackets:     true,
     extraKeys:         {},
     indentWithTabs:    useTabs,
     styleActiveLine:   true,
-    autoCloseBrackets: "()[]{}''\"\"",
+    autoCloseBrackets: "()[]{}''\"\"``",
     autoCloseEnabled:  useAutoClose,
     theme:             "mozilla",
     themeSwitching:    true,
     autocomplete:      false,
     autocompleteOpts:  {}
   };
 
   // Additional shortcuts.
--- a/browser/devtools/sourceeditor/test/browser_editor_prefs.js
+++ b/browser/devtools/sourceeditor/test/browser_editor_prefs.js
@@ -66,17 +66,17 @@ function test() {
       "CodeMirror-foldgutter"], "gutters is correct");
 
     is(ed.getOption("tabSize"), 4, "tabSize is correct");
     is(ed.getOption("indentUnit"), 4, "indentUnit is correct");
     is(ed.getOption("foldGutter"), true, "foldGutter is correct");
     is(ed.getOption("enableCodeFolding"), undefined, "enableCodeFolding is correct");
     is(ed.getOption("indentWithTabs"), false, "indentWithTabs is correct");
     is(ed.getOption("keyMap"), "sublime", "keyMap is correct");
-    is(ed.getOption("autoCloseBrackets"), "()[]{}''\"\"", "autoCloseBrackets is correct");
+    is(ed.getOption("autoCloseBrackets"), "()[]{}''\"\"``", "autoCloseBrackets is correct");
     is(ed.getOption("autocomplete"), true, "autocomplete is correct");
     ok(ed.isAutocompletionEnabled(), "Autocompletion is enabled");
 
     info ("Forcing foldGutter off using enableCodeFolding");
     ed.setOption("enableCodeFolding", false);
 
     is(ed.getOption("foldGutter"), false, "foldGutter is correct");
     is(ed.getOption("enableCodeFolding"), false, "enableCodeFolding is correct");
--- a/browser/devtools/webide/content/webide.js
+++ b/browser/devtools/webide/content/webide.js
@@ -102,16 +102,18 @@ let UI = {
 
     this.setupDeck();
 
     this.contentViewer = window.QueryInterface(Ci.nsIInterfaceRequestor)
                                .getInterface(Ci.nsIWebNavigation)
                                .QueryInterface(Ci.nsIDocShell)
                                .contentViewer;
     this.contentViewer.fullZoom = Services.prefs.getCharPref("devtools.webide.zoom");
+
+    gDevToolsBrowser.isWebIDEInitialized.resolve();
   },
 
   uninit: function() {
     window.removeEventListener("focus", this.onfocus, true);
     AppManager.off("app-manager-update", this.appManagerUpdate);
     AppManager.uninit();
     window.removeEventListener("message", this.onMessage);
     this.updateConnectionTelemetry();
--- a/browser/devtools/webide/test/test_basic.html
+++ b/browser/devtools/webide/test/test_basic.html
@@ -16,16 +16,20 @@
 
     <script type="application/javascript;version=1.8">
       window.onload = function() {
         SimpleTest.waitForExplicitFinish();
 
         Task.spawn(function* () {
             let win = yield openWebIDE();
 
+            const {gDevToolsBrowser} = Cu.import("resource:///modules/devtools/gDevTools.jsm");
+            yield gDevToolsBrowser.isWebIDEInitialized.promise;
+            ok(true, "WebIDE was initialized");
+
             ok(win, "Found a window");
             ok(win.AppManager, "App Manager accessible");
             let appmgr = win.AppManager;
             ok(appmgr.connection, "App Manager connection ready");
             ok(appmgr.runtimeList, "Runtime list ready");
 
             // test error reporting
             let nbox = win.document.querySelector("#notificationbox");
--- a/browser/locales/en-US/chrome/browser/pageInfo.dtd
+++ b/browser/locales/en-US/chrome/browser/pageInfo.dtd
@@ -78,8 +78,10 @@
 <!ENTITY  securityView.privacy.cookies                  "Is this website storing information (cookies) on my computer?">
 <!ENTITY  securityView.privacy.viewCookies              "View Cookies">
 <!ENTITY  securityView.privacy.viewCookies.accessKey    "k">
 <!ENTITY  securityView.privacy.passwords                "Have I saved any passwords for this website?">
 <!ENTITY  securityView.privacy.viewPasswords            "View Saved Passwords">
 <!ENTITY  securityView.privacy.viewPasswords.accessKey  "w">
 
 <!ENTITY  securityView.technical.header                 "Technical Details">
+
+<!ENTITY  helpButton.label                              "Help">
--- a/browser/locales/en-US/chrome/browser/preferences/advanced.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/advanced.dtd
@@ -108,16 +108,17 @@
 
 <!ENTITY offlineAppsList2.label          "The following websites are allowed to store data for offline use:">
 <!ENTITY offlineAppsList.height          "7em">
 <!ENTITY offlineAppsListRemove.label     "Removeā€¦">
 <!ENTITY offlineAppsListRemove.accesskey "R">
 <!ENTITY offlineAppRemove.confirm        "Remove offline data">
 
 <!ENTITY certificateTab.label            "Certificates">
+<!ENTITY certSelection.label             "Requests">
 <!ENTITY certSelection.description       "When a server requests my personal certificate:">
 <!ENTITY certs.auto                      "Select one automatically">
 <!ENTITY certs.auto.accesskey            "S">
 <!ENTITY certs.ask                       "Ask me every time">
 <!ENTITY certs.ask.accesskey             "A">
 <!ENTITY enableOCSP.label                "Query OCSP responder servers to confirm the current validity of certificates">
 <!ENTITY enableOCSP.accesskey            "Q">
 <!ENTITY viewCerts.label                 "View Certificates">
--- a/browser/themes/linux/browser.css
+++ b/browser/themes/linux/browser.css
@@ -2212,16 +2212,27 @@ chatbox {
 #eme-notification-icon {
   list-style-image: url("chrome://browser/skin/drm-icon.svg#chains");
 }
 
 #eme-notification-icon:hover:active {
   list-style-image: url("chrome://browser/skin/drm-icon.svg#chains-pressed");
 }
 
+#eme-notification-icon[firstplay=true] {
+  animation: emeTeachingMoment 0.2s linear 0s 5 normal;
+}
+
+@keyframes emeTeachingMoment {
+  0% {transform: translateX(0); }
+  25% {transform: translateX(3px) }
+  75% {transform: translateX(-3px) }
+  100% { transform: translateX(0); }
+}
+
 /* Customization mode */
 
 %include ../shared/customizableui/customizeMode.inc.css
 
 #main-window[customize-entered] > #tab-view-deck {
   background-image: url("chrome://browser/skin/customizableui/customizeMode-gridTexture.png"),
                     linear-gradient(to bottom, #bcbcbc, #b5b5b5);
   background-attachment: fixed;
--- a/browser/themes/osx/browser.css
+++ b/browser/themes/osx/browser.css
@@ -4642,16 +4642,27 @@ window > chatbox {
 #eme-notification-icon {
   list-style-image: url("chrome://browser/skin/drm-icon.svg#chains");
 }
 
 #eme-notification-icon:hover:active {
   list-style-image: url("chrome://browser/skin/drm-icon.svg#chains-pressed");
 }
 
+#eme-notification-icon[firstplay=true] {
+  animation: emeTeachingMoment 0.2s linear 0s 5 normal;
+}
+
+@keyframes emeTeachingMoment {
+  0% {transform: translateX(0); }
+  25% {transform: translateX(3px) }
+  75% {transform: translateX(-3px) }
+  100% { transform: translateX(0); }
+}
+
 /* Customization mode */
 
 %include ../shared/customizableui/customizeMode.inc.css
 
 #main-window[customizing] {
   background-color: rgb(178,178,178);
 }
 
--- a/browser/themes/shared/incontentprefs/preferences.inc.css
+++ b/browser/themes/shared/incontentprefs/preferences.inc.css
@@ -186,16 +186,30 @@ treecol {
 .actionsMenu > menupopup > menuitem {
   -moz-padding-start: 10px !important;
 }
 
 .actionsMenu > menupopup > menuitem > .menu-iconic-left {
   -moz-margin-end: 8px !important;
 }
 
+/* Collapse the non-active vboxes in decks to use only the height the
+   active vbox needs */
+#historyPane:not([selectedIndex="1"]) > #historyDontRememberPane,
+#historyPane:not([selectedIndex="2"]) > #historyCustomPane,
+#weavePrefsDeck:not([selectedIndex="1"]) > #hasAccount,
+#weavePrefsDeck:not([selectedIndex="2"]) > #needsUpdate,
+#weavePrefsDeck:not([selectedIndex="3"]) > #fxaDeterminingStatus,
+#weavePrefsDeck:not([selectedIndex="4"]) > #noFxaAccount,
+#weavePrefsDeck:not([selectedIndex="5"]) > #hasFxaAccount,
+#fxaLoginStatus:not([selectedIndex="1"]) > #fxaLoginUnverified,
+#fxaLoginStatus:not([selectedIndex="2"]) > #fxaLoginRejected {
+  visibility: collapse;
+}
+
 /* XXX This style is for bug 740213 and should be removed once that
    bug has a solution. */
 description > html|a {
   cursor: pointer;
 }
 
 #noFxaAccount {
   /* Overriding the margins from the base preferences.css theme file.
@@ -213,20 +227,16 @@ description > html|a {
   /* no margin-start for elements at the begin of a line */
   -moz-margin-start: 0;
 }
 
 #tabsElement {
   -moz-margin-end: 4px; /* add the 4px end-margin of other elements */
 }
 
-#encryptionPanel {
-  margin-top: 15px;
-}
-
 #telemetryLearnMore,
 #FHRLearnMore,
 #crashReporterLearnMore {
   /* center the links */
   margin-top: 8px;
   margin-bottom: 8px;
 }
 
@@ -241,16 +251,20 @@ description > html|a {
 }
 
 @media (min-resolution: 2dppx) {
   #trackingProtectionImage {
     list-style-image: url(chrome://browser/skin/bad-content-blocked-16@2x.png);
   }
 }
 
+#showUpdateHistory {
+  -moz-margin-start: 0;
+}
+
 /**
  * Dialog
  */
 
 #dialogOverlay {
   background-color: rgba(0,0,0,0.5);
   visibility: hidden;
 }
--- a/browser/themes/windows/browser.css
+++ b/browser/themes/windows/browser.css
@@ -2833,16 +2833,27 @@ chatbox {
 #eme-notification-icon {
   list-style-image: url("chrome://browser/skin/drm-icon.svg#chains");
 }
 
 #eme-notification-icon:hover:active {
   list-style-image: url("chrome://browser/skin/drm-icon.svg#chains-pressed");
 }
 
+#eme-notification-icon[firstplay=true] {
+  animation: emeTeachingMoment 0.2s linear 0s 5 normal;
+}
+
+@keyframes emeTeachingMoment {
+  0% {transform: translateX(0); }
+  25% {transform: translateX(3px) }
+  75% {transform: translateX(-3px) }
+  100% { transform: translateX(0); }
+}
+
 /* Customization mode */
 
 %include ../shared/customizableui/customizeMode.inc.css
 
 /**
  * This next rule is a hack to disable subpixel anti-aliasing on all
  * labels during the customize mode transition. Subpixel anti-aliasing
  * on Windows with Direct2D layers acceleration is particularly slow to
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -853,8 +853,11 @@ pref("media.gmp-provider.enabled", true)
 // (auto only works on platforms where the 'devicelight' event is enabled)
 pref("reader.color_scheme", "auto");
 
 // Color scheme values available in reader mode UI.
 pref("reader.color_scheme.values", "[\"light\",\"dark\",\"auto\"]");
 
 // Whether to use a vertical or horizontal toolbar.
 pref("reader.toolbar.vertical", false);
+
+// Whether or not to display buttons related to reading list in reader view.
+pref("browser.readinglist.enabled", true);
--- a/mobile/android/base/RemoteTabsExpandableListAdapter.java
+++ b/mobile/android/base/RemoteTabsExpandableListAdapter.java
@@ -149,17 +149,17 @@ public class RemoteTabsExpandableListAda
         // right: device type icon; client name text color; expanded state
         // indicator.
         final int deviceTypeResId;
         final int textColorResId;
         final int deviceExpandedResId;
 
         if (isExpanded && !client.tabs.isEmpty()) {
             deviceTypeResId = "desktop".equals(client.deviceType) ? R.drawable.sync_desktop : R.drawable.sync_mobile;
-            textColorResId = R.color.home_text_color;
+            textColorResId = R.color.placeholder_active_grey;
             deviceExpandedResId = R.drawable.home_group_expanded;
         } else {
             deviceTypeResId = "desktop".equals(client.deviceType) ? R.drawable.sync_desktop_inactive : R.drawable.sync_mobile_inactive;
             textColorResId = R.color.home_text_color_disabled;
             deviceExpandedResId = R.drawable.home_group_collapsed;
         }
 
         // Now update the UI.
--- a/mobile/android/base/background/fxa/oauth/FxAccountAbstractClient.java
+++ b/mobile/android/base/background/fxa/oauth/FxAccountAbstractClient.java
@@ -1,16 +1,15 @@
 /* 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/. */
 
 package org.mozilla.gecko.background.fxa.oauth;
 
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.security.GeneralSecurityException;
 import java.util.Locale;
 import java.util.concurrent.Executor;
 
 import org.mozilla.gecko.background.fxa.FxAccountClientException;
 import org.mozilla.gecko.background.fxa.oauth.FxAccountAbstractClientException.FxAccountAbstractClientMalformedResponseException;
 import org.mozilla.gecko.background.fxa.oauth.FxAccountAbstractClientException.FxAccountAbstractClientRemoteException;
 import org.mozilla.gecko.fxa.FxAccountConstants;
@@ -122,17 +121,17 @@ public abstract class FxAccountAbstractC
 
   protected <T> void post(BaseResource resource, final ExtendedJSONObject requestBody, final RequestDelegate<T> delegate) {
     try {
       if (requestBody == null) {
         resource.post((HttpEntity) null);
       } else {
         resource.post(requestBody);
       }
-    } catch (UnsupportedEncodingException e) {
+    } catch (Exception e) {
       invokeHandleError(delegate, e);
       return;
     }
   }
 
   /**
    * Translate resource callbacks into request callbacks invoked on the provided
    * executor.
--- a/mobile/android/base/browserid/verifier/BrowserIDRemoteVerifierClient20.java
+++ b/mobile/android/base/browserid/verifier/BrowserIDRemoteVerifierClient20.java
@@ -1,15 +1,14 @@
 /* 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/. */
 
 package org.mozilla.gecko.browserid.verifier;
 
-import java.io.UnsupportedEncodingException;
 import java.net.URI;
 import java.net.URISyntaxException;
 
 import org.mozilla.gecko.sync.ExtendedJSONObject;
 import org.mozilla.gecko.sync.net.BaseResource;
 
 /**
  * The verifier protocol changed: version 1 posts form-encoded data; version 2
@@ -47,13 +46,13 @@ public class BrowserIDRemoteVerifierClie
     r.delegate = new RemoteVerifierResourceDelegate(r, delegate);
 
     final ExtendedJSONObject requestBody = new ExtendedJSONObject();
     requestBody.put(JSON_KEY_AUDIENCE, audience);
     requestBody.put(JSON_KEY_ASSERTION, assertion);
 
     try {
       r.post(requestBody);
-    } catch (UnsupportedEncodingException e) {
+    } catch (Exception e) {
       delegate.handleError(e);
     }
   }
 }
--- a/mobile/android/base/resources/color-large-v11/new_tablet_tab_strip_item_title.xml
+++ b/mobile/android/base/resources/color-large-v11/new_tablet_tab_strip_item_title.xml
@@ -2,17 +2,17 @@
 <selector xmlns:android="http://schemas.android.com/apk/res/android"
 	      xmlns:gecko="http://schemas.android.com/apk/res-auto">
 
     <item android:state_checked="true"
           gecko:state_private="true"
           android:color="@color/text_color_primary_inverse"/>
 
     <item android:state_checked="true"
-          android:color="@color/text_color_secondary"/>
+          android:color="@color/placeholder_grey"/>
 
     <item android:state_checked="false"
           gecko:state_dark="true"
           android:color="@color/text_color_primary_inverse"/>
 
-    <item android:color="@color/text_color_secondary"/>
+    <item android:color="@color/placeholder_grey"/>
 
 </selector>
--- a/mobile/android/base/resources/color/primary_text.xml
+++ b/mobile/android/base/resources/color/primary_text.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
 
     <item android:state_enabled="false" android:color="@color/text_color_primary_disable_only" />
-    <item android:color="@color/text_color_primary"/>
+    <item android:color="@color/placeholder_active_grey"/>
 
 </selector>
--- a/mobile/android/base/resources/color/secondary_text.xml
+++ b/mobile/android/base/resources/color/secondary_text.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
 
     <item android:state_enabled="false" android:color="@color/text_color_primary_disable_only" />
-    <item android:color="@color/text_color_secondary"/>
+    <item android:color="@color/placeholder_grey"/>
 
 </selector>
--- a/mobile/android/base/resources/color/top_sites_grid_item_title.xml
+++ b/mobile/android/base/resources/color/top_sites_grid_item_title.xml
@@ -4,11 +4,11 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
 
     <!-- empty with no url -->
     <item android:state_empty="true" android:color="#80777777" />
 
     <!-- default -->
-    <item android:color="#FF777777"/>
+    <item android:color="@color/placeholder_grey"/>
 
 </selector>
--- a/mobile/android/base/resources/color/url_bar_title.xml
+++ b/mobile/android/base/resources/color/url_bar_title.xml
@@ -8,14 +8,14 @@
 
     <!-- private browsing mode -->
     <item gecko:state_private="true" android:color="#FFDDDDDD" />
 
     <!-- dark theme -->
     <item gecko:state_dark="true" android:color="#FFDDDDDD"/>
 
     <!-- light theme -->
-    <item gecko:state_light="true" android:color="#FF222222"/>
+    <item gecko:state_light="true" android:color="@color/placeholder_active_grey"/>
 
     <!-- normal mode -->
-    <item android:color="#FF222222"/>
+    <item android:color="@color/placeholder_active_grey"/>
 
 </selector>
--- a/mobile/android/base/resources/drawable-large-v11/new_tablet_action_bar_button.xml
+++ b/mobile/android/base/resources/drawable-large-v11/new_tablet_action_bar_button.xml
@@ -10,17 +10,17 @@
          android:state_pressed="true"
          android:state_enabled="true">
 
         <inset android:insetTop="@dimen/new_tablet_browser_toolbar_menu_item_inset_vertical"
                android:insetBottom="@dimen/new_tablet_browser_toolbar_menu_item_inset_vertical"
                android:insetLeft="@dimen/new_tablet_browser_toolbar_menu_item_inset_horizontal"
                android:insetRight="@dimen/new_tablet_browser_toolbar_menu_item_inset_horizontal">
             <shape android:shape="rectangle">
-                <solid android:color="@color/new_tablet_highlight_pb"/>
+                <solid android:color="@color/placeholder_active_grey"/>
                 <corners android:radius="@dimen/new_tablet_browser_toolbar_menu_item_corner_radius"/>
             </shape>
         </inset>
 
     </item>
 
     <item gecko:state_private="true"
           android:state_focused="true"
--- a/mobile/android/base/resources/drawable-large-v11/new_tablet_url_bar_nav_button.xml
+++ b/mobile/android/base/resources/drawable-large-v11/new_tablet_url_bar_nav_button.xml
@@ -4,17 +4,17 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <selector xmlns:android="http://schemas.android.com/apk/res/android"
           xmlns:gecko="http://schemas.android.com/apk/res-auto">
 
     <!-- private pressed state -->
     <item gecko:state_private="true"
           android:state_pressed="true"
-          android:drawable="@color/new_tablet_highlight_pb"/>
+          android:drawable="@color/placeholder_active_grey"/>
 
     <!-- focused state -->
     <item gecko:state_private="true"
           android:state_focused="true"
           android:state_pressed="false"
           android:drawable="@color/new_tablet_highlight_focused_pb"/>
 
     <!-- pressed state -->
--- a/mobile/android/base/resources/drawable/firstrun_button_enabled.xml
+++ b/mobile/android/base/resources/drawable/firstrun_button_enabled.xml
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- 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/. -->
 
 <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle" >
-  <solid android:color="@color/firstrun_pager_button" />
+  <solid android:color="@color/action_orange" />
   <corners
       android:radius="@dimen/fxaccount_corner_radius" />
 </shape>
--- a/mobile/android/base/resources/drawable/firstrun_button_pressed.xml
+++ b/mobile/android/base/resources/drawable/firstrun_button_pressed.xml
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- 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/. -->
 
 <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle" >
-  <solid android:color="@color/firstrun_pager_button_pressed" />
+  <solid android:color="@color/action_orange_pressed" />
   <corners
       android:radius="@dimen/fxaccount_corner_radius" />
 </shape>
--- a/mobile/android/base/resources/drawable/remote_tabs_setup_button_background.xml
+++ b/mobile/android/base/resources/drawable/remote_tabs_setup_button_background.xml
@@ -8,13 +8,13 @@
         <shape android:shape="rectangle">
             <solid android:color="@color/remote_tabs_setup_button_background_hit"/>
             <corners android:radius="@dimen/fxaccount_corner_radius"/>
         </shape>
     </item>
 
     <item>
         <shape android:shape="rectangle">
-            <solid android:color="@color/remote_tabs_setup_button_background"/>
+            <solid android:color="@color/action_orange"/>
             <corners android:radius="@dimen/fxaccount_corner_radius"/>
         </shape>
     </item>
 </selector>
--- a/mobile/android/base/resources/drawable/suggestion_selector.xml
+++ b/mobile/android/base/resources/drawable/suggestion_selector.xml
@@ -1,32 +1,32 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
 
     <item android:state_pressed="true">
         <shape>
             <gradient android:angle="90"
-                      android:startColor="#E66000"
+                      android:startColor="@color/action_orange"
                       android:endColor="@color/fennec_ui_orange"
                       android:type="linear"/>
 
             <corners android:radius="4dp"/>
         </shape>
     </item>
 
     <item android:state_focused="true"
           android:state_enabled="true">
         <shape>
             <gradient android:angle="90"
                       android:startColor="#D2DAE2"
                       android:endColor="#E3E8ED"
                       android:type="linear"/>
 
             <stroke android:width="2dp"
-                    android:color="#E66000" />
+                    android:color="@color/action_orange" />
 
             <corners android:radius="4dp"/>
         </shape>
     </item>
 
     <item android:state_enabled="true">
         <shape>
             <gradient android:angle="90"
--- a/mobile/android/base/resources/layout/doorhanger.xml
+++ b/mobile/android/base/resources/layout/doorhanger.xml
@@ -30,17 +30,17 @@
               android:orientation="vertical"
               android:gravity="right"
               android:visibility="gone"/>
 
     <CheckBox android:id="@+id/doorhanger_checkbox"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:checked="true"
-              android:textColor="@color/doorhanger_text"
+              android:textColor="@color/placeholder_active_grey"
               android:visibility="gone"/>
 
     <View android:id="@+id/divider_choices"
           android:layout_width="match_parent"
           android:layout_height="1dp"
           android:visibility="gone"/>
 
     <LinearLayout android:id="@+id/doorhanger_choices"
--- a/mobile/android/base/resources/layout/doorhanger_button.xml
+++ b/mobile/android/base/resources/layout/doorhanger_button.xml
@@ -2,11 +2,11 @@
 <!-- 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/. -->
 
 <Button xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:minHeight="48dip"
-        android:textColor="#FF222222"
+        android:textColor="@color/placeholder_active_grey"
         android:textSize="14sp"
         android:background="@drawable/action_bar_button"/>
--- a/mobile/android/base/resources/layout/overlay_share_dialog.xml
+++ b/mobile/android/base/resources/layout/overlay_share_dialog.xml
@@ -43,25 +43,25 @@
             <TextView
                 android:id="@+id/title"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:paddingBottom="7dp"
                 android:ellipsize="end"
                 android:maxLines="2"
                 android:scrollHorizontally="true"
-                android:textColor="@color/text_color_primary"
+                android:textColor="@color/placeholder_active_grey"
                 android:textSize="17sp"/>
 
             <!-- Subtitle (url) -->
             <TextView
                 android:id="@+id/subtitle"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:textColor="@color/text_color_secondary"/>
+                android:textColor="@color/placeholder_grey"/>
 
         </LinearLayout>
 
         <!-- Buttons -->
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:background="@color/overlay_share_background"
--- a/mobile/android/base/resources/layout/overlay_share_toast.xml
+++ b/mobile/android/base/resources/layout/overlay_share_toast.xml
@@ -28,17 +28,17 @@
 
         <!-- Large attractive green tick with label to the right -->
         <TextView
             style="@style/ShareOverlayButton.Text"
             android:id="@+id/overlay_toast_message"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:maxLines="1"
-            android:textColor="@color/text_color_primary"
+            android:textColor="@color/placeholder_active_grey"
             android:textSize="14sp"
             android:drawableLeft="@drawable/overlay_check"/>
 
         <!-- Evil separator -->
         <View
             android:id="@+id/overlay_toast_separator"
             android:layout_marginTop="15dp"
             android:layout_marginBottom="15dp"
--- a/mobile/android/base/resources/layout/site_identity.xml
+++ b/mobile/android/base/resources/layout/site_identity.xml
@@ -24,45 +24,45 @@
         <LinearLayout android:id="@+id/site_identity_known_container"
                       android:layout_width="match_parent"
                       android:layout_height="wrap_content"
                       android:orientation="vertical">
 
             <TextView android:layout_width="wrap_content"
                       android:layout_height="wrap_content"
                       android:textSize="14sp"
-                      android:textColor="@color/doorhanger_text"
+                      android:textColor="@color/placeholder_active_grey"
                       android:text="@string/identity_connected_to"/>
 
             <TextView android:id="@+id/host"
                       android:layout_width="wrap_content"
                       android:layout_height="wrap_content"
                       android:textSize="20sp"
-                      android:textColor="@color/doorhanger_text"
+                      android:textColor="@color/placeholder_active_grey"
                       android:textStyle="bold"/>
 
             <TextView android:id="@+id/owner_label"
                       android:layout_width="wrap_content"
                       android:layout_height="wrap_content"
                       android:textSize="14sp"
-                      android:textColor="@color/doorhanger_text"
+                      android:textColor="@color/placeholder_active_grey"
                       android:text="@string/identity_run_by"
                       android:paddingTop="12dip"/>
 
             <TextView android:id="@+id/owner"
                       android:layout_width="wrap_content"
                       android:layout_height="wrap_content"
-                      android:textColor="@color/doorhanger_text"
+                      android:textColor="@color/placeholder_active_grey"
                       android:textSize="16sp"
                       android:textStyle="bold"/>
 
             <TextView android:id="@+id/verifier"
                       android:layout_width="wrap_content"
                       android:layout_height="wrap_content"
                       android:textSize="14sp"
-                      android:textColor="@color/doorhanger_text"
+                      android:textColor="@color/placeholder_active_grey"
                       android:paddingTop="12dip"/>
 
         </LinearLayout>
 
      </FrameLayout>
 
 </LinearLayout>
--- a/mobile/android/base/resources/layout/site_identity_unknown.xml
+++ b/mobile/android/base/resources/layout/site_identity_unknown.xml
@@ -8,19 +8,19 @@
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:orientation="vertical"
               android:visibility="gone">
 
     <TextView android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:textSize="14sp"
-              android:textColor="@color/doorhanger_text"
+              android:textColor="@color/placeholder_active_grey"
               android:text="@string/identity_no_info"/>
 
     <TextView android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:textSize="14sp"
-              android:textColor="@color/doorhanger_text"
+              android:textColor="@color/placeholder_active_grey"
               android:text="@string/identity_not_encrypted"
               android:paddingTop="12dip"/>
 
 </LinearLayout>
--- a/mobile/android/base/resources/layout/suggestion_item.xml
+++ b/mobile/android/base/resources/layout/suggestion_item.xml
@@ -16,14 +16,14 @@
                android:src="@drawable/suggestion_item_search"
                android:layout_marginRight="3dip"
                android:layout_width="16dip"
                android:layout_height="16dip"/>
 
     <TextView android:id="@+id/suggestion_text"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
-              android:textColor="#222222"
+              android:textColor="@color/placeholder_active_grey"
               android:textSize="14sp"
               android:gravity="center_vertical"
               android:layout_gravity="center_vertical"/>
 
 </LinearLayout>
--- a/mobile/android/base/resources/layout/tabs_item_cell.xml
+++ b/mobile/android/base/resources/layout/tabs_item_cell.xml
@@ -35,17 +35,17 @@
 
             <TextView android:id="@+id/title"
                       android:layout_width="0dip"
                       android:layout_height="wrap_content"
                       android:layout_weight="1.0"
                       android:padding="4dip"
                       style="@style/TabLayoutItemTextAppearance"
                       android:textSize="12sp"
-                      android:textColor="#FF222222"
+                      android:textColor="@color/placeholder_active_grey"
                       android:singleLine="true"
                       android:duplicateParentState="true"/>
 
             <ImageButton android:id="@+id/close"
                          style="@style/TabsItemClose"
                          android:layout_width="32dip"
                          android:layout_height="match_parent"
                          android:background="@drawable/action_bar_button_inverse"
--- a/mobile/android/base/resources/values-v16/search_styles.xml
+++ b/mobile/android/base/resources/values-v16/search_styles.xml
@@ -6,14 +6,14 @@
 
     <style name="TextAppearance.EmptyView.Title" parent="@android:style/TextAppearance.Small">
         <item name="android:textColor">#363B40</item>
         <item name="android:textSize">20sp</item>
         <item name="android:fontFamily">sans-serif-light</item>
     </style>
 
     <style name="TextAppearance.EmptyView.Message" parent="@android:style/TextAppearance.Small">
-        <item name="android:textColor">#777777</item>
+        <item name="android:textColor">@color/placeholder_grey</item>
         <item name="android:textSize">16sp</item>
         <item name="android:lineSpacingExtra">4sp</item>
     </style>
 
 </resources>
--- a/mobile/android/base/resources/values/colors.xml
+++ b/mobile/android/base/resources/values/colors.xml
@@ -46,17 +46,16 @@
   <color name="new_tablet_highlight_lwt">#AAD7D7DC</color>
 
   <!-- If you update one, update the other. -->
   <color name="new_tablet_highlight_dark">#45494E</color>
   <color name="new_tablet_highlight_dark_lwt">#AA45494E</color>
 
   <!-- (bug 1077195) Focused state values are temporary. -->
   <color name="new_tablet_highlight_focused">#C0C9D0</color>
-  <color name="new_tablet_highlight_pb">#222222</color>
   <color name="new_tablet_highlight_focused_pb">#363B40</color>
 
   <!-- highlight on shaped button: 20% white over background_tabs -->
   <color name="highlight_shaped">#FF696D71</color>
 
   <!-- highlight-focused on shaped button: 10% white over background_tabs -->
   <color name="highlight_shaped_focused">#FF565B60</color>
 
@@ -65,25 +64,21 @@
 
   <!-- highlight-focused on private nav button: 10% white over background_private -->
   <color name="highlight_nav_focused_pb">#FF3F423F</color>
 
   <!-- Firstrun tour-->
   <color name="firstrun_background">#99000000</color>
   <color name="firstrun_tabstrip">#1193CB</color>
   <color name="firstrun_pager_background">#16A3DF</color>
-  <color name="firstrun_pager_button">#E66000</color>
-  <color name="firstrun_pager_button_pressed">#DC5600</color>
 
   <!--
       Application theme colors
   -->
   <!-- Default colors -->
-  <color name="text_color_primary">#222222</color>
-  <color name="text_color_secondary">#777777</color>
   <color name="text_color_tertiary">#9198A1</color>
 
   <!-- Default inverse colors -->
   <color name="text_color_primary_inverse">#F5F5F5</color>
   <color name="text_color_secondary_inverse">#DDDDDD</color>
   <color name="text_color_tertiary_inverse">#A4A7A9</color>
 
   <!-- Colour used for share overlay button labels -->
@@ -114,17 +109,16 @@
   <color name="divider_light">#FFD7D9DB</color>
   <color name="divider_dark">#FFB3C2CE</color>
 
   <color name="splash_background">#000000</color>
   <color name="splash_msgfont">#ffffff</color>
   <color name="splash_urlfont">#000000</color>
   <color name="splash_content">#ffffff</color>
 
-  <color name="doorhanger_text">#FF222222</color>
   <color name="doorhanger_link">#FF2AA1FE</color>
   <color name="doorhanger_background_dark">#FFDDE4EA</color>
 
   <color name="validation_message_text">#ffffff</color>
   <color name="url_bar_text_highlight_pb">#FFD06BFF</color>
   <color name="suggestion_primary">#dddddd</color>
   <color name="suggestion_pressed">#bbbbbb</color>
   <color name="tab_row_pressed">#4D000000</color>
@@ -141,33 +135,31 @@
   <color name="url_bar_shadow">#12000000</color>
 
   <color name="nav_button_border_color">#BFBFBF</color>
   <color name="nav_button_border_color_private">#5F6368</color>
 
   <color name="home_button_bar_bg">#FFF5F7F9</color>
 
   <!-- Colour used for share overlay button labels -->
-  <color name="home_text_color">@color/text_color_primary</color>
   <color name="home_text_color_disabled">#AFB1B3</color>
 
   <color name="panel_image_item_background">#D1D9E1</color>
 
   <!-- Swipe to refresh colors for dynamic panel -->
   <color name="swipe_refresh_orange">#FFFFC26C</color>
   <color name="swipe_refresh_white">#FFFFFFFF</color>
 
   <!-- Swipe to refresh colors for remote tabs -->
   <color name="swipe_refresh_orange1">#EE6700</color>
   <color name="swipe_refresh_orange2">#FF9400</color>
   <color name="swipe_refresh_orange3">#F57900</color>
   <color name="swipe_refresh_orange4">#FFB44C</color>
 
   <!-- Remote tabs setup -->
-  <color name="remote_tabs_setup_button_background">#E66000</color>
   <color name="remote_tabs_setup_button_background_hit">#D95300</color>
 
   <!-- Button toast colors. -->
   <color name="toast_background">#DD363B40</color>
   <color name="toast_button_background">#00000000</color>
   <color name="toast_button_pressed">#DD2C3136</color>
   <color name="toast_button_text">#FFFFFFFF</color>
 
--- a/mobile/android/base/resources/values/dimens.xml
+++ b/mobile/android/base/resources/values/dimens.xml
@@ -159,19 +159,16 @@
 
     <!-- Icon Grid -->
     <dimen name="icongrid_columnwidth">128dp</dimen>
     <dimen name="icongrid_padding">16dp</dimen>
 
     <!-- PanelGridView dimensions -->
     <dimen name="panel_grid_view_column_width">150dp</dimen>
 
-    <!-- TabsGridView dimensions -->
-    <dimen name="tabs_grid_view_column_width">200dp</dimen>
-
     <!-- PanelItemView dimensions -->
     <dimen name="panel_article_item_height">95dp</dimen>
 
     <!-- Button toast dimenstions. -->
     <dimen name="toast_button_corner_radius">2dp</dimen>
 
     <!-- ArrowPopup dimensions. -->
     <dimen name="arrow_popup_arrow_width">40dip</dimen>
--- a/mobile/android/base/resources/values/search_styles.xml
+++ b/mobile/android/base/resources/values/search_styles.xml
@@ -28,13 +28,13 @@
     </style>
 
     <style name="TextAppearance.EmptyView.Title" parent="@android:style/TextAppearance.Small">
         <item name="android:textColor">#363B40</item>
         <item name="android:textSize">20sp</item>
     </style>
 
     <style name="TextAppearance.EmptyView.Message" parent="@android:style/TextAppearance.Small">
-        <item name="android:textColor">#777777</item>
+        <item name="android:textColor">@color/placeholder_grey</item>
         <item name="android:textSize">16sp</item>
     </style>
 
 </resources>
--- a/mobile/android/base/resources/values/styles.xml
+++ b/mobile/android/base/resources/values/styles.xml
@@ -193,19 +193,21 @@
         <item name="android:verticalSpacing">2dp</item>
         <item name="android:drawSelectorOnTop">true</item>
     </style>
 
     <style name="Widget.TabsGridLayout" parent="Widget.GridView">
         <item name="android:layout_width">match_parent</item>
         <item name="android:layout_height">match_parent</item>
         <item name="android:paddingTop">0dp</item>
-        <item name="android:stretchMode">columnWidth</item>
+        <item name="android:stretchMode">spacingWidth</item>
+        <item name="android:scrollbarStyle">outsideOverlay</item>
+        <item name="android:gravity">center</item>
         <item name="android:numColumns">auto_fit</item>
-        <item name="android:columnWidth">@dimen/tabs_grid_view_column_width</item>
+        <item name="android:columnWidth">@dimen/new_tablet_tab_panel_column_width</item>
         <item name="android:horizontalSpacing">2dp</item>
         <item name="android:verticalSpacing">@dimen/new_tablet_tab_panel_grid_vspacing</item>
         <item name="android:drawSelectorOnTop">true</item>
         <item name="android:clipToPadding">false</item>
     </style>
 
     <style name="Widget.BookmarkItemView" parent="Widget.TwoLinePageRow"/>
 
@@ -273,17 +275,17 @@
         <item name="android:textColor">#000000</item>
         <item name="android:gravity">center</item>
     </style>
 
     <style name="Widget.Firstrun.Button" parent="Widget.BaseButton">
         <item name="android:layout_width">@dimen/firstrun_content_width</item>
         <item name="android:layout_height">60dp</item>
         <item name="android:textColor">@color/android:white</item>
-        <item name="android:background">@color/firstrun_pager_button</item>
+        <item name="android:background">@color/action_orange</item>
         <item name="android:textSize">18sp</item>
     </style>
 
     <!--
         TextAppearance
         Note: Gecko uses light theme as default, while Android uses dark.
         If Android convention has to be followd, the list of colors specified 
         in themes.xml would be inverse, and things would get confusing.
@@ -407,22 +409,22 @@
         <item name="android:textColor">#AFB1B3</item>
     </style>
 
     <style name="TextAppearance.Widget.HomeBanner" parent="TextAppearance.Small">
         <item name="android:textColor">?android:attr/textColorHint</item>
     </style>
 
     <style name="TextAppearance.Widget.DoorHanger.Medium" parent="TextAppearance.Medium">
-        <item name="android:textColor">@color/doorhanger_text</item>
+        <item name="android:textColor">@color/placeholder_active_grey</item>
         <item name="android:textColorLink">@color/doorhanger_link</item>
     </style>
 
     <style name="TextAppearance.Widget.DoorHanger.Small" parent="TextAppearance.Small">
-        <item name="android:textColor">@color/doorhanger_text</item>
+        <item name="android:textColor">@color/placeholder_active_grey</item>
         <item name="android:textColorLink">@color/doorhanger_link</item>
     </style>
 
     <style name="TextAppearance.UrlBar.Title" parent="TextAppearance.Small">
         <item name="android:textSize">15sp</item>
     </style>
 
     <!-- BrowserToolbar -->
@@ -650,17 +652,17 @@
     </style>
 
     <style name="WebView.Titlebar">
         <item name="android:background">@drawable/webapp_titlebar_bg</item>
         <item name="android:padding">2dp</item>
     </style>
 
     <style name="WebView.Titlebar.Title">
-        <item name="android:textColor">#ff222222</item>
+        <item name="android:textColor">@color/placeholder_active_grey</item>
     </style>
 
     <style name="GeckoDialogTitle">
         <item name="android:textAppearance">@android:style/TextAppearance.DialogWindowTitle</item>
     </style>
 
     <style name="GeckoDialogTitle.SubTitle" />
 
@@ -770,17 +772,17 @@
         <item name="android:scaleType">center</item>
         <item name="android:src">@drawable/menu_light</item>
         <item name="android:contentDescription">@string/actionbar_menu</item>
         <item name="android:background">@android:color/transparent</item>
     </style>
 
     <style name="GeckoActionBar.Buttons">
         <item name="android:background">@android:color/transparent</item>
-        <item name="android:textColor">@color/text_color_primary</item>
+        <item name="android:textColor">@color/placeholder_active_grey</item>
         <item name="android:gravity">right</item>
     </style>
 
     <style name="ShareOverlayButton">
         <item name="android:layout_width">match_parent</item>
         <item name="android:layout_height">wrap_content</item>
         <item name="android:minHeight">60dp</item>
         <item name="android:gravity">center_vertical</item>
@@ -829,23 +831,23 @@
 
     <style name="TextAppearance.FirstrunLight.Main">
         <item name="android:textSize">20sp</item>
         <item name="android:textColor">#363B40</item>
     </style>
 
     <style name="TextAppearance.FirstrunRegular.Body">
         <item name="android:textSize">16sp</item>
-        <item name="android:textColor">#777777</item>
+        <item name="android:textColor">@color/placeholder_grey</item>
         <item name="android:lineSpacingMultiplier">1.25</item>
     </style>
 
     <style name="TextAppearance.FirstrunRegular.Link">
         <item name="android:textSize">16sp</item>
-        <item name="android:textColor">#0096DD</item>
+        <item name="android:textColor">@color/link_blue</item>
     </style>
 
     <!-- Remote Tabs home panel -->
     <style name="RemoteTabsPanelFrame">
         <item name="android:paddingLeft">32dp</item>
         <item name="android:paddingRight">32dp</item>
         <item name="android:paddingTop">@dimen/home_remote_tabs_top_padding</item>
         <item name="android:orientation">vertical</item>
@@ -857,25 +859,25 @@
     <style name="RemoteTabsPanelItem">
         <item name="android:layout_gravity">center</item>
         <item name="android:gravity">center</item>
         <item name="android:layout_marginBottom">16dp</item>
         <item name="android:maxWidth">320dp</item>
     </style>
 
     <style name="RemoteTabsPanelItem.TextAppearance">
-        <item name="android:textColor">#777777</item>
+        <item name="android:textColor">@color/placeholder_grey</item>
         <item name="android:textSize">16sp</item>
         <item name="android:lineSpacingMultiplier">1.25</item>
         <item name="android:layout_marginLeft">8dp</item>
         <item name="android:layout_marginRight">8dp</item>
     </style>
 
     <style name="RemoteTabsPanelItem.TextAppearance.Header">
-        <item name="android:textColor">#222222</item>
+        <item name="android:textColor">@color/placeholder_active_grey</item>
         <item name="android:textSize">20sp</item>
         <item name="android:layout_marginBottom">8dp</item>
     </style>
 
     <style name="RemoteTabsPanelItem.TextAppearance.Linkified">
         <item name="android:clickable">true</item>
         <item name="android:focusable">true</item>
         <item name="android:textColor">#0092DB</item>
--- a/mobile/android/base/sync/ExtendedJSONObject.java
+++ b/mobile/android/base/sync/ExtendedJSONObject.java
@@ -168,16 +168,47 @@ public class ExtendedJSONObject {
   public ExtendedJSONObject() {
     this.object = new JSONObject();
   }
 
   public ExtendedJSONObject(JSONObject o) {
     this.object = o;
   }
 
+  public ExtendedJSONObject deepCopy() {
+    final ExtendedJSONObject out = new ExtendedJSONObject();
+    @SuppressWarnings("unchecked")
+    final Set<Map.Entry<String, Object>> entries = this.object.entrySet();
+    for (Map.Entry<String, Object> entry : entries) {
+      final String key = entry.getKey();
+      final Object value = entry.getValue();
+      if (value instanceof JSONArray) {
+        // Oh god.
+        try {
+          out.put(key, new JSONParser().parse(((JSONArray) value).toJSONString()));
+        } catch (ParseException e) {
+          // This should never occur, because we're round-tripping.
+        }
+        continue;
+      }
+      if (value instanceof JSONObject) {
+        out.put(key, new ExtendedJSONObject((JSONObject) value).deepCopy().object);
+        continue;
+      }
+      if (value instanceof ExtendedJSONObject) {
+        out.put(key, ((ExtendedJSONObject) value).deepCopy());
+        continue;
+      }
+      // Oh well.
+      out.put(key, value);
+    }
+
+    return out;
+  }
+
   public ExtendedJSONObject(Reader in) throws IOException, ParseException, NonObjectJSONException {
     if (in == null) {
       this.object = new JSONObject();
       return;
     }
 
     Object obj = parseRaw(in);
     if (obj instanceof JSONObject) {
@@ -186,21 +217,38 @@ public class ExtendedJSONObject {
       throw new NonObjectJSONException("value must be a JSON object");
     }
   }
 
   public ExtendedJSONObject(String jsonString) throws IOException, ParseException, NonObjectJSONException {
     this(jsonString == null ? null : new StringReader(jsonString));
   }
 
+  @Override
+  public ExtendedJSONObject clone() {
+    return new ExtendedJSONObject((JSONObject) this.object.clone());
+  }
+
   // Passthrough methods.
   public Object get(String key) {
     return this.object.get(key);
   }
 
+  public long getLong(String key, long def) {
+    if (!object.containsKey(key)) {
+      return def;
+    }
+
+    Long val = getLong(key);
+    if (val == null) {
+      return def;
+    }
+    return val.longValue();
+  }
+
   public Long getLong(String key) {
     return (Long) this.get(key);
   }
 
   public String getString(String key) {
     return (String) this.get(key);
   }
 
@@ -299,17 +347,17 @@ public class ExtendedJSONObject {
       return null;
     }
     if (o instanceof ExtendedJSONObject) {
       return (ExtendedJSONObject) o;
     }
     if (o instanceof JSONObject) {
       return new ExtendedJSONObject((JSONObject) o);
     }
-    throw new NonObjectJSONException("key must be a JSON object: " + key);
+    throw new NonObjectJSONException("value must be a JSON object for key: " + key);
   }
 
   @SuppressWarnings("unchecked")
   public Set<Entry<String, Object>> entrySet() {
     return this.object.entrySet();
   }
 
   @SuppressWarnings("unchecked")
--- a/mobile/android/base/sync/net/BaseResource.java
+++ b/mobile/android/base/sync/net/BaseResource.java
@@ -344,35 +344,35 @@ public class BaseResource implements Res
   @Override
   public void put(HttpEntity body) {
     Logger.debug(LOG_TAG, "HTTP PUT " + this.uri.toASCIIString());
     HttpPut request = new HttpPut(this.uri);
     request.setEntity(body);
     this.go(request);
   }
 
-  protected static StringEntity stringEntityWithContentTypeApplicationJSON(String s) throws UnsupportedEncodingException {
+  protected static StringEntity stringEntityWithContentTypeApplicationJSON(String s) {
     StringEntity e = new StringEntity(s, "UTF-8");
     e.setContentType("application/json");
     return e;
   }
 
   /**
    * Helper for turning a JSON object into a payload.
    * @throws UnsupportedEncodingException
    */
-  protected static StringEntity jsonEntity(JSONObject body) throws UnsupportedEncodingException {
+  protected static StringEntity jsonEntity(JSONObject body) {
     return stringEntityWithContentTypeApplicationJSON(body.toJSONString());
   }
 
   /**
    * Helper for turning an extended JSON object into a payload.
    * @throws UnsupportedEncodingException
    */
-  protected static StringEntity jsonEntity(ExtendedJSONObject body) throws UnsupportedEncodingException {
+  protected static StringEntity jsonEntity(ExtendedJSONObject body) {
     return stringEntityWithContentTypeApplicationJSON(body.toJSONString());
   }
 
   /**
    * Helper for turning a JSON array into a payload.
    * @throws UnsupportedEncodingException
    */
   protected static HttpEntity jsonEntity(JSONArray toPOST) throws UnsupportedEncodingException {
@@ -451,16 +451,16 @@ public class BaseResource implements Res
   public void post(JSONArray jsonArray) throws UnsupportedEncodingException {
     post(jsonEntity(jsonArray));
   }
 
   public void put(JSONObject jsonObject) throws UnsupportedEncodingException {
     put(jsonEntity(jsonObject));
   }
 
-  public void post(ExtendedJSONObject o) throws UnsupportedEncodingException {
+  public void post(ExtendedJSONObject o) {
     post(jsonEntity(o));
   }
 
   public void post(JSONObject jsonObject) throws UnsupportedEncodingException {
     post(jsonEntity(jsonObject));
   }
 }
--- a/mobile/android/base/sync/repositories/android/RepoUtils.java
+++ b/mobile/android/base/sync/repositories/android/RepoUtils.java
@@ -254,22 +254,37 @@ public class RepoUtils {
     Logger.debug(LOG_TAG, "Query timer: " + methodCallingQuery + " took " + elapsedTime + "ms.");
   }
 
   public static boolean stringsEqual(String a, String b) {
     // Check for nulls
     if (a == b) return true;
     if (a == null && b != null) return false;
     if (a != null && b == null) return false;
-    
+
     return a.equals(b);
   }
 
+  public static String computeSQLLongInClause(long[] items, String field) {
+    final StringBuilder builder = new StringBuilder(field);
+    builder.append(" IN (");
+    int i = 0;
+    for (; i < items.length - 1; ++i) {
+      builder.append(items[i]);
+      builder.append(", ");
+    }
+    if (i < items.length) {
+      builder.append(items[i]);
+    }
+    builder.append(")");
+    return builder.toString();
+  }
+
   public static String computeSQLInClause(int items, String field) {
-    StringBuilder builder = new StringBuilder(field);
+    final StringBuilder builder = new StringBuilder(field);
     builder.append(" IN (");
     int i = 0;
     for (; i < items - 1; ++i) {
       builder.append("?, ");
     }
     if (i < items) {
       builder.append("?");
     }
--- a/mobile/android/base/tabs/TabsGridLayout.java
+++ b/mobile/android/base/tabs/TabsGridLayout.java
@@ -74,28 +74,22 @@ class TabsGridLayout extends GridView
         setRecyclerListener(new RecyclerListener() {
             @Override
             public void onMovedToScrapHeap(View view) {
                 TabsLayoutItemView item = (TabsLayoutItemView) view;
                 item.setThumbnail(null);
             }
         });
 
-        setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
-        setStretchMode(GridView.STRETCH_SPACING);
-        setGravity(Gravity.CENTER);
-        setNumColumns(GridView.AUTO_FIT);
-
         // The clipToPadding setting in the styles.xml doesn't seem to be working (bug 1101784)
         // so lets set it manually in code for the moment as it's needed for the padding animation
         setClipToPadding(false);
 
         final Resources resources = getResources();
         mColumnWidth = resources.getDimensionPixelSize(R.dimen.new_tablet_tab_panel_column_width);
-        setColumnWidth(mColumnWidth);
 
         final int padding = resources.getDimensionPixelSize(R.dimen.new_tablet_tab_panel_grid_padding);
         final int paddingTop = resources.getDimensionPixelSize(R.dimen.new_tablet_tab_panel_grid_padding_top);
 
         // Lets set double the top padding on the bottom so that the last row shows up properly!
         // Your demise, GridView, cannot come fast enough.
         final int paddingBottom = paddingTop * 2;
 
--- a/mobile/android/base/toolbar/NavButton.java
+++ b/mobile/android/base/toolbar/NavButton.java
@@ -64,17 +64,17 @@ abstract class NavButton extends ShapedB
         final Drawable drawable = BrowserToolbar.getLightweightThemeDrawable(this, getResources(),
                 getTheme(), R.color.background_normal);
 
         if (drawable == null) {
             return;
         }
 
         final StateListDrawable stateList = new StateListDrawable();
-        stateList.addState(PRIVATE_PRESSED_STATE_SET, getColorDrawable(R.color.new_tablet_highlight_pb));
+        stateList.addState(PRIVATE_PRESSED_STATE_SET, getColorDrawable(R.color.placeholder_active_grey));
         stateList.addState(PRESSED_ENABLED_STATE_SET, getColorDrawable(R.color.new_tablet_highlight));
         stateList.addState(PRIVATE_FOCUSED_STATE_SET, getColorDrawable(R.color.new_tablet_highlight_focused_pb));
         stateList.addState(FOCUSED_STATE_SET, getColorDrawable(R.color.new_tablet_highlight_focused));
         stateList.addState(PRIVATE_STATE_SET, getColorDrawable(R.color.background_private));
         stateList.addState(EMPTY_STATE_SET, drawable);
 
         setBackgroundDrawable(stateList);
     }
--- a/mobile/android/chrome/content/SelectHelper.js
+++ b/mobile/android/chrome/content/SelectHelper.js
@@ -8,17 +8,17 @@ var SelectHelper = {
 
   handleEvent: function(aEvent) {
     this.handleClick(aEvent.target);
   },
 
   handleClick: function(aTarget) {
     // if we're busy looking at a select we want to eat any clicks that
     // come to us, but not to process them
-    if (this._uiBusy || !this._isMenu(aTarget) || aTarget.disabled)
+    if (this._uiBusy || !this._isMenu(aTarget) || this._isDisabledElement(aTarget))
         return;
 
     this._uiBusy = true;
     this.show(aTarget);
     this._uiBusy = false;
   },
 
   show: function(aElement) {
@@ -129,10 +129,21 @@ var SelectHelper = {
   fireOnCommand: function(aElement) {
     let evt = aElement.ownerDocument.createEvent("XULCommandEvent");
     evt.initCommandEvent("command", true, true, aElement.defaultView, 0,
                   false, false,
                   false, false, null);
     setTimeout(function() {
       aElement.dispatchEvent(evt);
     }, 0);
+  },
+
+  _isDisabledElement : function(aElement) {
+    let currentElement = aElement;
+    while (currentElement) {
+      if (currentElement.disabled)
+	return true;
+
+      currentElement = currentElement.parentElement;
+    }
+    return false;
   }
 };
--- a/toolkit/components/reader/AboutReader.jsm
+++ b/toolkit/components/reader/AboutReader.jsm
@@ -56,19 +56,26 @@ let AboutReader = function(mm, win) {
   win.addEventListener("unload", this, false);
   win.addEventListener("scroll", this, false);
   win.addEventListener("resize", this, false);
 
   doc.addEventListener("visibilitychange", this, false);
 
   this._setupStyleDropdown();
   this._setupButton("close-button", this._onReaderClose.bind(this), "aboutReader.toolbar.close");
-  this._setupButton("toggle-button", this._onReaderToggle.bind(this), "aboutReader.toolbar.addToReadingList");
   this._setupButton("share-button", this._onShare.bind(this), "aboutReader.toolbar.share");
-  this._setupButton("list-button", this._onList.bind(this), "aboutReader.toolbar.openReadingList");
+
+  try {
+    if (Services.prefs.getBoolPref("browser.readinglist.enabled")) {
+      this._setupButton("toggle-button", this._onReaderToggle.bind(this), "aboutReader.toolbar.addToReadingList");
+      this._setupButton("list-button", this._onList.bind(this), "aboutReader.toolbar.openReadingList");
+    }
+  } catch (e) {
+    // Pref doesn't exist.
+  }
 
   let colorSchemeValues = JSON.parse(Services.prefs.getCharPref("reader.color_scheme.values"));
   let colorSchemeOptions = colorSchemeValues.map((value) => {
     return { name: gStrings.GetStringFromName("aboutReader.colorScheme." + value),
              value: value,
              itemClass: value + "-button" };
   });
 
@@ -792,16 +799,17 @@ AboutReader.prototype = {
         item.classList.add("selected");
     }
   },
 
   _setupButton: function(id, callback, titleEntity) {
     this._setButtonTip(id, titleEntity);
 
     let button = this._doc.getElementById(id);
+    button.removeAttribute("hidden");
     button.addEventListener("click", function(aEvent) {
       if (!aEvent.isTrusted)
         return;
 
       aEvent.stopPropagation();
       callback();
     }, true);
   },
--- a/toolkit/components/reader/content/aboutReader.html
+++ b/toolkit/components/reader/content/aboutReader.html
@@ -36,15 +36,15 @@
           <button id="font-size-minus" class="minus-button"/>
           <button id="font-size-plus" class="plus-button"/>
         </div>
         <hr></hr>
         <ul id="color-scheme-buttons" class="segmented-button"></ul>
         <div class="dropdown-arrow"/>
       </li>
     </ul>
-    <li><button id="toggle-button" class="button toggle-button"/></li>
-    <li><button id="list-button" class="button list-button"/></li>
+    <li><button id="toggle-button" class="button toggle-button" hidden="true"/></li>
+    <li><button id="list-button" class="button list-button" hidden="true"/></li>
   </ul>
 
 </body>
 
 </html>
--- a/toolkit/content/widgets/videocontrols.xml
+++ b/toolkit/content/widgets/videocontrols.xml
@@ -99,16 +99,17 @@
       </property>
 
       <constructor>
           <![CDATA[
           this.scrubberNameFormat = ]]>"&scrubberScale.nameFormat;"<![CDATA[;
           this.durationValue = "";
           this.valueBar = null;
           this.isDragging = false;
+          this.isDraggingComplete = true;
           this.wasPausedBeforeDrag = true;
 
           this.thumb = document.getAnonymousElementByAttribute(this, "class", "scale-thumb");
           this.type = this.getAttribute("class");
           this.Utils = document.getBindingParent(this.parentNode).Utils;
           if (this.type == "scrubber")
               this.valueBar = this.Utils.progressBar;
           ]]>
@@ -168,22 +169,26 @@
         <parameter name="isDragging"/>
           <body>
           <![CDATA[
             if (this.type == "scrubber") {
                 this.Utils.log("--- dragStateChanged: " + isDragging + " ---");
                 this.isDragging = isDragging;
                 if (isDragging) {
                     this.wasPausedBeforeDrag = this.Utils.video.paused;
+                    this.isDraggingComplete = false;
                     this.previousPlaybackRate = this.Utils.video.playbackRate;
                     this.Utils.video.pause();
-                } else if (!this.wasPausedBeforeDrag) {
+                } else if (!this.wasPausedBeforeDrag && !this.isDraggingComplete) {
+                    this.isDraggingComplete = true;
                     // After the drag ends, resume playing.
                     this.Utils.video.playbackRate = this.previousPlaybackRate;
                     this.Utils.video.play();
+                } else {
+                    this.isDraggingComplete = true;
                 }
             }
           ]]>
           </body>
       </method>
 
       </implementation>
   </binding>
@@ -1003,16 +1008,17 @@
                         return;
 
                     var element = event.originalTarget;
 
                     // Nothing to do when a fade *in* finishes.
                     if (!element.hasAttribute("fadeout"))
                         return;
 
+                    this.scrubber.dragStateChanged(false);
                     element.hidden = true;
                 },
 
                 _triggeredByControls: false,
 
                 togglePause : function () {
                     if (this.video.paused || this.video.ended) {
                         this._triggeredByControls = true;
--- a/toolkit/devtools/server/actors/script.js
+++ b/toolkit/devtools/server/actors/script.js
@@ -2840,21 +2840,28 @@ SourceActor.prototype = {
    *        The line number of the breakpoint in the original source.
    * @param Number originalColumn
    *        The column number of the breakpoint in the original source.
    * @param String condition
    *        A condition for the breakpoint.
    */
   setBreakpoint: function (originalLine, originalColumn, condition) {
     let originalLocation = new OriginalLocation(this, originalLine, originalColumn);
+
+    let actor = this.breakpointActorMap.getActor(originalLocation);
+    if (!actor) {
+      actor = new BreakpointActor(this.threadActor, originalLocation);
+      this.threadActor.threadLifetimePool.addActor(actor);
+      this.breakpointActorMap.setActor(originalLocation, actor);
+    }
+
+    actor.condition = condition;
+
     return this.threadActor.sources.getGeneratedLocation(originalLocation)
                                    .then(generatedLocation => {
-      let actor = this._getOrCreateBreakpointActor(originalLocation,
-                                                   generatedLocation,
-                                                   condition);
       return generatedLocation.generatedSourceActor
                               .setBreakpointForActor(actor, generatedLocation);
     });
   },
 
   /*
    * Ensure the given BreakpointActor is set as breakpoint handler on all
    * scripts that match the given generated location.
@@ -4660,34 +4667,28 @@ FrameActor.prototype.requestTypes = {
 
 /**
  * Creates a BreakpointActor. BreakpointActors exist for the lifetime of their
  * containing thread and are responsible for deleting breakpoints, handling
  * breakpoint hits and associating breakpoints with scripts.
  *
  * @param ThreadActor aThreadActor
  *        The parent thread actor that contains this breakpoint.
- * @param OriginalLocation originalLocation
+ * @param OriginalLocation aOriginalLocation
  *        The original location of the breakpoint.
- * @param GeneratedLocation generatedLocation
- *        The generated location of the breakpoint.
- * @param string aCondition
- *        Optional. A condition which, when false, will cause the breakpoint to
- *        be skipped.
  */
-function BreakpointActor(aThreadActor, aOriginalLocation, aGeneratedLocation, aCondition)
+function BreakpointActor(aThreadActor, aOriginalLocation)
 {
   // The set of Debugger.Script instances that this breakpoint has been set
   // upon.
   this.scripts = new Set();
 
   this.threadActor = aThreadActor;
   this.originalLocation = aOriginalLocation;
-  this.generatedLocation = aGeneratedLocation;
-  this.condition = aCondition;
+  this.condition = null;
 }
 
 BreakpointActor.prototype = {
   actorPrefix: "breakpoint",
   condition: null,
 
   hasScript: function (aScript) {
     return this.scripts.has(aScript);
--- a/toolkit/themes/shared/in-content/common.inc.css
+++ b/toolkit/themes/shared/in-content/common.inc.css
@@ -64,17 +64,17 @@ xul|prefpane > xul|*.content-box {
   overflow: visible;
 }
 
 /* groupboxes */
 
 xul|groupbox {
   -moz-appearance: none;
   border: none;
-  margin: 15px 0;
+  margin: 15px 0 0;
   -moz-padding-start: 0;
   -moz-padding-end: 0;
   font-size: 1.25rem;
 }
 
 xul|groupbox xul|label {
   /* !important needed to override toolkit !important rule */
   -moz-margin-start: 0 !important;
--- a/toolkit/themes/windows/global/aboutReader.css
+++ b/toolkit/themes/windows/global/aboutReader.css
@@ -254,16 +254,20 @@ body {
   height: 40px;
   width: 40px;
   border-top: 0;
   border-left: 0;
   border-right: 0;
   border-bottom: 1px solid #c1c1c1;
 }
 
+.button[hidden] {
+  display: none;
+}
+
 .dropdown {
   text-align: center;
   list-style: none;
   margin: 0px;
   padding: 0px;
 }
 
 .dropdown li {