Merge m-c -> e10s.
authorDan Witte <dwitte@mozilla.com>
Sat, 21 Aug 2010 10:21:06 -0700
changeset 51340 a87d3efaaedae983024ddd99ff662dda84ff0793
parent 51339 3c7ac02b55d3bd0b88346892f60c20153a7a9d15 (current diff)
parent 51165 1fb7b57d30266d96ee0da3b9934531dafc5d3fa3 (diff)
child 51341 2d33f06b0c1051e7d76c4722f7682da8ef839bc5
push id15277
push userdwitte@mozilla.com
push dateTue, 24 Aug 2010 04:18:33 +0000
treeherdermozilla-central@49dc8d6901a7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0b5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge m-c -> e10s.
--- a/browser/base/content/browser-menubar.inc
+++ b/browser/base/content/browser-menubar.inc
@@ -507,25 +507,27 @@
                                builder="end"/>
 #ifdef MOZ_SERVICES_SYNC
                 <menuitem id="sync-tabs-menuitem"
                           label="&syncTabsMenu.label;"
                           oncommand="BrowserOpenSyncTabs();"
                           disabled="true"/>
 #endif
                 <menu id="historyUndoMenu"
+                      class="recentlyClosedTabsMenu"
                       label="&historyUndoMenu.label;"
                       disabled="true">
                   <menupopup id="historyUndoPopup"
 #ifndef XP_MACOSX
                              placespopup="true"
 #endif
                              onpopupshowing="document.getElementById('history-menu')._placesView.populateUndoSubmenu();"/>
                 </menu>
                 <menu id="historyUndoWindowMenu"
+                      class="recentlyClosedWindowsMenu"
                       label="&historyUndoWindowMenu.label;"
                       disabled="true">
                   <menupopup id="historyUndoWindowPopup"
 #ifndef XP_MACOSX
                              placespopup="true"
 #endif
                              onpopupshowing="document.getElementById('history-menu')._placesView.populateUndoWindowSubmenu();"/>
                 </menu>
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -571,23 +571,23 @@ function HistoryMenu(aPopupShowingEvent)
                   "place:redirectsMode=2&sort=4&maxResults=10");
 }
 
 HistoryMenu.prototype = {
   __proto__: PlacesMenu.prototype,
 
   toggleRecentlyClosedTabs: function HM_toggleRecentlyClosedTabs() {
     // enable/disable the Recently Closed Tabs sub menu
-    var undoPopup = document.getElementById("historyUndoPopup");
+    var undoMenu = this._rootElt.getElementsByClassName("recentlyClosedTabsMenu")[0];
 
     // no restorable tabs, so disable menu
     if (this._ss.getClosedTabCount(window) == 0)
-      undoPopup.parentNode.setAttribute("disabled", true);
+      undoMenu.setAttribute("disabled", true);
     else
-      undoPopup.parentNode.removeAttribute("disabled");
+      undoMenu.removeAttribute("disabled");
   },
 
   /**
     * Re-open a closed tab and put it to the end of the tab strip.
     * Used for a middle click.
     * @param aEvent
     *        The event when the user clicks the menu item
     */
@@ -598,30 +598,31 @@ HistoryMenu.prototype = {
     undoCloseTab(aEvent.originalTarget.value);
     gBrowser.moveTabToEnd();
   },
 
   /**
    * Populate when the history menu is opened
    */
   populateUndoSubmenu: function PHM_populateUndoSubmenu() {
-    var undoPopup = document.getElementById("historyUndoPopup");
+    var undoMenu = this._rootElt.getElementsByClassName("recentlyClosedTabsMenu")[0];
+    var undoPopup = undoMenu.firstChild;
 
     // remove existing menu items
     while (undoPopup.hasChildNodes())
       undoPopup.removeChild(undoPopup.firstChild);
 
     // no restorable tabs, so make sure menu is disabled, and return
     if (this._ss.getClosedTabCount(window) == 0) {
-      undoPopup.parentNode.setAttribute("disabled", true);
+      undoMenu.setAttribute("disabled", true);
       return;
     }
 
     // enable menu
-    undoPopup.parentNode.removeAttribute("disabled");
+    undoMenu.removeAttribute("disabled");
 
     // populate menu
     var undoItems = eval("(" + this._ss.getClosedTabData(window) + ")");
     for (var i = 0; i < undoItems.length; i++) {
       var m = document.createElement("menuitem");
       m.setAttribute("label", undoItems[i].title);
       if (undoItems[i].image) {
         let iconURL = undoItems[i].image;
@@ -656,46 +657,47 @@ HistoryMenu.prototype = {
     m.addEventListener("command", function() {
       for (var i = 0; i < undoItems.length; i++)
         undoCloseTab();
     }, false);
   },
 
   toggleRecentlyClosedWindows: function PHM_toggleRecentlyClosedWindows() {
     // enable/disable the Recently Closed Windows sub menu
-    let undoPopup = document.getElementById("historyUndoWindowPopup");
+    var undoMenu = this._rootElt.getElementsByClassName("recentlyClosedWindowsMenu")[0];
 
     // no restorable windows, so disable menu
     if (this._ss.getClosedWindowCount() == 0)
-      undoPopup.parentNode.setAttribute("disabled", true);
+      undoMenu.setAttribute("disabled", true);
     else
-      undoPopup.parentNode.removeAttribute("disabled");
+      undoMenu.removeAttribute("disabled");
   },
 
   /**
    * Populate when the history menu is opened
    */
   populateUndoWindowSubmenu: function PHM_populateUndoWindowSubmenu() {
-    let undoPopup = document.getElementById("historyUndoWindowPopup");
+    let undoMenu = this._rootElt.getElementsByClassName("recentlyClosedWindowsMenu")[0];
+    let undoPopup = undoMenu.firstChild;
     let menuLabelString = gNavigatorBundle.getString("menuUndoCloseWindowLabel");
     let menuLabelStringSingleTab =
       gNavigatorBundle.getString("menuUndoCloseWindowSingleTabLabel");
 
     // remove existing menu items
     while (undoPopup.hasChildNodes())
       undoPopup.removeChild(undoPopup.firstChild);
 
     // no restorable windows, so make sure menu is disabled, and return
     if (this._ss.getClosedWindowCount() == 0) {
-      undoPopup.parentNode.setAttribute("disabled", true);
+      undoMenu.setAttribute("disabled", true);
       return;
     }
 
     // enable menu
-    undoPopup.parentNode.removeAttribute("disabled");
+    undoMenu.removeAttribute("disabled");
 
     // populate menu
     let undoItems = JSON.parse(this._ss.getClosedWindowData());
     for (let i = 0; i < undoItems.length; i++) {
       let undoItem = undoItems[i];
       let otherTabsCount = undoItem.tabs.length - 1;
       let label = (otherTabsCount == 0) ? menuLabelStringSingleTab
                                         : PluralForm.get(otherTabsCount, menuLabelString);
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -2599,21 +2599,16 @@ function BrowserOnClick(event) {
           title,
           value,
           "chrome://global/skin/icons/blacklist_favicon.png",
           notificationBox.PRIORITY_CRITICAL_HIGH,
           buttons
         );
       }
     }
-    else if (/^about:privatebrowsing/.test(errorDoc.documentURI)) {
-      if (ot == errorDoc.getElementById("startPrivateBrowsing")) {
-        gPrivateBrowsingUI.toggleMode();
-      }
-    }
 }
 
 /**
  * Re-direct the browser to a known-safe page.  This function is
  * used when, for example, the user browses to a known malware page
  * and is presented with about:blocked.  The "Get me out of here!"
  * button should take the user to the default start page so that even
  * when their own homepage is infected, we can get them somewhere safe.
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -516,17 +516,17 @@
                     label="&savePageCmd.label;"
                     command="Browser:SavePage"/>
           <menuitem id="appmenu_sendLink"
                     label="&sendPageCmd.label;"
                     command="Browser:SendLink"/>
           <hbox flex="1"
                 class="split-menuitem">
             <menuitem id="appmenu_print"
-                      class="menuitem-iconic"
+                      class="menuitem-iconic split-menuitem-item"
                       flex="1"
                       label="&printCmd.label;"
                       command="cmd_print"/>
             <menu class="split-menuitem-menu">
               <menupopup>
                 <menuitem id="appmenu_print_popup"
                           class="menuitem-iconic"
                           label="&printCmd.label;"
@@ -574,106 +574,110 @@
                     label="&quitApplicationCmdWin.label;"
 #else
                     label="&quitApplicationCmd.label;"
 #endif
                     command="cmd_quitApplication"/>
         </vbox>
         <vbox id="appmenuSecondaryPane">
           <hbox class="split-menuitem">
-            <menuitem id="appmenu_BookmarkItem"
-                      class="menuitem-iconic"
+            <menuitem id="appmenu_bookmarks"
+                      class="menuitem-iconic split-menuitem-item"
                       flex="1"
                       label="&bookmarksMenu.label;"
                       command="Browser:ShowAllBookmarks"/>
-            <menu id="appmenuBookmarkMenu"
+            <menu id="appmenu_bookmarksMenu"
                   class="split-menuitem-menu">
-              <menupopup id="appmenuBookmarkMenu_popup"
+              <menupopup id="appmenu_bookmarksMenupopup"
                          placespopup="true"
                          context="placesContext"
                          openInTabs="children"
                          oncommand="BookmarksEventHandler.onCommand(event);"
                          onclick="BookmarksEventHandler.onClick(event);"
                          onpopupshowing="BookmarksMenuButton.onPopupShowing(event);
-                                         if (!this.parentNode._placesView)new PlacesMenu(event, 'place:folder=BOOKMARKS_MENU');
-                                         this.appendChild(document.getElementById('appmenuBookmarkMenu_unsorted_seperator'));
-                                         this.appendChild(document.getElementById('appmenuBookmarkMenu_unsorted-menuitem'));"
+                                         if (!this.parentNode._placesView)
+                                           new PlacesMenu(event, 'place:folder=BOOKMARKS_MENU');
+                                         this.appendChild(document.getElementById('appmenu_unsortedBookmarks_seperator'));
+                                         this.appendChild(document.getElementById('appmenu_unsortedBookmarks'));"
                          tooltip="bhTooltip"
                          popupsinherittooltip="true">
-                <menuseparator id="appmenuBookmarkMenu_unsorted_seperator"/>
-                <menuitem id="appmenuBookmarkMenu_unsorted-menuitem"
+                <menuseparator id="appmenu_unsortedBookmarks_seperator"/>
+                <menuitem id="appmenu_unsortedBookmarks"
                           label="&appMenuUnsorted.label;"
                           oncommand="PlacesCommandHook.showPlacesOrganizer('UnfiledBookmarks');"
                           class="menuitem-iconic"/>
-                <menuitem id="appmenuBookmarkMenu_organize_bookmarks"
+                <menuitem id="appmenu_organizeBookmarks"
                           label="&organizeBookmarks.label;"
                           key="manBookmarkKb"
                           command="Browser:ShowAllBookmarks"
                           context=""/>
                 <menuseparator/>
-                <menuitem id="appmenuBookmarkThisPage"
+                <menuitem id="appmenu_bookmarkThisPage"
                           class="menuitem-iconic"
                           label="&bookmarkThisPageCmd.label;"
                           command="Browser:AddBookmarkAs"
                           key="addBookmarkAsKb"/>
-                <menuitem id="subscribeToPageMenuitem"
+                <menuitem id="appmenu_subscribeToPage"
                           class="menuitem-iconic"
                           label="&subscribeToPageMenuitem.label;"
                           oncommand="return FeedHandler.subscribeToFeed(null, event);"
                           onclick="checkForMiddleClick(this, event);"
                           disabled="true"/>
-                <menu id="subscribeToPageMenupopup"
+                <menu id="appmenu_subscribeToPageMenu"
                       class="menu-iconic"
                       label="&subscribeToPageMenupopup.label;"
                       hidden="true">
-                  <menupopup id="subscribeToPageSubmenuMenupopup"
+                  <menupopup id="appmenu_subscribeToPageMenupopup"
                              onpopupshowing="return FeedHandler.buildFeedList(event.target);"
                              oncommand="return FeedHandler.subscribeToFeed(null, event);"
                              onclick="checkForMiddleClick(this, event);"/>
                 </menu>
                 <menuseparator/>
               </menupopup>
             </menu>
           </hbox>
           <hbox class="split-menuitem">
-            <menuitem id="appmenu_HistoryItem"
-                      class="menuitem-iconic"
+            <menuitem id="appmenu_history"
+                      class="menuitem-iconic split-menuitem-item"
                       flex="1"
                       label="&historyMenu.label;"
                       command="Browser:ShowAllHistory"/>
-            <menu id="appmenu_history"
+            <menu id="appmenu_historyMenu"
                   class="split-menuitem-menu">
-              <menupopup id="appmenu_history_popup"
+              <menupopup id="appmenu_historyMenupopup"
                          placespopup="true"
                          oncommand="this.parentNode._placesView._onCommand(event);"
                          onclick="checkForMiddleClick(this, event);"
-                         onpopupshowing="if (!this.parentNode._placesView) new HistoryMenu(event);"
+                         onpopupshowing="if (!this.parentNode._placesView)
+                                           new HistoryMenu(event);"
                          tooltip="bhTooltip"
                          popupsinherittooltip="true">
                 <menuitem id="appmenu_showAllHistory"
                           label="&showAllHistoryCmd2.label;"
                           key="showAllHistoryKb"
                           command="Browser:ShowAllHistory"/>
                 <menuseparator/>
                 <menuitem id="appmenu_sanitizeHistory"
                           label="&clearRecentHistory.label;"
                           key="key_sanitize"
                           command="Tools:Sanitize"/>
                 <menuseparator class="hide-if-empty-places-result"/>
-                <menu id="historyUndoMenu"
+                <menu id="appmenu_recentlyClosedTabsMenu"
+                      class="recentlyClosedTabsMenu"
                       label="&historyUndoMenu.label;"
                       disabled="true">
-                  <menupopup id="historyUndoPopup"
-                             onpopupshowing="_placesView.populateUndoSubmenu();"/>
+                  <menupopup id="appmenu_recentlyClosedTabsMenupopup"
+                             onpopupshowing="document.getElementById('appmenu_historyMenu')._placesView.populateUndoSubmenu();"/>
                 </menu>
-                <menu id="historyUndoWindowMenu"
+                <menu id="appmenu_recentlyClosedWindowsMenu"
+                      class="recentlyClosedWindowsMenu"
                       label="&historyUndoWindowMenu.label;"
                       disabled="true">
-                  <menupopup id="historyUndoPopup"
-                             onpopupshowing="_placesView.populateUndoWindowSubmenu();"/>
+                  <menupopup id="appmenu_recentlyClosedWindowsMenupopup"
+                             onpopupshowing="document.getElementById('appmenu_historyMenu')._placesView.populateUndoWindowSubmenu();"/>
                 </menu>
                 <menuseparator/>
               </menupopup>
             </menu>
           </hbox>
             <menuitem id="appmenu_downloads"
                       label="&downloads.label;"
                       command="Tools:Downloads"/>
@@ -686,58 +690,58 @@
               <menuitem id="appmenu_customize"
                         label="&preferencesCmd.label;"
                         class="split-menuitem-item"
                         flex="1"
                         oncommand="openPreferences();"/>
               <menu class="split-menuitem-menu"
                     label="&preferencesCmd.label;">
                 <menupopup id="appmenu_customizeMenu"
-                           onpopupshowing="onViewToolbarsPopupShowing(event, (document.getElementById('appmenuToggleStatusbar')));">
+                           onpopupshowing="onViewToolbarsPopupShowing(event, document.getElementById('appmenu_toggleStatusbar'));">
                   <menuitem id="appmenu_preferences"
 #ifdef XP_UNIX
                             label="&preferencesCmdUnix.label;"
 #else
                             label="&preferencesCmd.label;"
 #endif
                             oncommand="openPreferences();"/>
                   <menuseparator/>
-                  <menuitem id="appmenuToggleStatusbar"
+                  <menuitem id="appmenu_toggleStatusbar"
                             type="checkbox"
                             command="cmd_toggleTaskbar"
                             observes="toggle_taskbar"/>
                   <menuseparator/>
-                  <menuitem id="appmenuToggleTabs"
+                  <menuitem id="appmenu_toggleTabsOnTop"
                             label="&viewTabsOnTop.label;"
                             type="checkbox"
                             command="cmd_ToggleTabsOnTop"/>
                   <menuitem id="appmenu_toolbarLayout"
                             label="&appMenuToolbarLayout.label;"
                             command="cmd_CustomizeToolbars"/>
                 </menupopup>
               </menu>
             </hbox>
             <hbox class="split-menuitem">
-              <menuitem id="appmenu_helpItem"
+              <menuitem id="appmenu_help"
+                        class="split-menuitem-item"
                         flex="1"
                         label="&helpMenu.label;"
                         oncommand="openHelpLink('firefox-help')"/>
-              <menu id="appmenu_about_menu"
-                    class="split-menuitem-menu">
-                <menupopup>
+              <menu class="split-menuitem-menu">
+                <menupopup id="appmenu_helpMenupopup">
                   <menuitem id="appmenu_openHelp"
                             label="&helpMenu.label;"
                             oncommand="openHelpLink('firefox-help')"
                             onclick="checkForMiddleClick(this, event);"/>
-                  <menuitem id="appmenu_help_getting_started"
+                  <menuitem id="appmenu_gettingStarted"
                             label="&appMenuGettingStarted.label;"
-                            oncommand="gBrowser.selectedTab = gBrowser.addTab('http://www.mozilla.com/firefox/central/');"
+                            oncommand="gBrowser.loadOneTab('http://www.mozilla.com/firefox/central/', {inBackground: false});"
                             onclick="checkForMiddleClick(this, event);"/>
                   <menuseparator/>
-                  <menuitem id="appmenu_help_about"
+                  <menuitem id="appmenu_about"
                             label="&aboutProduct.label;"
                             oncommand="openAboutDialog();"/>
                 </menupopup>
               </menu>
             </hbox>
         </vbox>
       </hbox>
     </menupopup>
--- a/browser/base/content/test/Makefile.in
+++ b/browser/base/content/test/Makefile.in
@@ -141,16 +141,17 @@ endif
                  browser_bug563588.js \
                  browser_bug577121.js \
                  browser_bug580956.js \
                  browser_bug581242.js \
                  browser_contextSearchTabPosition.js \
                  browser_ctrlTab.js \
                  browser_discovery.js \
                  browser_drag.js \
+                 browser_duplicateIDs.js \
                  browser_gestureSupport.js \
                  browser_getshortcutoruri.js \
                  browser_hide_removing.js \
                  browser_inspector_initialization.js \
                  browser_inspector_treeSelection.js \
                  browser_inspector_highlighter.js \
                  browser_inspector_stylePanel.js \
                  browser_inspector_domPanel.js \
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/browser_duplicateIDs.js
@@ -0,0 +1,8 @@
+function test() {
+  var ids = {};
+  Array.forEach(document.querySelectorAll("[id]"), function (node) {
+    var id = node.id;
+    ok(!(id in ids), id + " should be unique");
+    ids[id] = null;
+  });
+}
--- a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml
+++ b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml
@@ -109,16 +109,20 @@
         // Set up the help link
         let moreInfoURL = Cc["@mozilla.org/toolkit/URLFormatterService;1"].
                           getService(Ci.nsIURLFormatter).
                           formatURLPref("app.support.baseURL");
         let moreInfoLink = document.getElementById("moreInfoLink");
         if (moreInfoLink)
           moreInfoLink.setAttribute("href", moreInfoURL + "private-browsing");
       }, false);
+      
+      function togglePrivateBrowsing() {
+        mainWindow.gPrivateBrowsingUI.toggleMode();
+      }
     ]]></script>
   </head>
 
   <body dir="&locale.dir;"
         class="private">
 
     <!-- PAGE CONTAINER (for styling purposes only) -->
     <div id="errorPageContainer">
@@ -140,19 +144,20 @@
 
         <!-- Long Description -->
         <div id="errorLongDesc">
           <p id="errorLongDescText">&privatebrowsingpage.description;</p>
         </div>
 
         <!-- Start Private Browsing -->
         <div id="startPrivateBrowsingDesc" class="showNormal">
-          <button id="startPrivateBrowsing"
+          <button xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+                  id="startPrivateBrowsing" label="&privatebrowsingpage.startPrivateBrowsing.label;"
                   accesskey="&privatebrowsingpage.startPrivateBrowsing.accesskey;"
-                  >&privatebrowsingpage.startPrivateBrowsing.label;</button>
+                  oncommand="togglePrivateBrowsing();"/>
         </div>
 
         <!-- Footer -->
         <div id="footerDesc">
           <p id="footerText" class="showPrivate">&privatebrowsingpage.howToStop;</p>
           <p id="footerTextNormal" class="showNormal">&privatebrowsingpage.howToStart;</p>
         </div>
 
--- a/browser/locales/en-US/chrome/overrides/netError.dtd
+++ b/browser/locales/en-US/chrome/overrides/netError.dtd
@@ -165,19 +165,19 @@ be temporary, and you can try again late
 
 <!ENTITY cspFrameAncestorBlocked.title "Blocked by Content Security Policy">
 <!ENTITY cspFrameAncestorBlocked.longDesc "<p>&brandShortName; prevented this page from loading in this way because the page has a content security policy that disallows it.</p>">
 
 <!ENTITY securityOverride.linkText "Or you can add an exception…">
 <!ENTITY securityOverride.getMeOutOfHereButton "Get me out of here!">
 <!ENTITY securityOverride.exceptionButtonLabel "Add Exception…">
 
-<!-- LOCALIZATION NOTE (securityOverride.warningText) - Do not translate the
-contents of the <xul:button> tags.  The only language content is the label= field,
-which uses strings already defined above. The button is included here (instead of
-netError.xhtml) because it exposes functionality specific to firefox. -->
+<!-- LOCALIZATION NOTE (securityOverride.warningContent) - Do not translate the
+contents of the <button> tags. It uses strings already defined above. The
+button is included here (instead of netError.xhtml) because it exposes
+functionality specific to firefox. -->
 
-<!ENTITY securityOverride.warningText "
+<!ENTITY securityOverride.warningContent "
 <p>You should not add an exception if you are using an internet connection that you do not trust completely or if you are not used to seeing a warning for this server.</p>
 
 <button id='getMeOutOfHereButton'>&securityOverride.getMeOutOfHereButton;</button>
 <button id='exceptionDialogButton'>&securityOverride.exceptionButtonLabel;</button>
 ">
--- a/browser/themes/winstripe/browser/browser.css
+++ b/browser/themes/winstripe/browser/browser.css
@@ -246,40 +246,40 @@ statusbarpanel#statusbar-display {
 }
 
 #appmenu-edit-menuitem {
   -moz-appearance: none;
   background: transparent;
   font-style: italic;
 }
 
-#appmenu_BookmarkItem {
+#appmenu_bookmarks {
   list-style-image: url("chrome://browser/skin/places/bookmark.png");
   -moz-image-region: rect(0px 48px 16px 32px);
 }
 
 #appmenu_privateBrowsing {
   list-style-image: url("chrome://browser/skin/Privacy-16.png");
 }
 
-#appmenuBookmarkMenu_unsorted-menuitem {
+#appmenu_unsortedBookmarks {
   list-style-image: url("chrome://browser/skin/places/unsortedBookmarks.png");
 }
 
 #appmenu_addons {
   list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric-16.png");
 }
 
-#appmenu-button #subscribeToPageMenuitem:not([disabled]),
-#appmenu-button #subscribeToPageMenupopup:not([hidden]) {
+#appmenu_subscribeToPage:not([disabled]),
+#appmenu_subscribeToPageMenu {
   list-style-image: url("chrome://browser/skin/feeds/feed-icons-16.png");
   -moz-image-region: rect(0px 16px 16px 0px);
 }
 
-#appmenuBookmarkThisPage {
+#appmenu_bookmarkThisPage {
   list-style-image: url("chrome://browser/skin/places/bookmark.png");
   -moz-image-region: rect(0 16px 16px 0);
 }
 
 /* XXX: stop-gap until the button can be drawn in the title bar */
 %ifdef WINSTRIPE_AERO
 @media not all and (-moz-windows-compositor) {
 %endif
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -289,16 +289,17 @@ class Automation(object):
       raise SyntaxError(lineno + 1, "missing primary location")
 
     return locations
 
   def setupPermissionsDatabase(self, profileDir, permissions):
     # Open database and create table
     permDB = sqlite3.connect(os.path.join(profileDir, "permissions.sqlite"))
     cursor = permDB.cursor();
+    # SQL copied from nsPermissionManager.cpp
     cursor.execute("""CREATE TABLE moz_hosts (
        id INTEGER PRIMARY KEY,
        host TEXT,
        type TEXT,
        permission INTEGER,
        expireType INTEGER,
        expireTime INTEGER)""")
 
--- a/client.mk
+++ b/client.mk
@@ -137,39 +137,35 @@ MOZCONFIG_MODULES := build/unix/uniq.pl
 
 
 
 run_for_side_effects := \
   $(shell $(TOPSRCDIR)/$(MOZCONFIG_LOADER) $(TOPSRCDIR) $(TOPSRCDIR)/.mozconfig.mk > $(TOPSRCDIR)/.mozconfig.out)
 
 include $(TOPSRCDIR)/.mozconfig.mk
 
+ifndef MOZ_OBJDIR
+  MOZ_OBJDIR = obj-$(CONFIG_GUESS)
+endif
+
 ifdef MOZ_BUILD_PROJECTS
 
-ifndef MOZ_OBJDIR
-  $(error When MOZ_BUILD_PROJECTS is set, you must set MOZ_OBJDIR)
-endif
 ifdef MOZ_CURRENT_PROJECT
   OBJDIR = $(MOZ_OBJDIR)/$(MOZ_CURRENT_PROJECT)
   MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
   BUILD_PROJECT_ARG = MOZ_BUILD_APP=$(MOZ_CURRENT_PROJECT)
 else
   OBJDIR = $(error Cannot find the OBJDIR when MOZ_CURRENT_PROJECT is not set.)
   MOZ_MAKE = $(error Cannot build in the OBJDIR when MOZ_CURRENT_PROJECT is not set.)
 endif
 
 else # MOZ_BUILD_PROJECTS
 
-ifdef MOZ_OBJDIR
-  OBJDIR = $(MOZ_OBJDIR)
-  MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
-else
-  OBJDIR := $(TOPSRCDIR)
-  MOZ_MAKE := $(MAKE) $(MOZ_MAKE_FLAGS)
-endif
+OBJDIR = $(MOZ_OBJDIR)
+MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
 
 endif # MOZ_BUILD_PROJECTS
 
 # 'configure' scripts generated by autoconf.
 CONFIGURES := $(TOPSRCDIR)/configure
 CONFIGURES += $(TOPSRCDIR)/js/src/configure
 
 #######################################################################
--- a/content/html/content/test/test_bug535043.html
+++ b/content/html/content/test/test_bug535043.html
@@ -13,26 +13,25 @@ https://bugzilla.mozilla.org/show_bug.cg
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=535043">Mozilla Bug 535043</a>
 <p id="display"></p>
 <div id="content">
   <textarea></textarea>
   <textarea maxlength="-1"></textarea>
   <textarea maxlength="0"></textarea>
   <textarea maxlength="2"></textarea>
-  <textarea maxlength="257"></textarea>
 </div>
 <pre id="test">
 <script type="text/javascript">
 
 /** Test for Bug 535043 **/
 function checkTextArea(textArea) {
   textArea.value = '';
   textArea.focus();
-  for (var j = 0; j < 259; j++) {
+  for (var j = 0; j < 3; j++) {
     synthesizeKey('x', {});
   }
   var htmlMaxLength = textArea.getAttribute('maxlength');
   var domMaxLength = textArea.maxLength;
   if (htmlMaxLength == null) {
     is(domMaxLength, -1,
       'maxlength is unset but maxLength DOM attribute is not -1');
   } else if (htmlMaxLength < 0) {
@@ -40,32 +39,32 @@ function checkTextArea(textArea) {
     // not 0, but they don't?
     is(domMaxLength, -1,
       'maxlength is out of range but maxLength DOM attribute is not -1');
   } else {
     is(domMaxLength, parseInt(htmlMaxLength),
       'maxlength in DOM does not match provided value');
   }
   if (textArea.maxLength == -1) {
-    is(textArea.value.length, 259,
+    is(textArea.value.length, 3,
       'textarea with maxLength -1 should have no length limit');
   } else {
     is(textArea.value.length, textArea.maxLength, 'textarea has maxLength ' +
       textArea.maxLength + ' but length ' + textArea.value.length );
   }
 }
 
 SimpleTest.waitForFocus(function() {
   var textAreas = document.getElementsByTagName('textarea');
   for (var i = 0; i < textAreas.length; i++) {
     checkTextArea(textAreas[i]);
   }
 
   textArea = textAreas[0];
-  testNums = [-42, -1, 0, 2, 257];
+  testNums = [-42, -1, 0, 2];
   for (var i = 0; i < testNums.length; i++) {
     textArea.removeAttribute('maxlength');
 
     var caught = false;
     try {
       textArea.maxLength = testNums[i];
     } catch (e) {
       caught = true;
@@ -75,13 +74,18 @@ SimpleTest.waitForFocus(function() {
     } else {
       ok(!caught, 'Setting nonnegative maxLength should not throw exception');
     }
     checkTextArea(textArea);
 
     textArea.setAttribute('maxlength', testNums[i]);
     checkTextArea(textArea);
   }
+
+  SimpleTest.finish();
 });
+
+SimpleTest.waitForExplicitFinish();
+
 </script>
 </pre>
 </body>
 </html>
--- a/docshell/resources/content/netError.xhtml
+++ b/docshell/resources/content/netError.xhtml
@@ -364,17 +364,17 @@
 
         <!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
         <div id="errorLongDesc" />
 
         <!-- Override section - For ssl errors only.  Removed on init for other
              error types.  -->
         <div id="securityOverrideDiv">
           <a id="securityOverrideLink" href="javascript:showSecuritySection();" >&securityOverride.linkText;</a>
-          <div id="securityOverrideContent" style="display: none;">&securityOverride.warningText;</div>
+          <div id="securityOverrideContent" style="display: none;">&securityOverride.warningContent;</div>
         </div>
       </div>
 
       <!-- Retry Button -->
       <button id="errorTryAgain" onclick="retryThis(this);">&retry.label;</button>
 
     </div>
 
--- a/dom/locales/en-US/chrome/netErrorApp.dtd
+++ b/dom/locales/en-US/chrome/netErrorApp.dtd
@@ -1,9 +1,9 @@
 <!-- Error messages that are likely to be overridden by applications go in this
      file, all messages that likely don't need to tie into app-specific UI
      should go into netError.dtd -->
 
 <!ENTITY securityOverride.linkText "Or you can add an exception…">
-<!ENTITY securityOverride.warningText "
+<!ENTITY securityOverride.warningContent "
 <p>You should not add an exception if you are using an internet connection that you do not trust completely or if you are not used to seeing a warning for this server.</p>
 <p>If you still wish to add an exception for this site, you can do so in your advanced encryption settings.</p>
 ">
--- a/extensions/cookie/nsPermissionManager.cpp
+++ b/extensions/cookie/nsPermissionManager.cpp
@@ -338,16 +338,18 @@ nsPermissionManager::InitDB(PRBool aRemo
 nsresult
 nsPermissionManager::CreateTable()
 {
   // set the schema version, before creating the table
   nsresult rv = mDBConn->SetSchemaVersion(HOSTS_SCHEMA_VERSION);
   if (NS_FAILED(rv)) return rv;
 
   // create the table
+  // SQL also lives in automation.py.in. If you change this SQL change that
+  // one too.
   return mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING(
     "CREATE TABLE moz_hosts ("
       " id INTEGER PRIMARY KEY"
       ",host TEXT"
       ",type TEXT"
       ",permission INTEGER"
       ",expireType INTEGER"
       ",expireTime INTEGER"
--- a/toolkit/content/widgets/scrollbox.xml
+++ b/toolkit/content/widgets/scrollbox.xml
@@ -220,59 +220,50 @@
         <parameter name="amountToScroll"/>
         <body><![CDATA[
           if (amountToScroll == 0)
             return;
 
           this._stopSmoothScroll();
 
           // Positive amountToScroll makes us scroll right (elements fly left), negative scrolls left.
-          var round;
-          if (amountToScroll < 0) {
-            this._isScrolling = -1;
-            round = Math.floor;
-          } else {
-            this._isScrolling = 1;
-            round = Math.ceil;
-          }
-
-          const FRAME_LENGTH = 60;
-
-          function processFrame(self, scrollAmounts, off) {
-            var distance = scrollAmounts.shift();
-
-            // Skip frames if we aren't getting the desired frame rate.
-            if (off > 0) {
-              for (var i = Math.round(off / FRAME_LENGTH); i > 0; i--)
-                distance += scrollAmounts.shift() || 0;
-            }
+          this._isScrolling = amountToScroll < 0 ? -1 : 1;
 
-            self.scrollByPixels(distance);
-            if (!scrollAmounts.length)
-              self._stopSmoothScroll();
-          }
-
-          // amountToScroll: total distance to scroll
-          // scrollAmount: distance to move during the particular effect frame (60ms)
-          var scrollAmount, scrollAmounts = [];
-          if (amountToScroll > 2 || amountToScroll < -2) {
-            scrollAmount = round(amountToScroll * 0.2);
-            scrollAmounts.push(scrollAmount, scrollAmount, scrollAmount);
-            amountToScroll -= 3 * scrollAmount;
-          }
-          while (this._isScrolling < 0 && amountToScroll < 0 ||
-                 this._isScrolling > 0 && amountToScroll > 0) {
-            amountToScroll -= (scrollAmount = round(amountToScroll * 0.5));
-            scrollAmounts.push(scrollAmount);
-          }
-          this._smoothScrollTimer = setInterval(processFrame, FRAME_LENGTH, this, scrollAmounts);
-          processFrame(this, scrollAmounts, 0);
+          this._scrollAnim.start(amountToScroll);
         ]]></body>
       </method>
 
+      <field name="_scrollAnim"><![CDATA[({
+        scrollbox: this,
+        start: function scrollAnim_start(distance) {
+          this.distance = distance;
+          this.startPos = this.scrollbox.scrollPosition;
+          this.duration = Math.min(1000, Math.round(50 * Math.sqrt(Math.abs(distance))));
+          this.startTime = window.mozAnimationStartTime;
+
+          window.addEventListener("MozBeforePaint", this, false);
+          window.mozRequestAnimationFrame();
+        },
+        stop: function scrollAnim_stop() {
+          window.removeEventListener("MozBeforePaint", this, false);
+        },
+        handleEvent: function scrollAnim_handleEvent(event) {
+          const timePassed = event.timeStamp - this.startTime;
+          const pos = timePassed >= this.duration ? 1 :
+                      1 - Math.pow(1 - timePassed / this.duration, 2);
+
+          this.scrollbox.scrollPosition = this.startPos + (this.distance * pos);
+
+          if (pos == 1)
+            this.scrollbox._stopSmoothScroll();
+          else
+            window.mozRequestAnimationFrame();
+        }
+      })]]></field>
+
       <method name="scrollByIndex">
         <parameter name="index"/>
         <parameter name="aSmoothScroll"/>
         <body><![CDATA[
           if (index == 0)
             return;
 
           // Each scrollByIndex call is expected to scroll the given number of
@@ -388,23 +379,22 @@
           this.scrollPosition += px;
         ]]></body>
       </method>
 
       <!-- 0: idle
            1: scrolling right
           -1: scrolling left -->
       <field name="_isScrolling">0</field>
-      <field name="_smoothScrollTimer">0</field>
       <field name="_prevMouseScrolls">[null, null]</field>
 
       <method name="_stopSmoothScroll">
         <body><![CDATA[
           if (this._isScrolling) {
-            clearInterval(this._smoothScrollTimer);
+            this._scrollAnim.stop();
             this._isScrolling = 0;
             this._scrollTarget = null;
           }
         ]]></body>
       </method>
 
       <method name="_updateScrollButtonsDisabledState">
         <body><![CDATA[