merge with trunk
authorBenjamin Stover <bstover@mozilla.com>
Tue, 31 Aug 2010 13:24:19 -0700
changeset 66613 d2350898f9c4408b4b6dd14f27f7624800972a42
parent 66612 116f15d36cf181a77301424778254edb1f1f3e4c (current diff)
parent 66518 cf8d26e35a784ea01123241420a2c36e80ed1ddd (diff)
child 66614 823fa0d8d564b7c74bc69a5557200b9903c8a86e
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
merge with trunk
mobile/app/mobile.js
mobile/chrome/content/BrowserView.js
mobile/chrome/content/InputHandler.js
mobile/chrome/content/bindings.xml
mobile/chrome/content/bindings/browser.xml
mobile/chrome/content/browser-ui.js
mobile/chrome/content/browser.js
mobile/chrome/content/browser.xul
mobile/chrome/content/content.js
mobile/chrome/content/tabs.xml
mobile/chrome/jar.mn
mobile/themes/core/browser.css
--- a/mobile/app/Makefile.in
+++ b/mobile/app/Makefile.in
@@ -103,18 +103,16 @@ APP_BUILDID = $(shell $(PYTHON) $(topsrc
 APP_ICON = mobile
 APP_SPLASH = splash
 
 DEFINES += -DGRE_MILESTONE=$(GRE_MILESTONE) \
            -DGRE_BUILDID=$(GRE_BUILDID) \
            -DAPP_BUILDID=$(APP_BUILDID) \
            -DAPP_NAME=$(MOZ_APP_NAME) \
            -DAPP_VERSION=$(MOZ_APP_VERSION) \
-           -DAPP_UA_NAME_EXTRA=$(MOZ_APP_UA_EXTRA) \
-           -DAPP_VERSION_EXTRA=$(FIREFOX_VERSION) \
            -DMOZ_UPDATER=$(MOZ_UPDATER) \
            $(NULL)
 
 ifdef MOZILLA_OFFICIAL
 DEFINES += -DMOZILLA_OFFICIAL
 endif
 
 SOURCE_STAMP := $(shell cd $(srcdir)/.. && hg identify 2>/dev/null | cut -f1 -d' ')
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..06a33376ae618913d5bf2ecbed646e0016353fd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53xtAy3Q
zP_ML+t8U_HclHZk88Tz?i7=yeWxHipxLvs4lge!=*S{e`XTjC1pG*tne<jN(9*K!a
zIh%G_nBnck^HS~24`icw(>6<*NcF}uUf_GX_Ftdn#&s`CxV~216>QkQc<$W&nv*QI
zgoLUt>N@|l$UuU}qIPXq^V1^DH?eJr9y~4I>K|PR`}EVM$8GWP;;m78)gx6n7Jlw*
zz3|QFj+UIX(lx<rjA}PM4fN(}>!^rzPxMfEG%JN=Cu6_|(|hl~>$qGtnd|3Px;Ktp
zD#{|%cqUKI_GstprM;QjOM_NUKAUF0VxmyVvCF=7>%&&_eJ}g_d%uf0BOAkfMTZkB
TCQm#MDmy)0{an^LB{Ts5b7u|@
--- a/mobile/app/mobile.js
+++ b/mobile/app/mobile.js
@@ -32,17 +32,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #filter substitution
 
 pref("toolkit.defaultChromeURI", "chrome://browser/content/browser.xul");
-pref("general.useragent.extra.mobile", "@APP_UA_NAME_EXTRA@/@APP_VERSION_EXTRA@ Fennec/@APP_VERSION@");
+pref("general.useragent.compatMode.firefox", true);
 pref("browser.chromeURL", "chrome://browser/content/");
 
 pref("browser.tabs.warnOnClose", true);
 #ifdef MOZ_IPC
 pref("browser.tabs.remote", true);
 #else
 pref("browser.tabs.remote", false);
 #endif
@@ -76,16 +76,20 @@ pref("image.cache.size", 1048576); // by
 
 /* offline cache prefs */
 pref("browser.offline-apps.notify", true);
 pref("browser.cache.offline.enable", true);
 pref("browser.cache.offline.capacity", 5120); // kilobytes
 pref("offline-apps.quota.max", 2048); // kilobytes
 pref("offline-apps.quota.warn", 1024); // kilobytes
 
+/* protocol warning prefs */
+pref("network.protocol-handler.warn-external.tel", false);
+pref("network.protocol-handler.warn-external.mailto", false);
+
 /* http prefs */
 pref("network.http.pipelining", true);
 pref("network.http.pipelining.ssl", true);
 pref("network.http.proxy.pipelining", true);
 pref("network.http.pipelining.maxrequests" , 6);
 pref("network.http.keep-alive.timeout", 600);
 pref("network.http.max-connections", 6);
 pref("network.http.max-connections-per-server", 4);
@@ -130,16 +134,20 @@ pref("alerts.height", 50);
 pref("signon.rememberSignons", true);
 pref("signon.expireMasterPassword", false);
 pref("signon.SignonFileName", "signons.txt");
 
 /* form helper */
 pref("formhelper.enabled", true);
 pref("formhelper.autozoom", true);
 pref("formhelper.restore", false);
+pref("formhelper.caretLines.portrait", 4);
+pref("formhelper.caretLines.landscape", 1);
+pref("formhelper.harmonizeValue", 10);
+pref("formhelper.margin", 15);
 
 /* find helper */
 pref("findhelper.autozoom", true);
 
 /* autocomplete */
 pref("browser.formfill.enable", true);
 
 #ifdef WINCE
@@ -354,17 +362,17 @@ pref("browser.console.showInPanel", fals
 
 // kinetic tweakables
 pref("browser.ui.kinetic.updateInterval", 30);
 pref("browser.ui.kinetic.decelerationRate", 20);
 pref("browser.ui.kinetic.speedSensitivity", 80);
 pref("browser.ui.kinetic.swipeLength", 160);
 
 // zooming
-pref("browser.ui.zoom.pageFitGranularity", 10); // don't zoom to fit by less than 1/10.
+pref("browser.ui.zoom.pageFitGranularity", 9); // don't zoom to fit by less than 1/9
 pref("browser.ui.zoom.animationFps", 60);
 pref("browser.ui.zoom.animationDuration", 350); // ms duration of double-tap zoom animation
 
 // pinch gesture
 pref("browser.ui.pinch.maxGrowth", 150);     // max pinch distance growth
 pref("browser.ui.pinch.maxShrink", 200);     // max pinch distance shrinkage
 pref("browser.ui.pinch.scalingFactor", 500); // scaling factor for above pinch limits
 
--- a/mobile/branding/nightly/configure.sh
+++ b/mobile/branding/nightly/configure.sh
@@ -1,2 +1,1 @@
 MOZ_APP_DISPLAYNAME=Fennec
-MOZ_APP_UA_EXTRA=Namoroka
--- a/mobile/branding/official/configure.sh
+++ b/mobile/branding/official/configure.sh
@@ -1,2 +1,1 @@
 MOZ_APP_DISPLAYNAME=Firefox
-MOZ_APP_UA_EXTRA=Firefox
--- a/mobile/chrome/content/InputHandler.js
+++ b/mobile/chrome/content/InputHandler.js
@@ -122,16 +122,17 @@ function InputHandler(browserViewContain
   this._suppressNextClick = false;
 
   /* these handle dragging of both chrome elements and content */
   window.addEventListener("mousedown", this, true);
   window.addEventListener("mouseup", this, true);
   window.addEventListener("mousemove", this, true);
   window.addEventListener("click", this, true);
   window.addEventListener("contextmenu", this, false);
+  window.addEventListener("MozSwipeGesture", this, true);
   window.addEventListener("MozMagnifyGestureStart", this, true);
   window.addEventListener("MozMagnifyGestureUpdate", this, true);
   window.addEventListener("MozMagnifyGesture", this, true);
 
   /* these handle key strokes in the browser view (where page content appears) */
   browserViewContainer.addEventListener("keypress", this, false);
   browserViewContainer.addEventListener("keyup", this, false);
   browserViewContainer.addEventListener("keydown", this, false);
@@ -1241,16 +1242,34 @@ GestureModule.prototype = {
    * receive gesture events.
    *
    * @param nsIDOMEvent information structure
    */
   handleEvent: function handleEvent(aEvent) {
     try {
       let consume = false;
       switch (aEvent.type) {
+        case "MozSwipeGesture":
+          let gesture = Ci.nsIDOMSimpleGestureEvent;
+          switch (aEvent.direction) {
+            case gesture.DIRECTION_UP:
+              Browser.scrollContentToBottom();
+              break;
+            case gesture.DIRECTION_DOWN:
+              Browser.scrollContentToTop();
+              break;
+            case gesture.DIRECTION_LEFT:
+              CommandUpdater.doCommand("cmd_back");
+              break;
+            case gesture.DIRECTION_RIGHT:
+              CommandUpdater.doCommand("cmd_forward");
+              break;
+          }
+          break;
+
         case "MozMagnifyGestureStart":
           consume = true;
           this._pinchStart(aEvent);
           break;
 
         case "MozMagnifyGestureUpdate":
           consume = true;
           if (this._ignoreNextUpdate)
--- a/mobile/chrome/content/Util.js
+++ b/mobile/chrome/content/Util.js
@@ -177,17 +177,17 @@ let Util = {
       return (savedmstone ? "new version" : "new profile");
     }
 
     return "none";
   },
 
   /** Don't display anything in the urlbar for these special URIs. */
   isURLEmpty: function isURLEmpty(aURL) {
-    return (!aURL || aURL == "about:blank" || aURL == "about:home");
+    return (!aURL || aURL == "about:blank" || aURL == "about:empty" || aURL == "about:home");
   },
 
   /** Recursively find all documents, including root document. */
   getAllDocuments: function getAllDocuments(doc, resultSoFar) {
     resultSoFar = resultSoFar || [doc];
     if (!doc.defaultView)
       return resultSoFar;
     let frames = doc.defaultView.frames;
@@ -295,16 +295,17 @@ Util.Timeout.prototype = {
 /**
  * Cache of commonly used elements.
  */
 let Elements = {};
 
 [
   ["browserBundle",      "bundle_browser"],
   ["contentShowing",     "bcast_contentShowing"],
+  ["urlbarState",        "bcast_urlbarState"],
   ["stack",              "stack"],
   ["panelUI",            "panel-container"],
   ["viewBuffer",         "view-buffer"],
   ["toolbarContainer",   "toolbar-container"],
 ].forEach(function (elementGlobal) {
   let [name, id] = elementGlobal;
   Elements.__defineGetter__(name, function () {
     let element = document.getElementById(id);
--- a/mobile/chrome/content/bindings.xml
+++ b/mobile/chrome/content/bindings.xml
@@ -11,39 +11,49 @@
     xmlns:svg="http://www.w3.org/2000/svg"
     xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <binding id="autocomplete-aligned" extends="chrome://global/content/bindings/autocomplete.xml#autocomplete">
     <implementation>
       <method name="openPopup">
         <body><![CDATA[
           this.popup.openAutocompletePopup(this, null);
-          this.setAttribute("open", "true");
         ]]></body>
       </method>
       <method name="closePopup">
         <body><![CDATA[
-          this.removeAttribute("open");
-
           // hack! we want to revert to the "all results" popup when the
           // controller would otherwise close us because of an empty search
           // string.
           if (this.value == "")
             this.showHistoryPopup();
         ]]></body>
       </method>
     </implementation>
     <handlers>
-      <handler event="keypress" keycode="VK_RETURN" phase="capturing">
+      <handler event="keypress" phase="capturing">
         <![CDATA[
-          setTimeout(function() { BrowserUI.activePanel = null }, 0);
+          if (event.keyCode == event.DOM_VK_RETURN)
+            setTimeout(function() { BrowserUI.activePanel = null }, 0);
+          else if (this.readOnly)
+            this.readOnly = false;
         ]]>
       </handler>
-      <handler event="text" phase="bubbling"
-               action="if (this.mController.input == this) this.mController.handleText();"/>
+      <handler event="text" phase="bubbling">
+        <![CDATA[
+          if (this.mController.input == this)
+            this.mController.handleText();
+        ]]>
+      </handler>
+      <handler event="blur" phase="capturing">
+        <![CDATA[
+          // suppress disconnect of autocomplete controller
+          this._dontBlur = true;
+        ]]>
+      </handler>
     </handlers>
   </binding>
 
   <binding id="popup_autocomplete_result">
     <content orient="vertical">
       <xul:hbox class="autocomplete-item-label" align="top" xbl:inherits="tags, favorite" mousethrough="always">
         <xul:image xbl:inherits="src"/>
         <xul:vbox flex="1">
--- a/mobile/chrome/content/bindings/browser.xml
+++ b/mobile/chrome/content/bindings/browser.xml
@@ -97,18 +97,29 @@
           switch (aMessage.name) {
             case "DOMPopupBlocked":
               this.onPopupBlocked(aMessage);
               break;
 
             case "pageshow":
               this.onPageShow(aMessage);
 
-              if (this.mIconURL == "" && this._documentURI)
-                this.mIconURL = this.documentURI.prePath + "/favicon.ico";
+              if (this.mIconURL == "" && this._documentURI) {
+                // newURI call is throwing for chrome URI
+                try {
+                  // Use documentURIObject in the favicon construction so that we
+                  // do the right thing with about:-style error pages.  Bug 515188
+                  let iconURI = Services.io.newURI(this.documentURI.prePath + "/favicon.ico", null, null);
+                  if (!iconURI.schemeIs("javascript") && !gFaviconService.isFailedFavicon(iconURI)) {
+                    gFaviconService.setAndLoadFaviconForPage(this.currentURI, iconURI, true);
+                    this.mIconURL = iconURI.spec;
+                  }
+                }
+                catch(e) {}
+              }
               break;
 
             case "pagehide":
               this.onPageHide(aMessage);
               break;
 
             case "DOMTitleChanged":
               this._contentTitle = aMessage.json.title;
@@ -601,17 +612,17 @@
           LOAD_FLAGS_CHARSET_CHANGE: 1024,
           LOAD_FLAGS_STOP_CONTENT: 2048,
           LOAD_FLAGS_FROM_EXTERNAL: 4096,
           LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP: 8192,
           LOAD_FLAGS_FIRST_LOAD: 16384,
           LOAD_FLAGS_ALLOW_POPUPS: 32768,
           LOAD_FLAGS_BYPASS_CLASSIFIER: 65536,
           LOAD_FLAGS_FORCE_ALLOW_COOKIES: 131072,
-          
+
           STOP_NETWORK: 1,
           STOP_CONTENT: 2,
           STOP_ALL: 3,
 
           canGoBack: false,
           canGoForward: false,
           goBack: function() { this._sendMessage("WebNavigation:GoBack", {}); },
           goForward: function() { this._sendMessage("WebNavigation:GoForward", {}); },
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -135,23 +135,22 @@ var BrowserUI = {
     let back = document.getElementById("cmd_back");
     let forward = document.getElementById("cmd_forward");
 
     back.setAttribute("disabled", !aBrowser.canGoBack);
     forward.setAttribute("disabled", !aBrowser.canGoForward);
   },
 
   _updateToolbar: function _updateToolbar() {
-    let icons = document.getElementById("urlbar-icons");
-    let mode = icons.getAttribute("mode");
+    let mode = Elements.urlbarState.getAttribute("mode");
     if (Browser.selectedTab.isLoading() && mode != "loading") {
-      icons.setAttribute("mode", "loading");
+      Elements.urlbarState.setAttribute("mode", "loading");
     }
     else if (mode != "view") {
-      icons.setAttribute("mode", "view");
+      Elements.urlbarState.setAttribute("mode", "view");
     }
   },
 
   _tabSelect: function(aEvent) {
     let browser = Browser.selectedBrowser;
     this._titleChanged(browser);
     this._updateToolbar();
     this._updateButtons(browser);
@@ -191,31 +190,37 @@ var BrowserUI = {
   _setURI: function _setURI(aCaption) {
     if (this.isAutoCompleteOpen())
       this._edit.defaultValue = aCaption;
     else
       this._edit.value = aCaption;
   },
 
   _editURI: function _editURI(aEdit) {
-    var icons = document.getElementById("urlbar-icons");
-    if (aEdit && icons.getAttribute("mode") != "edit") {
-      icons.setAttribute("mode", "edit");
-      this._edit.defaultValue = this._edit.value;
-
+    if (aEdit) {
+      let isOpened = this._edit.hasAttribute("open");
+      if (!isOpened) {
+        Elements.urlbarState.setAttribute("mode", "edit");
+        this._edit.defaultValue = this._edit.value;
+      }
+
+      // Replace the web page title by the url of the page
       let urlString = this.getDisplayURI(Browser.selectedBrowser);
       if (Util.isURLEmpty(urlString))
         urlString = "";
       this._edit.value = urlString;
 
-      // This is a workaround for bug 488420, needed to cycle focus for the
-      // IME state to be set properly. Testing shows we only really need to
-      // do this the first time.
-      this._edit.blur();
-      gFocusManager.setFocus(this._edit, Ci.nsIFocusManager.FLAG_NOSCROLL);
+      if (!this._edit.readOnly) {
+        // This is a workaround needed to cycle focus for the IME state
+        // to be set properly (bug 488420)
+        this._edit.blur();
+        gFocusManager.setFocus(this._edit, Ci.nsIFocusManager.FLAG_NOSCROLL);
+      }
+
+      this._edit.readOnly = !isOpened;
     }
     else if (!aEdit) {
       this._updateToolbar();
     }
   },
 
   updateAwesomeHeader: function updateAwesomeHeader(aVisible) {
     document.getElementById("awesome-header").hidden = aVisible;
@@ -235,26 +240,29 @@ var BrowserUI = {
   },
 
   _activePanel: null,
   get activePanel() {
     return this._activePanel;
   },
 
   set activePanel(aPanel) {
+    if (this._activePanel == aPanel)
+      return;
+
     let container = document.getElementById("awesome-panels");
     if (aPanel) {
       container.hidden = false;
       aPanel.open();
     } else {
       container.hidden = true;
       BrowserUI.showToolbar(false);
     }
 
-    if (this._activePanel && this._activePanel != aPanel)
+    if (this._activePanel)
       this._activePanel.close();
     this._activePanel = aPanel;
   },
 
   get activeDialog() {
     // Return the topmost dialog
     if (this._dialogs.length)
       return this._dialogs[this._dialogs.length - 1];
@@ -373,16 +381,20 @@ var BrowserUI = {
     this._edit = document.getElementById("urlbar-edit");
     this._throbber = document.getElementById("urlbar-throbber");
     this._favicon = document.getElementById("urlbar-favicon");
     this._favicon.addEventListener("error", this, false);
 
     this._edit.addEventListener("click", this, false);
     this._edit.addEventListener("mousedown", this, false);
 
+    let awesomePopup = document.getElementById("popup_autocomplete");
+    awesomePopup.addEventListener("popupshown", this, false);
+    awesomePopup.addEventListener("popuphidden", this, false);
+
     document.getElementById("toolbar-main").ignoreDrag = true;
 
     let tabs = document.getElementById("tabs");
     tabs.addEventListener("TabSelect", this, true);
     tabs.addEventListener("TabOpen", this, true);
 
     // listen content messages
     messageManager.addMessageListener("DOMLinkAdded", this);
@@ -434,33 +446,33 @@ var BrowserUI = {
     FormHelperUI.init();
     FindHelperUI.init();
     PageActions.init();
   },
 
   uninit: function() {
     ExtensionsView.uninit();
     ConsoleView.uninit();
+    FormHelperUI.uninit();
   },
 
   update: function(aState) {
-    let icons = document.getElementById("urlbar-icons");
     let browser = Browser.selectedBrowser;
 
     switch (aState) {
       case TOOLBARSTATE_LOADED:
-        if (icons.getAttribute("mode") != "edit")
+        if (Elements.urlbarState.getAttribute("mode") != "edit")
           this._updateToolbar();
 
         this._updateIcon(browser.mIconURL);
         this.unlockToolbar();
         break;
 
       case TOOLBARSTATE_LOADING:
-        if (icons.getAttribute("mode") != "edit")
+        if (Elements.urlbarState.getAttribute("mode") != "edit")
           this._updateToolbar();
 
         browser.mIconURL = "";
         this._updateIcon();
         this.lockToolbar();
         break;
     }
   },
@@ -531,18 +543,16 @@ var BrowserUI = {
     let uri = gURIFixup.createFixupURI(aURI, fixupFlags);
     gHistSvc.markPageAsTyped(uri);
   },
 
   showAutoComplete: function showAutoComplete() {
     if (this.isAutoCompleteOpen())
       return;
 
-    BrowserSearch.updateSearchButtons();
-
     this._hidePopup();
     this.activePanel = AllPagesList;
   },
 
   closeAutoComplete: function closeAutoComplete(aResetInput) {
     if (!this.isAutoCompleteOpen())
       return;
 
@@ -551,32 +561,30 @@ var BrowserUI = {
     else
       this._edit.popup.closePopup();
   },
 
   isAutoCompleteOpen: function isAutoCompleteOpen() {
     return this._edit.popup.popupOpen;
   },
 
-  doButtonSearch: function(button) {
-    if (!("engine" in button) || !button.engine)
-      return;
-
-    // We don't want the button to look pressed for now
-    button.parentNode.selectedItem = null;
+  doOpenSearch: function doOpenSearch(aName) {
+    // save the current value of the urlbar
+    let searchValue = this._edit.value;
 
     // Give the new page lots of room
     Browser.hideSidebars();
     this.activePanel = null;
     this.closeAutoComplete(false);
 
     // Make sure we're online before attempting to load
     Util.forceOnline();
 
-    let submission = button.engine.getSubmission(this._edit.value, null);
+    let engine = Services.search.getEngineByName(aName);
+    let submission = engine.getSubmission(searchValue, null);
     Browser.loadURI(submission.uri.spec, { postData: submission.postData });
   },
 
   updateStar: function() {
     if (PlacesUtils.getMostRecentBookmarkForURI(Browser.selectedBrowser.currentURI) != -1)
       this.starButton.setAttribute("starred", "true");
     else
       this.starButton.removeAttribute("starred");
@@ -668,34 +676,35 @@ var BrowserUI = {
       let phone = Cc["@mozilla.org/phone/support;1"].createInstance(Ci.nsIPhoneSupport);
       phone.switchTask();
     } catch(e) { }
   },
 
   handleEscape: function (aEvent) {
     aEvent.stopPropagation();
 
+    // Check open popups
+    if (this._popup) {
+      this._hidePopup();
+      return;
+    }
+
+    // Check active panel
     if (BrowserUI.activePanel) {
       BrowserUI.activePanel = null;
       return;
     }
 
     // Check open dialogs
     let dialog = this.activeDialog;
     if (dialog) {
       dialog.close();
       return;
     }
 
-    // Check open popups
-    if (this._popup) {
-      this._hidePopup();
-      return;
-    }
-
     // Check open modal elements
     let modalElementsLength = document.getElementsByClassName("modal-block").length;
     if (modalElementsLength > 0)
       return;
 
     // Check open panel
     if (this.isPanelVisible()) {
       this.hidePanel();
@@ -766,16 +775,24 @@ var BrowserUI = {
           this._edit.editor.selectAll();
           aEvent.preventDefault();
         }
         break;
       // Favicon events
       case "error":
         this._favicon.src = "";
         break;
+      // Awesome popup event
+      case "popupshown":
+        this._edit.setAttribute("open", "true");
+        break;
+      case "popuphidden":
+        this._edit.removeAttribute("open");
+        this._edit.readOnly = true;
+        break;
     }
   },
 
   receiveMessage: function receiveMessage(aMessage) {
     let browser = aMessage.target;
     let json = aMessage.json;
     switch (aMessage.name) {
       case "DOMTitleChanged":
@@ -838,16 +855,17 @@ var BrowserUI = {
       case "cmd_back":
       case "cmd_forward":
       case "cmd_reload":
       case "cmd_forceReload":
       case "cmd_stop":
       case "cmd_go":
       case "cmd_openLocation":
       case "cmd_star":
+      case "cmd_opensearch":
       case "cmd_bookmarks":
       case "cmd_history":
       case "cmd_remoteTabs":
       case "cmd_quit":
       case "cmd_close":
       case "cmd_menu":
       case "cmd_newTab":
       case "cmd_closeTab":
@@ -921,16 +939,28 @@ var BrowserUI = {
           // autoclose the bookmark popup
           autoClose = true;
         }
 
         // Show/hide bookmark popup
         BookmarkPopup.toggle(autoClose);
         break;
       }
+      case "cmd_opensearch":
+        this._edit.blur();
+
+        MenuListHelperUI.show({
+          title: Elements.browserBundle.getString("opensearch.searchWith"),
+          menupopup: { children: BrowserSearch.engines },
+          set selectedIndex(aIndex) {
+            let name = this.menupopup.children[aIndex].label;
+            BrowserUI.doOpenSearch(name);
+          }
+        });
+        break;
       case "cmd_bookmarks":
         this.activePanel = BookmarkList;
         break;
       case "cmd_history":
         this.activePanel = HistoryList;
         break;
       case "cmd_remoteTabs":
         this.activePanel = RemoteTabsList;
@@ -1556,35 +1586,46 @@ var FindHelperUI = {
 var FormHelperUI = {
   type: "form",
   commands: {
     next: "cmd_formNext",
     previous: "cmd_formPrevious",
     close: "cmd_formClose"
   },
 
+  //for resize/rotate case
+  _currentCaretRect: null,
+  _currentElementRect: null,
+
   init: function formHelperInit() {
     this._container = document.getElementById("content-navigator");
     this._autofillContainer = document.getElementById("form-helper-autofill");
     this._cmdPrevious = document.getElementById(this.commands.previous);
     this._cmdNext = document.getElementById(this.commands.next);
 
     // Listen for form assistant messages from content
     messageManager.addMessageListener("FormAssist:Show", this);
     messageManager.addMessageListener("FormAssist:Hide", this);
     messageManager.addMessageListener("FormAssist:Update", this);
+    messageManager.addMessageListener("FormAssist:Resize", this);
     messageManager.addMessageListener("FormAssist:AutoComplete", this);
 
     // Listen for events where form assistant should be closed
     document.getElementById("tabs").addEventListener("TabSelect", this, true);
     document.getElementById("browsers").addEventListener("URLChanged", this, true);
 
     // Listen for modal dialog to show/hide the UI
     messageManager.addMessageListener("DOMWillOpenModalDialog", this);
     messageManager.addMessageListener("DOMModalDialogClosed", this);
+
+    Services.obs.addObserver(this, "softkb-change", false);
+  },
+
+  uninit: function formHelperUninit() {
+    Services.obs.removeObserver(this, "softkb-change");
   },
 
   show: function formHelperShow(aElement, aHasPrevious, aHasNext) {
     this._open = true;
 
     // Update the next/previous commands
     this._cmdPrevious.setAttribute("disabled", !aHasPrevious);
     this._cmdNext.setAttribute("disabled", !aHasNext);
@@ -1596,23 +1637,32 @@ var FormHelperUI = {
       value: aElement.value,
       maxLength: aElement.maxLength,
       type: aElement.type,
       isAutocomplete: aElement.isAutocomplete,
       list: aElement.choices
     }
     this._updateContainer(lastElement, this._currentElement);
 
-    this._zoom(Rect.fromRect(aElement.rect), Rect.fromRect(aElement.caretRect));
+    //hide all sidebars, this will adjust the visible rect.
+    Browser.hideSidebars();
+
+    //save the element Rect and reuse it to avoid jumps in cases the element moves slighty on the website.
+    this._currentElementRect = Rect.fromRect(aElement.rect);
+    this._zoom(this._currentElementRect, Rect.fromRect(aElement.caretRect));
   },
 
   hide: function formHelperHide() {
     if (!this._open)
       return;
 
+    // reset current Element and Caret Rect
+    this._currentElementRect = null;
+    this._currentCaretRect = null;
+
     this._updateContainerForSelect(this._currentElement, null);
     this._open = false;
   },
 
   handleEvent: function formHelperHandleEvent(aEvent) {
     if (aEvent.type == "TabSelect" || aEvent.type == "URLChanged")
       this.hide();
   },
@@ -1633,18 +1683,29 @@ var FormHelperUI = {
         this.hide();
         break;
 
       case "FormAssist:AutoComplete":
         this._updateAutocompleteFor(json.current);
         this._container.contentHasChanged();
         break;
 
-      case "FormAssist:Update":
-        this._zoom(null, Rect.fromRect(json.caretRect));
+      case "FormAssist:Resize":
+        // First hide all tool/sidebars they take to much space, this will adjust the visible rect.
+        Browser.hideSidebars();
+        this._zoom(this._currentElementRect, this._currentCaretRect);
+        this._container.contentHasChanged();
+        break;
+
+       case "FormAssist:Update":
+        // Using currentElementRect here is maybe not 100% perfect since
+        // elements might change there position while typing
+        // out of screen movement is covered by simply following the caret
+        // as long as we see what we type, let the element move
+        this._zoom(this._currentElementRect, Rect.fromRect(json.caretRect));
         break;
 
       case "DOMWillOpenModalDialog":
         if (this._open && aMessage.target == Browser.selectedBrowser) {
           this._container.style.display = "none";
           this._container._spacer.hidden = true;
         }
         break;
@@ -1652,16 +1713,26 @@ var FormHelperUI = {
       case "DOMModalDialogClosed":
         if (this._open && aMessage.target == Browser.selectedBrowser) {
           this._container.style.display = "-moz-box";
           this._container._spacer.hidden = false;
         }
         break;
     }
   },
+  
+  observe: function formHelperObserve(aSubject, aTopic, aData) {
+    let rect = Rect.fromRect(JSON.parse(aData));
+    rect.height = rect.bottom - rect.top;
+    rect.width  = rect.right - rect.left;
+
+    Browser._browserView._visibleScreenArea = rect;
+    BrowserUI.sizeControls(rect.width, rect.height);
+    this._zoom(this._currentElementRect, this._currentCaretRect);
+  },
 
   goToPrevious: function formHelperGoToPrevious() {
     Browser.selectedBrowser.messageManager.sendAsyncMessage("FormAssist:Previous", { });
   },
 
   goToNext: function formHelperGoToNext() {
     Browser.selectedBrowser.messageManager.sendAsyncMessage("FormAssist:Next", { });
   },
@@ -1676,16 +1747,17 @@ var FormHelperUI = {
     return (this._container.getAttribute("type") == this.type);
   },
 
   set _open(aVal) {
     if (aVal == this._open)
       return;
 
     this._container.hidden = !aVal;
+    this._container.contentHasChanged();
 
     if (aVal) {
       this._zoomStart();
       this._container.show(this);
     } else {
       this._zoomFinish();
       this._currentElement = null;
       this._container.hide(this);
@@ -1761,40 +1833,117 @@ var FormHelperUI = {
       SelectHelperUI.hide();
     }
   },
 
   /** Zoom and move viewport so that element is legible and touchable. */
   _zoom: function _formHelperZoom(aElementRect, aCaretRect) {
     return;
 
-    let zoomRect = Browser.getVisibleRect();
-
-    // Zoom to a specified Rect
-    if (aElementRect && bv.allowZoom && Services.prefs.getBoolPref("formhelper.autozoom")) {
-      // Zoom to an element by keeping the caret into view
-      let zoomLevel = Browser._getZoomLevelForRect(aElementRect);
-      zoomLevel = Math.min(Math.max(kBrowserFormZoomLevelMin, zoomLevel), kBrowserFormZoomLevelMax);
-
-      zoomRect = Browser._getZoomRectForPoint(aElementRect.center().x, aElementRect.y, zoomLevel);
-      Browser.animatedZoomTo(zoomRect);
-    }
-
-    // Move the view to show the caret if needed
-    if (aCaretRect) {
-      let caretRect = bv.browserToViewportRect(aCaretRect);
-      if (zoomRect.contains(caretRect))
-        return;
-
-      let [deltaX, deltaY] = this._getOffsetForCaret(caretRect, zoomRect);
-      if (deltaX != 0 || deltaY != 0) {
-        Browser.contentScrollboxScroller.scrollBy(deltaX, deltaY);
+    let bv = Browser._browserView;
+
+    if (aElementRect && aCaretRect && this._open) {
+      this._currentCaretRect = aCaretRect;
+
+      // might not always be set, if not - use the windowsize
+      let visibleScreenArea = !bv._visibleScreenArea.isEmpty() ? bv._visibleScreenArea : new Rect(0, 0, window.innerWidth, window.innerHeight);
+
+      // respect the helper container in setting the correct viewAreaHeight
+      let viewAreaHeight = visibleScreenArea.height - this._container.getBoundingClientRect().height;
+      let viewAreaWidth = visibleScreenArea.width;
+      let caretLines = Services.prefs.getIntPref("formhelper.caretLines.portrait");
+      let harmonizeValue = Services.prefs.getIntPref("formhelper.harmonizeValue");
+
+      if (!Util.isPortrait())
+        caretLines = Services.prefs.getIntPref("formhelper.caretLines.landscape");
+
+      // hide titlebar if the remaining space would be smaller than the height of the titlebar itself
+      // if there is enough space left than adjust the height. Since this adjust the the visible rects
+      // there is no need to adjust the y later
+      let toolbar = document.getElementById("toolbar-main");
+      if (viewAreaHeight - toolbar.boxObject.height <= toolbar.boxObject.height * 2)
+        Browser.hideTitlebar();
+      else
+        viewAreaHeight -= toolbar.boxObject.height;
+
+      // To ensure the correct calculation when the sidebars are visible - get the sidebar size and
+      // use them as margin
+      let [leftvis, rightvis, leftW, rightW] = Browser.computeSidebarVisibility(0, 0);
+      let marginLeft = leftvis ? leftW : 0;
+      let marginRight = rightvis ? rightW : 0;
+
+      // The height and Y of the caret might change during writing - even in cases the
+      // fontsize keeps the same. To avoid unneeded zooming and scrolling
+      let harmonizedCaretHeight = 0;
+      let harmonizedCaretY = 0;
+
+      // Start calculation here, the order is important
+      // All calculations are done in non_zoomed_coordinates => 1:1 to "screen-pixels"
+
+      // for buttons and non input field elements a caretRect with the height of 0 gets reported
+      // cover this case.
+      if (!aCaretRect.isEmpty()) {
+        // the height and y position may vary from letter to letter
+        // adjust position and zooming only if a bigger step was done.
+        harmonizedCaretHeight = aCaretRect.height - aCaretRect.height % harmonizeValue;
+        harmonizedCaretY = aCaretRect.y - aCaretRect.y % harmonizeValue;
+      } else {
+        harmonizedCaretHeight = 30; // fallback height
+
+        // use the element as position
+        harmonizedCaretY = aElementRect.y;
+        aCaretRect.x = aElementRect.x;
       }
 
-      Browser.animatedZoomTo(zoomRect);
+      let zoomLevel = bv.getZoomLevel();
+      let enableZoom = bv.allowZoom && Services.prefs.getBoolPref("formhelper.autozoom");
+      if (enableZoom) {
+        zoomLevel = (viewAreaHeight / caretLines) / harmonizedCaretHeight;
+        zoomLevel = Math.min(Math.max(kBrowserFormZoomLevelMin, zoomLevel), kBrowserFormZoomLevelMax);
+      }
+      viewAreaWidth /= zoomLevel;
+
+      const margin = Services.prefs.getIntPref("formhelper.margin");
+
+      // if the viewAreaWidth is smaller than the neutralized position + margins.
+      // [YES] use the x position of the element minus margins as x position for our visible rect.
+      // [NO] use the x position of the caret minus margins as the x position for our visible rect.
+      let x = (marginLeft + marginRight + margin + aCaretRect.x - aElementRect.x) < viewAreaWidth
+               ? aElementRect.x - margin - marginLeft
+               : aCaretRect.x - viewAreaWidth + margin + marginRight;
+      // use the adjustet Caret Y minus a margin four our visible rect
+      let y = harmonizedCaretY - margin;
+
+      // from here on play with zoomed values
+      // if we want to have it animated, build up zoom rect and animate.
+      if (enableZoom && bv.getZoomLevel() != zoomLevel) {
+        let vis = bv.getVisibleRect();
+        x = bv.browserToViewport(x);
+        y = bv.browserToViewport(y);
+
+        //dont use browser functions they are bogus for this case
+        let zoomRatio = zoomLevel / bv.getZoomLevel();
+        let newVisW = vis.width / zoomRatio, newVisH = vis.height / zoomRatio;
+        let zoomRect = new Rect(x, y, newVisW, newVisH);
+
+        Browser.animatedZoomTo(zoomRect);
+      }
+      else { // no zooming at all
+        let vis = bv.getVisibleRect();
+        // get our x and y in viewport "zoomed" coordinates
+        x = bv.browserToViewport(x);
+        y = bv.browserToViewport(y);
+
+        Browser.contentScrollboxScroller.scrollBy(x-vis.x, y-vis.y);
+
+        // workaround for tilemanager bug, after scrolling one screen height, text gets not painted on typing
+        bv.invalidateEntireView();
+
+        bv.onAfterVisibleMove();
+      }
     }
   },
 
   /* Store the current zoom level, and scroll positions to restore them if needed */
   _zoomStart: function _formHelperZoomStart() {
     if (!Services.prefs.getBoolPref("formhelper.restore"))
       return;
 
@@ -2074,59 +2223,98 @@ var MenuListHelperUI = {
     return this._container = document.getElementById("menulist-container");
   },
 
   get _popup() {
     delete this._popup;
     return this._popup = document.getElementById("menulist-popup");
   },
 
+  get _title() {
+    delete this._title;
+    return this._title = document.getElementById("menulist-title");
+  },
+
   _currentList: null,
   show: function mn_show(aMenulist) {
     this._currentList = aMenulist;
+    this._title.value = aMenulist.title || "";
 
     let container = this._container;
-    let listbox = this._popup.firstChild;
+    let listbox = this._popup.lastChild;
     while (listbox.firstChild)
       listbox.removeChild(listbox.firstChild);
 
     let children = this._currentList.menupopup.children;
     for (let i = 0; i < children.length; i++) {
       let child = children[i];
       let item = document.createElement("richlistitem");
-      if (child.selected)
-        item.setAttribute("selected", child.selected);
-      item.setAttribute("class", "menulist-command");
+      // Add selected as a class name instead of an attribute to not being overidden
+      // by the richlistbox behavior (it sets the "current" and "selected" attribute
+      item.setAttribute("class", "menulist-command" + (child.selected ? " selected" : ""));
+
+      let image = document.createElement("image");
+      image.setAttribute("src", child.image || "");
+      item.appendChild(image);
 
       let label = document.createElement("label");
       label.setAttribute("value", child.label);
       item.appendChild(label);
 
       listbox.appendChild(item);
     }
 
+    window.addEventListener("resize", this, true);
     container.hidden = false;
+    this.sizeToContent();
     BrowserUI.pushPopup(this, [this._popup]);
   },
 
   hide: function mn_hide() {
     this._currentList = null;
     this._container.hidden = true;
+    window.removeEventListener("resize", this, true);
     BrowserUI.popPopup();
   },
 
   selectByIndex: function mn_selectByIndex(aIndex) {
     this._currentList.selectedIndex = aIndex;
 
     // Dispatch a xul command event to the attached menulist
-    let evt = document.createEvent("XULCommandEvent");
-    evt.initCommandEvent("command", true, true, window, 0, false, false, false, false, null);
-    this._currentList.dispatchEvent(evt);
+    if (this._currentList.dispatchEvent) {
+      let evt = document.createEvent("XULCommandEvent");
+      evt.initCommandEvent("command", true, true, window, 0, false, false, false, false, null);
+      this._currentList.dispatchEvent(evt);
+    }
 
     this.hide();
+  },
+
+  sizeToContent: function sizeToContent() {
+    // Make sure the container is at least sized to the content
+    let popup = this._popup;
+    let preferredHeight = 0;
+    for (let i=0; i<popup.childElementCount; i++) {
+      preferredHeight += popup.children[i].getBoundingClientRect().height;
+    }
+
+    // Ensure to reset the assigned width/height to have the default's one set
+    // by the content
+    popup.width = popup.height = "";
+
+    let rect = popup.getBoundingClientRect();
+    let height = Math.min(preferredHeight, 0.75 * window.innerWidth);
+    let width = Math.min(rect.width, 0.75 * window.innerWidth);
+
+    popup.height = height;
+    popup.width = width;
+  },
+
+  handleEvent: function handleEvent(aEvent) {
+    this.sizeToContent();
   }
 }
 
 var ContextHelper = {
   popupState: null,
 
   get _panel() {
     delete this._panel;
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -285,41 +285,46 @@ var Browser = {
 
     // Command line arguments/initial homepage
     let whereURI = this.getHomePage();
     if (needOverride == "new profile")
         whereURI = "about:firstrun";
 
     // If this is an intial window launch (was a nsICommandLine passed via window params)
     // we execute some logic to load the initial launch page
-    if (window.arguments && window.arguments[0] &&
-        window.arguments[0] instanceof Ci.nsICommandLine) {
-      try {
-        var cmdLine = window.arguments[0];
+    if (window.arguments && window.arguments[0]) {
+      if (window.arguments[0] instanceof Ci.nsICommandLine) {
+        try {
+          var cmdLine = window.arguments[0];
 
-        // Check for and use a single commandline parameter
-        if (cmdLine.length == 1) {
-          // Assume the first arg is a URI if it is not a flag
-          var uri = cmdLine.getArgument(0);
-          if (uri != "" && uri[0] != '-') {
-            whereURI = cmdLine.resolveURI(uri);
+          // Check for and use a single commandline parameter
+          if (cmdLine.length == 1) {
+            // Assume the first arg is a URI if it is not a flag
+            var uri = cmdLine.getArgument(0);
+            if (uri != "" && uri[0] != '-') {
+              whereURI = cmdLine.resolveURI(uri);
+              if (whereURI)
+                whereURI = whereURI.spec;
+            }
+          }
+
+          // Check for the "url" flag
+          var uriFlag = cmdLine.handleFlagWithParam("url", false);
+          if (uriFlag) {
+            whereURI = cmdLine.resolveURI(uriFlag);
             if (whereURI)
               whereURI = whereURI.spec;
           }
-        }
-
-        // Check for the "url" flag
-        var uriFlag = cmdLine.handleFlagWithParam("url", false);
-        if (uriFlag) {
-          whereURI = cmdLine.resolveURI(uriFlag);
-          if (whereURI)
-            whereURI = whereURI.spec;
-        }
-      } catch (e) {}
-    }
+        } catch (e) {}
+      }
+      else {
+        // This window could have been opened by nsIBrowserDOMWindow.openURI
+        whereURI = window.arguments[0];
+      }
+    } 
 
     this.addTab(whereURI, true);
 
     // JavaScript Error Console
     if (Services.prefs.getBoolPref("browser.console.showInPanel")){
       let button = document.getElementById("tool-console");
       button.hidden = false;
     }
@@ -1146,17 +1151,18 @@ nsBrowserAccess.prototype = {
       }
     }
 
     let browser;
     if (aWhere == Ci.nsIBrowserDOMWindow.OPEN_NEWWINDOW) {
       let url = aURI ? aURI.spec : "about:blank";
       let newWindow = openDialog("chrome://browser/content/browser.xul", "_blank",
                                  "all,dialog=no", url, null, null, null);
-      browser = newWindow.Browser.selectedBrowser;
+      // since newWindow.Browser doesn't exist yet, just return null
+      return null;
     } else if (aWhere == Ci.nsIBrowserDOMWindow.OPEN_NEWTAB) {
       browser = Browser.addTab("about:blank", true, Browser.selectedTab).browser;
     } else { // OPEN_CURRENTWINDOW and illegal values
       browser = Browser.selectedBrowser;
     }
 
     try {
       let referrer;
@@ -1215,17 +1221,27 @@ const BrowserSearch = {
         // Not relevant
         break;
     }
   },
 
   get engines() {
     if (this._engines)
       return this._engines;
-    return this._engines = Services.search.getVisibleEngines({ });
+
+    let engines = Services.search.getVisibleEngines({ }).map(
+      function(item, index, array) {
+        return { 
+          label: item.name,
+          default: (item == Services.search.defaultEngine),
+          image: item.iconURI ? item.iconURI.spec : null
+        }
+    });
+
+    return this._engines = engines;
   },
 
   updatePageSearchEngines: function updatePageSearchEngines(aNode) {
     let items = Browser.selectedBrowser.searchEngines.filter(this.isPermanentSearchEngine);
     if (!items.length)
       return false;
 
     // XXX limit to the first search engine for now
@@ -1244,39 +1260,16 @@ const BrowserSearch = {
 
     this._engines = null;
   },
 
   isPermanentSearchEngine: function isPermanentSearchEngine(aEngine) {
     return !BrowserSearch.engines.some(function(item) {
       return aEngine.title == item.name;
     });
-  },
-
-  updateSearchButtons: function updateSearchButtons() {
-    let container = document.getElementById("search-buttons");
-    if (this._engines && container.hasChildNodes())
-      return;
-
-    // Clean the previous search engines button
-    while (container.hasChildNodes())
-      container.removeChild(container.lastChild);
-
-    let engines = this.engines;
-    for (let e = 0; e < engines.length; e++) {
-      let button = document.createElement("radio");
-      let engine = engines[e];
-      button.id = engine.name;
-      button.setAttribute("label", engine.name);
-      button.className = "searchengine";
-      if (engine.iconURI)
-        button.setAttribute("src", engine.iconURI.spec);
-      container.appendChild(button);
-      button.engine = engine;
-    }
   }
 };
 
 
 /** Watches for mouse events in chrome and sends them to content. */
 function ContentCustomClicker() {
 }
 
@@ -1387,16 +1380,19 @@ function IdentityHandler() {
   };
   this._staticStrings[this.IDENTITY_MODE_IDENTIFIED] = {
     encryption_label: Elements.browserBundle.getString("identity.encrypted2")
   };
   this._staticStrings[this.IDENTITY_MODE_UNKNOWN] = {
     encryption_label: Elements.browserBundle.getString("identity.unencrypted2")
   };
 
+  // Close the popup when reloading the page
+  document.getElementById("browsers").addEventListener("URLChanged", this, true);
+
   this._cacheElements();
 }
 
 IdentityHandler.prototype = {
   // Mode strings used to control CSS display
   IDENTITY_MODE_IDENTIFIED       : "verifiedIdentity", // High-quality identity information
   IDENTITY_MODE_DOMAIN_VERIFIED  : "verifiedDomain",   // Minimal SSL CA-signed domain verification
   IDENTITY_MODE_UNKNOWN          : "unknownIdentity",  // No trusted identity information
@@ -1607,34 +1603,46 @@ IdentityHandler.prototype = {
     this._identityPopup.hidden = true;
     this._identityBox.removeAttribute("open");
 
     BrowserUI.popPopup();
     BrowserUI.unlockToolbar();
   },
 
   toggle: function ih_toggle() {
+    // When the urlbar is active the identity button is used to show the
+    // list of search engines
+    if (Elements.urlbarState.getAttribute("mode") == "edit") {
+      CommandUpdater.doCommand("cmd_opensearch");
+      return;
+    }
+
     if (this._identityPopup.hidden)
       this.show();
     else
       this.hide();
   },
 
   /**
    * Click handler for the identity-box element in primary chrome.
    */
-  handleIdentityButtonEvent: function(event) {
-    event.stopPropagation();
+  handleIdentityButtonEvent: function(aEvent) {
+    aEvent.stopPropagation();
 
-    if ((event.type == "click" && event.button != 0) ||
-        (event.type == "keypress" && event.charCode != KeyEvent.DOM_VK_SPACE &&
-         event.keyCode != KeyEvent.DOM_VK_RETURN))
+    if ((aEvent.type == "click" && aEvent.button != 0) ||
+        (aEvent.type == "keypress" && aEvent.charCode != KeyEvent.DOM_VK_SPACE &&
+         aEvent.keyCode != KeyEvent.DOM_VK_RETURN))
       return; // Left click, space or enter only
 
     this.toggle();
+  },
+
+  handleEvent: function(aEvent) {
+    if (aEvent.type == "URLChanged" && !this._identityPopup.hidden)
+      this.hide();
   }
 };
 
 var gIdentityHandler;
 
 /**
  * Returns the singleton instance of the identity handler class.  Should always be
  * used instead of referencing the global variable directly or creating new instances
@@ -1826,17 +1834,16 @@ const gSessionHistoryObserver = {
     let urlbar = document.getElementById("urlbar-edit");
     if (urlbar) {
       // Clear undo history of the URL bar
       urlbar.editor.transactionManager.clear();
     }
   }
 };
 
-
 var MemoryObserver = {
   observe: function mo_observe() {
     window.QueryInterface(Ci.nsIInterfaceRequestor)
           .getInterface(Ci.nsIDOMWindowUtils).garbageCollect();
     Components.utils.forceGC();
   }
 };
 
--- a/mobile/chrome/content/browser.xul
+++ b/mobile/chrome/content/browser.xul
@@ -92,16 +92,17 @@
 
   <stringbundleset id="stringbundleset">
     <stringbundle id="bundle_browser" src="chrome://browser/locale/browser.properties"/>
     <stringbundle id="bundle_brand" src="chrome://branding/locale/brand.properties"/>
   </stringbundleset>
 
   <broadcasterset id="broadcasterset">
     <broadcaster id="bcast_contentShowing"/>
+    <broadcaster id="bcast_urlbarState" mode="view"/>
   </broadcasterset>
 
   <observerset id="observerset">
     <observes id="observe_contentShowing" element="bcast_contentShowing" attribute="disabled"/>
   </observerset>
 
   <commandset id="mainCommandSet">
     <!-- basic navigation -->
@@ -124,16 +125,17 @@
     <!-- bookmarking -->
     <command id="cmd_star" label="&star.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
 
     <!-- misc -->
     <command id="cmd_close" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_quit" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_menu" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_actions" oncommand="CommandUpdater.doCommand(this.id);"/>
+    <command id="cmd_opensearch" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_panel" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_bookmarks" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_history" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_sanitize" oncommand="CommandUpdater.doCommand(this.id);"/>
 
     <!-- screen/display -->
     <command id="cmd_fullscreen" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_zoomin" observes="bcast_contentShowing" oncommand="CommandUpdater.doCommand(this.id);"/>
@@ -227,36 +229,38 @@
                 <toolbar id="toolbar-main" class="panel-dark window-width">
 #ifdef MOZ_PLATFORM_MAEMO
                   <toolbarbutton id="tool-app-switch" class="button-image" oncommand="BrowserUI.switchTask();"/>
 #endif
                   <hbox id="urlbar-container" flex="1">
                     <box id="identity-box"
                          onclick="getIdentityHandler().handleIdentityButtonEvent(event);"
                          onkeypress="getIdentityHandler().handleIdentityButtonEvent(event);">
-                      <box id="urlbar-image-box" mousethrough="always">
+                      <box id="urlbar-image-box" mousethrough="always" observes="bcast_urlbarState">
                         <image id="urlbar-throbber"/>
+                        <image id="urlbar-magnifier" hidden="true"/>
                         <image id="urlbar-favicon" hidden="true"/>
                       </box>
                     </box>
                     <textbox id="urlbar-edit"
                              type="autocomplete"
                              autocompletesearch="history"
                              autocompletepopup="popup_autocomplete"
                              enablehistory="false"
                              maxrows="6"
                              completeselectedindex="true"
                              minresultsforpopup="0"
                              oncontextmenu="event.preventDefault();"
                              onsearchbegin="BrowserUI.updateAwesomeHeader(this.controller.searchString != '');"
                              emptytext="&urlbar.emptytext;"
                              flex="1"
                              ontextentered="BrowserUI.goToURI();"
+                             readonly="true"
                              clickSelectsAll="true"/>
-                    <hbox id="urlbar-icons" mode="view">
+                    <hbox id="urlbar-icons" observes="bcast_urlbarState">
                       <toolbarbutton id="tool-reload" class="urlbar-cap-button"
                                      oncommand="CommandUpdater.doCommand(event.shiftKey ? 'cmd_forceReload' : 'cmd_reload');"/>
                       <toolbarbutton id="tool-stop" class="urlbar-cap-button" command="cmd_stop"/>
                       <toolbarbutton id="tool-go" class="urlbar-cap-button" command="cmd_go"/>
                     </hbox>
                   </hbox>
                   <toolbarbutton id="tool-app-close" class="urlbar-button button-image" command="cmd_close"/>
                 </toolbar>
@@ -409,19 +413,19 @@
           </hbox>
           <notificationbox id="prefs-messages" flex="1">
             <richlistbox id="prefs-list" seltype="single" flex="1" onselect="this.ensureSelectedElementIsVisible()">
               <setting title="&about.title;" type="control">
                 <button id="prefs-about-button" label="&about.button;"
 #ifdef MOZ_OFFICIAL_BRANDING
 # these two point to the same page, this just matters for what shows up in the
 # URL bar
-                        oncommand="BrowserUI.newTab('about:firefox', true);"/>
+                        oncommand="BrowserUI.newTab('about:firefox');"/>
 #else
-                        oncommand="BrowserUI.newTab('about:fennec', true);"/>
+                        oncommand="BrowserUI.newTab('about:fennec');"/>
 #endif
               </setting>
               <setting id="prefs-uilanguage" title="&language.title;" type="control">
                 <menulist id="prefs-languages" oncommand="PreferencesView.updateLocale();">
                   <menupopup>
                     <menuitem id="prefs-languages-auto" label="&language.auto;" value="auto"/>
                   </menupopup>
                 </menulist>
@@ -498,29 +502,17 @@
         <toolbarbutton type="radio" group="awesome-header" label="&bookmarksHeader.label;" command="cmd_bookmarks" class="choice-bookmarks show-text"/>
         <toolbarbutton type="radio" group="awesome-header" label="&historyHeader.label;" command="cmd_history" class="choice-history show-text"/>
 #ifdef MOZ_SERVICES_SYNC
         <toolbarbutton type="radio" group="awesome-header" label="&desktopHeader.label;" command="cmd_remoteTabs" class="choice-remotetabs show-text"/>
 #endif
       </hbox>
 
       <!-- titlebar autocomplete results -->
-      <vbox id="popup_autocomplete" class="panel-dark" flex="1" onshow="BrowserUI._edit.showHistoryPopup();" hidden="true">
-        <arrowscrollbox id="autocomplete_navbuttons"
-                        style="-moz-user-focus: ignore;"
-                        align="center"
-                        flex="1"
-                        orient="horizontal">
-          <image class="tool-search"/>
-          <radiogroup id="search-buttons" class="toggle-dark" style="-moz-user-focus: ignore;"
-                      onclick="BrowserUI.doButtonSearch(event.target);">
-          </radiogroup>
-        </arrowscrollbox>
-      </vbox>
-
+      <vbox id="popup_autocomplete" class="panel-dark" flex="1" onshow="BrowserUI._edit.showHistoryPopup();" hidden="true"/>
       <placelist id="bookmarks-items" type="bookmarks" onopen="BookmarkList.openLink(event);" onhide="BrowserUI.updateStar();" flex="1" hidden="true"/>
       <historylist id="history-items" onopen="HistoryList.openLink(event);" flex="1" hidden="true"/>
       <remotetabslist id="remotetabs-items" onopen="RemoteTabsList.openLink(event)" flex="1" hidden="true"/>
     </vbox>
 
     <!-- options dialog for select form field -->
     <vbox id="select-container" hidden="true" pack="center">
       <spacer id="select-spacer" flex="1000"/>
@@ -529,18 +521,19 @@
         <hbox id="select-buttons" pack="center">
           <button id="select-buttons-done" class="button-dark" label="&selectHelper.done;" oncommand="SelectHelperUI.hide();"/>
         </hbox>
       </vbox>
       <spacer flex="1000"/>
     </vbox>
 
     <hbox id="menulist-container" class="window-width window-height context-block" top="0" left="0" hidden="true" flex="1">
-      <vbox id="menulist-popup" class="dialog-dark"> 
-        <richlistbox id="menulist-commands" onselect="MenuListHelperUI.selectByIndex(this.selectedIndex)"/>
+      <vbox id="menulist-popup" class="dialog-dark">
+        <label id="menulist-title" crop="center" flex="1"/>
+        <richlistbox id="menulist-commands" onclick="if (event.target != this) MenuListHelperUI.selectByIndex(this.selectedIndex);" flex="1"/>
       </vbox>
     </hbox>
 
     <hbox id="context-container" class="window-width window-height context-block" top="0" left="0" hidden="true">
       <vbox id="context-popup" class="dialog-dark">
         <hbox id="context-header">
           <label id="context-hint" crop="center" flex="1"/>
         </hbox>
@@ -552,16 +545,22 @@
             <label value="&contextSaveImage.label;"/>
           </richlistitem>
           <richlistitem class="context-command" id="context-share-link" type="link-shareable" onclick="ContextCommands.shareLink();">
             <label value="&contextShareLink.label;"/>
           </richlistitem>
           <richlistitem class="context-command" id="context-share-image" type="image-shareable" onclick="ContextCommands.shareMedia();">
             <label value="&contextShareImage.label;"/>
           </richlistitem>
+          <richlistitem class="context-command" id="context-save-video" type="video" onclick="ContextCommands.saveImage();">
+            <label value="&contextSaveVideo.label;"/>
+          </richlistitem>
+          <richlistitem class="context-command" id="context-share-video" type="video-shareable" onclick="ContextCommands.shareMedia();">
+            <label value="&contextShareVideo.label;"/>
+          </richlistitem>
           <richlistitem class="context-command" id="context-editbookmark" type="edit-bookmark" onclick="ContextCommands.editBookmark();">
             <label value="&contextEditBookmark.label;"/>
           </richlistitem>
           <richlistitem class="context-command" id="context-removebookmark" type="edit-bookmark" onclick="ContextCommands.removeBookmark();">
             <label value="&contextRemoveBookmark.label;"/>
           </richlistitem>
         </richlistbox>
       </vbox>
--- a/mobile/chrome/content/content.js
+++ b/mobile/chrome/content/content.js
@@ -403,16 +403,17 @@ Content.prototype = {
             keyCode: json.keyCode,
             charCode: json.charCode
           });
         }
         break;
 
       case "Browser:MouseDown":
         this._overlayTimeout.clear();
+        this._contextTimeout.clear();
 
         let element = elementFromPoint(x, y);
         if (!element)
           return;
 
 // XXX somehow this always take up the entire screen
 /*        if (element.mozMatchesSelector("*:link,*:visited,*:link *,*:visited *,*[role=button],button,input,option,select,textarea,label")) {
           this._overlayTimeout.once(kTapOverlayTimeout, function() {
@@ -524,17 +525,17 @@ Content.prototype = {
         let point = (new Rect(rect.left, rect.top, rect.width, rect.height)).center();
         aX = point.x;
         aY = point.y;
       }
     }
 
     let scrollOffset = Util.getScrollOffset(content);
     let windowUtils = Util.getWindowUtils(content);
-    windowUtils.sendMouseEvent(aName, aX - scrollOffset.x, aY - scrollOffset.y, 0, 1, 0, true);
+    windowUtils.sendMouseEventToWindow(aName, aX - scrollOffset.x, aY - scrollOffset.y, 0, 1, 0, true);
   },
 
   startLoading: function startLoading() {
     this._contextTimeout.clear();
     this._overlayTimeout.clear();
     this._loading = true;
     this._coalescer.start();
   },
@@ -710,18 +711,20 @@ var ContextHandler = {
 
     let popupNode = aEvent.originalTarget;
 
     // Do checks for nodes that never have children.
     if (popupNode.nodeType == Ci.nsIDOMNode.ELEMENT_NODE) {
       // See if the user clicked on an image.
       if (popupNode instanceof Ci.nsIImageLoadingContent && popupNode.currentURI) {
         state.types.push("image");
-        state.mediaURL = popupNode.currentURI.spec;
-        state.label = state.mediaURL;
+        state.label = state.mediaURL = popupNode.currentURI.spec;
+      } else if (popupNode instanceof Ci.nsIDOMHTMLVideoElement) {
+        state.types.push("video");
+        state.label = state.mediaURL = popupNode.src;
       }
     }
 
     let elem = popupNode;
     while (elem) {
       if (elem.nodeType == Ci.nsIDOMNode.ELEMENT_NODE) {
         // Link?
         if ((elem instanceof Ci.nsIDOMHTMLAnchorElement && elem.href) ||
@@ -776,22 +779,24 @@ ContextHandler.registerType("link-saveab
   let protocol = aState.linkProtocol;
   return (protocol && protocol != "mailto" && protocol != "javascript" && protocol != "news" && protocol != "snews");
 });
 
 ContextHandler.registerType("link-shareable", function(aState, aElement) {
   return Util.isShareableScheme(aState.linkProtocol);
 });
 
-ContextHandler.registerType("image-shareable", function(aState, aElement) {
-  if (!aState.mediaURL)
-    return false;
+["image", "video"].forEach(function(aType) {
+  ContextHandler.registerType(aType+"-shareable", function(aState, aElement) {
+    if (aState.types.indexOf(aType) == -1)
+      return false;
 
-  let protocol = ContextHandler._getProtocol(ContextHandler._getURI(aState.mediaURL));
-  return Util.isShareableScheme(protocol);
+    let protocol = ContextHandler._getProtocol(ContextHandler._getURI(aState.mediaURL));
+    return Util.isShareableScheme(protocol);
+  });
 });
 
 ContextHandler.registerType("image-loaded", function(aState, aElement) {
   if (aState.types.indexOf("image") != -1) {
     let request = aElement.getRequest(Ci.nsIImageLoadingContent.CURRENT_REQUEST);
     if (request && (request.imageStatus & request.STATUS_SIZE_AVAILABLE))
       return true;
   }
--- a/mobile/chrome/content/downloads.js
+++ b/mobile/chrome/content/downloads.js
@@ -32,17 +32,21 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 Components.utils.import("resource://gre/modules/DownloadUtils.jsm");
 
+#ifdef ANDROID
+const URI_GENERIC_ICON_DOWNLOAD = "drawable://alertdownloads";
+#else
 const URI_GENERIC_ICON_DOWNLOAD = "chrome://browser/skin/images/alert-downloads-30.png";
+#endif
 
 var DownloadsView = {
   _initialized: false,
   _list: null,
   _dlmgr: null,
   _progress: null,
 
   _initStatement: function dv__initStatement() {
@@ -417,28 +421,30 @@ var DownloadsView = {
         return;
 
       let download = aSubject.QueryInterface(Ci.nsIDownload);
       let strings = Elements.browserBundle;
       var notifier = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService);
 
       if (aTopic == "dl-start") {
         notifier.showAlertNotification(URI_GENERIC_ICON_DOWNLOAD, strings.getString("alertDownloads"),
-                                       strings.getFormattedString("alertDownloadsStart", [download.displayName]), false, "", null);
+                                       strings.getFormattedString("alertDownloadsStart", [download.displayName]), false, "", null,
+                                       download.target.spec.replace("file:", "download:"));
       }
       else {
         let observer = {
           observe: function (aSubject, aTopic, aData) {
             if (aTopic == "alertclickcallback")
               BrowserUI.showPanel("downloads-container");
           }
         };
 
         notifier.showAlertNotification(URI_GENERIC_ICON_DOWNLOAD, strings.getString("alertDownloads"),
-                                       strings.getFormattedString("alertDownloadsDone", [download.displayName]), true, "", observer);
+                                       strings.getFormattedString("alertDownloadsDone", [download.displayName]), true, "", observer,
+                                       download.target.spec.replace("file:", "download:"));
       }
     }
   },
 
   QueryInterface: function (aIID) {
     if (!aIID.equals(Ci.nsIObserver) &&
         !aIID.equals(Ci.nsISupportsWeakReference) &&
         !aIID.equals(Ci.nsISupports))
--- a/mobile/chrome/content/extensions.js
+++ b/mobile/chrome/content/extensions.js
@@ -35,17 +35,21 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 const PREFIX_ITEM_URI = "urn:mozilla:item:";
 const PREFIX_NS_EM = "http://www.mozilla.org/2004/em-rdf#";
 
 const PREF_GETADDONS_MAXRESULTS = "extensions.getAddons.maxResults";
 
+#ifdef ANDROID
+const URI_GENERIC_ICON_XPINSTALL = "drawable://alertaddons";
+#else
 const URI_GENERIC_ICON_XPINSTALL = "chrome://browser/skin/images/alert-addons-30.png";
+#endif
 
 XPCOMUtils.defineLazyGetter(this, "AddonManager", function() {
   Cu.import("resource://gre/modules/AddonManager.jsm");
   return AddonManager;
 });
 
 XPCOMUtils.defineLazyGetter(this, "AddonRepository", function() {
   Cu.import("resource://gre/modules/AddonRepository.jsm");
@@ -779,11 +783,11 @@ AddonInstallListener.prototype = {
       observe: function (aSubject, aTopic, aData) {
         if (aTopic == "alertclickcallback")
           BrowserUI.showPanel("addons-container");
       }
     };
 
     let alerts = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService);
     alerts.showAlertNotification(URI_GENERIC_ICON_XPINSTALL, strings.getString("alertAddons"),
-                                 message, true, "", observer);
+                                 message, true, "", observer, "addons");
   }
 };
--- a/mobile/chrome/content/forms.js
+++ b/mobile/chrome/content/forms.js
@@ -60,16 +60,19 @@ function FormAssistant() {
   addMessageListener("FormAssist:Closed", this);
   addMessageListener("FormAssist:Previous", this);
   addMessageListener("FormAssist:Next", this);
   addMessageListener("FormAssist:ChoiceSelect", this);
   addMessageListener("FormAssist:ChoiceChange", this);
   addMessageListener("FormAssist:AutoComplete", this);
 
   addEventListener("keyup", this, false);
+
+  // change on rotation/resize
+  addEventListener("resize", this, false);
 };
 
 FormAssistant.prototype = {
   _selectWrapper: null,
 
   get currentElement() {
     return this._elements[this._currentIndex];
   },
@@ -181,61 +184,64 @@ FormAssistant.prototype = {
     }
     return false;
   },
 
   handleEvent: function formHelperHandleEvent(aEvent) {
     if (!this._enabled || !this.currentElement)
       return;
 
-    let currentElement = this.currentElement;
-    switch (aEvent.keyCode) {
-      case aEvent.DOM_VK_DOWN:
-        if (currentElement instanceof HTMLInputElement && !this._isAutocomplete(currentElement)) {
-          if (this._hasKeyListener(currentElement))
-            return;
-        }
-        else if (currentElement instanceof HTMLTextAreaElement) {
-          let existSelection = currentElement.selectionEnd - currentElement.selectionStart;
-          let isEnd = (currentElement.textLength == currentElement.selectionEnd);
-          if (!isEnd || existSelection)
-            return;
-        }
+    // change zoom on resize/rotation
+    if (aEvent.type == "resize") {
+      sendAsyncMessage("FormAssist:Resize");
+    } else {
+      let currentElement = this.currentElement;
+      switch (aEvent.keyCode) {
+        case aEvent.DOM_VK_DOWN:
+          if (currentElement instanceof HTMLInputElement && !this._isAutocomplete(currentElement)) {
+            if (this._hasKeyListener(currentElement))
+              return;
+          }
+          else if (currentElement instanceof HTMLTextAreaElement) {
+            let existSelection = currentElement.selectionEnd - currentElement.selectionStart;
+            let isEnd = (currentElement.textLength == currentElement.selectionEnd);
+            if (!isEnd || existSelection)
+              return;
+          }
 
-        this.currentIndex++;
-        break;
+          this.currentIndex++;
+          break;
 
-      case aEvent.DOM_VK_UP:
-        if (currentElement instanceof HTMLInputElement && !this._isAutocomplete(currentElement)) {
-          if (this._hasKeyListener(currentElement))
-            return;
-        }
-        else if (currentElement instanceof HTMLTextAreaElement) {
-          let existSelection = currentElement.selectionEnd - currentElement.selectionStart;
-          let isStart = (currentElement.selectionEnd == 0);
-          if (!isStart || existSelection)
-            return;
-        }
+        case aEvent.DOM_VK_UP:
+          if (currentElement instanceof HTMLInputElement && !this._isAutocomplete(currentElement)) {
+            if (this._hasKeyListener(currentElement))
+              return;
+          }
+          else if (currentElement instanceof HTMLTextAreaElement) {
+            let existSelection = currentElement.selectionEnd - currentElement.selectionStart;
+            let isStart = (currentElement.selectionEnd == 0);
+            if (!isStart || existSelection)
+              return;
+          }
 
-        this.currentIndex--;
-        break;
+          this.currentIndex--;
+          break;
 
-      case aEvent.DOM_VK_RETURN:
-        break;
+        case aEvent.DOM_VK_RETURN:
+          break;
 
-      default:
-        if (this._isAutocomplete(aEvent.target)) {
-          sendAsyncMessage("FormAssist:AutoComplete", this._getJSON());
-        }
-        break;
-    }
+        default:
+          if (this._isAutocomplete(aEvent.target))
+            sendAsyncMessage("FormAssist:AutoComplete", this._getJSON());
+          break;
+      }
 
-    let caretRect = this._getCaretRect();
-    if (!caretRect.isEmpty()) {
-      sendAsyncMessage("FormAssist:Update", { caretRect: caretRect });
+      let caretRect = this._getCaretRect();
+      if (!caretRect.isEmpty())
+        sendAsyncMessage("FormAssist:Update", { caretRect: caretRect });
     }
   },
 
   _isAutocomplete: function formHelperIsAutocomplete(aElement) {
     if (aElement instanceof HTMLInputElement) {
       let autocomplete = aElement.getAttribute("autocomplete");
       let allowedValues = ["off", "false", "disabled"];
       if (allowedValues.indexOf(autocomplete) == -1)
--- a/mobile/chrome/content/preferences.js
+++ b/mobile/chrome/content/preferences.js
@@ -201,17 +201,17 @@ var PreferencesView = {
     let url = Browser.getHomePage();
     let value = "default";
     let display = url;
     try {
       display = Services.prefs.getComplexValue("browser.startup.homepage.title", Ci.nsIPrefLocalizedString).data;
     } catch (e) { }
 
     switch (url) {
-      case "about:blank":
+      case "about:empty":
         value = "none";
         display = null;
         break;
       case "about:home":
         value = "default";
         display = null;
         break;
       default:
@@ -237,17 +237,17 @@ var PreferencesView = {
     let options = document.getElementById("prefs-homepage-options");
     let value = options.selectedItem.value;
 
     let url = "about:home";
     let display = null;
 
     switch (value) {
       case "none":
-        url = "about:blank";
+        url = "about:empty";
         break;
       case "default":
         url = "about:home";
         break;
       case "currentpage":
         url = Browser.selectedBrowser.currentURI.spec;
         display = Browser.selectedBrowser.contentTitle || url;
         break;
--- a/mobile/chrome/content/tabs.xml
+++ b/mobile/chrome/content/tabs.xml
@@ -5,17 +5,17 @@
     xmlns:xbl="http://www.mozilla.org/xbl"
     xmlns:html="http://www.w3.org/1999/xhtml"
     xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <binding id="documenttab">
     <content>
       <xul:stack anonid="page" class="documenttab-container" flex="1">
         <html:canvas anonid="canvas" class="documenttab-canvas" left="8" width="106" height="64" moz-opaque="true"
-          onclick="document.getBindingParent(this)._onClick()"/>
+          onclick="document.getBindingParent(this)._onClick()" xbl:inherits="selected"/>
         <xul:hbox left="0" top="10" height="64" width="55" align="center" onclick="document.getBindingParent(this)._close()">
           <xul:image anonid="close" class="documenttab-close" mousethrough="always"/>
         </xul:hbox>
       </xul:stack>
     </content>
     
    <implementation>
       <method name="_onClick">
--- a/mobile/chrome/jar.mn
+++ b/mobile/chrome/jar.mn
@@ -40,18 +40,18 @@ chrome.jar:
 % content branding %content/branding/
   content/sanitize.js                  (content/sanitize.js)
 * content/BrowserView.js               (content/BrowserView.js)
 * content/InputHandler.js              (content/InputHandler.js)
 * content/Util.js                      (content/Util.js)
   content/forms.js                     (content/forms.js)
 * content/preferences.js               (content/preferences.js)
   content/exceptions.js                (content/exceptions.js)
-  content/extensions.js                (content/extensions.js)
-  content/downloads.js                 (content/downloads.js)
+* content/extensions.js                (content/extensions.js)
+* content/downloads.js                 (content/downloads.js)
   content/console.js                   (content/console.js)
   content/prompt/alert.xul             (content/prompt/alert.xul)
   content/prompt/confirm.xul           (content/prompt/confirm.xul)
   content/prompt/prompt.xul            (content/prompt/prompt.xul)
   content/prompt/promptPassword.xul    (content/prompt/promptPassword.xul)
   content/prompt/select.xul            (content/prompt/select.xul)
   content/prompt/prompt.js             (content/prompt/prompt.js)
   content/share.xul                    (content/share.xul)
--- a/mobile/chrome/tests/Makefile.in
+++ b/mobile/chrome/tests/Makefile.in
@@ -43,16 +43,17 @@ relativesrcdir  = mobile/chrome
 
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 _BROWSER_FILES = \
   head.js \
   remote_head.js \
   remote_forms.js \
+  browser_awesomescreen.js \
   browser_blank_01.html \
   browser_blank_02.html \
   browser_bookmarks.js \
   browser_bookmarks_star.js \
   browser_bookmarks_tags.js \
   browser_click_content.html \
   browser_click_content.js \
   browser_contacts.js \
new file mode 100644
--- /dev/null
+++ b/mobile/chrome/tests/browser_awesomescreen.js
@@ -0,0 +1,59 @@
+/*
+ * Bug 436069 - Fennec browser-chrome tests to verify correct navigation into the
+ *              differents part of the awesome panel
+ */
+
+let gTests = [];
+let gCurrentTest = null;
+
+function test() {
+  // The "runNextTest" approach is async, so we need to call "waitForExplicitFinish()"
+  // We call "finish()" when the tests are finished
+  waitForExplicitFinish();
+
+  // Start the tests
+  setTimeout(runNextTest, 200);
+}
+
+//------------------------------------------------------------------------------
+// Iterating tests by shifting test out one by one as runNextTest is called.
+function runNextTest() {
+  // Run the next test until all tests completed
+  if (gTests.length > 0) {
+    gCurrentTest = gTests.shift();
+    info(gCurrentTest.desc);
+    gCurrentTest.run();
+  }
+  else {
+    finish();
+  }
+}
+
+//------------------------------------------------------------------------------
+// Case: Test opening the awesome panel and checking the urlbar readonly state
+gTests.push({
+  desc: "Test opening the awesome panel and checking the urlbar readonly state",
+
+  run: function() {
+    is(BrowserUI._edit.readOnly, true, "urlbar input textbox should be readonly");
+
+    let popup = document.getElementById("popup_autocomplete");
+    popup.addEventListener("popupshown", function(aEvent) {
+      popup.removeEventListener("popupshown", arguments.callee, true);
+      gCurrentTest.onPopupReady();
+    }, true);
+
+    BrowserUI.doCommand("cmd_openLocation");
+  },
+
+  onPopupReady: function() {
+    is(Elements.urlbarState.getAttribute("mode"), "edit", "bcast_urlbarState mode attribute should be equal to 'edit'");
+    is(BrowserUI._edit.readOnly, true, "urlbar input textbox be readonly");
+
+    // Simulate a new opening of the awesomescreen
+    BrowserUI.doCommand("cmd_openLocation");
+    is(BrowserUI._edit.readOnly, false, "urlbar input textbox should not be readonly");
+
+    runNextTest();
+  }
+});
--- a/mobile/components/AboutRedirector.js
+++ b/mobile/components/AboutRedirector.js
@@ -36,16 +36,21 @@
  *
  * ***** END LICENSE BLOCK ***** */
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 let modules = {
+  // about:blank has some bad loading behavior we can avoid, if we use an alias
+  empty: {
+    uri: "about:blank",
+    privileged: false
+  },
   fennec: {
     uri: "chrome://browser/content/about.xhtml",
     privileged: true
   },
   // about:firefox is an alias for about:fennec
   get firefox() this.fennec,
 
   firstrun: {
@@ -100,16 +105,22 @@ AboutGeneric.prototype = {
     }
 
     channel.originalURI = aURI;
 
     return channel;
   }
 };
 
+function AboutEmpty() {}
+AboutEmpty.prototype = {
+  __proto__: AboutGeneric.prototype,
+  classID: Components.ID("{433d2d75-5923-49b0-854d-f37267b03dc7}")
+}
+
 function AboutFirstrun() {}
 AboutFirstrun.prototype = {
   __proto__: AboutGeneric.prototype,
   classID: Components.ID("{077ea23e-0f22-4168-a744-8e444b560197}")
 }
 
 function AboutFennec() {}
 AboutFennec.prototype = {
@@ -136,11 +147,11 @@ AboutCertError.prototype = {
 }
 
 function AboutHome() {}
 AboutHome.prototype = {
   __proto__: AboutGeneric.prototype,
   classID: Components.ID("{b071364f-ab68-4669-a9db-33fca168271a}")
 }
 
-const components = [AboutFirstrun, AboutFennec, AboutRights,
+const components = [AboutEmpty, AboutFirstrun, AboutFennec, AboutRights,
                     AboutCertError, AboutFirefox, AboutHome];
 const NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
--- a/mobile/components/HelperAppDialog.js
+++ b/mobile/components/HelperAppDialog.js
@@ -90,16 +90,17 @@ HelperAppLauncherDialog.prototype = {
                                              title, message,
                                              flags, save, open, nothing,
                                              null, {});
 
       if (choice == 0) {
         aLauncher.saveToDisk(null, false);
       }
       else if (choice == 1) {
+        aLauncher.MIMEInfo.preferredAction = Ci.nsIMIMEInfo.useSystemDefault;
         aLauncher.launchWithApplication(null, false);
       }
       else {
         try {
           aLauncher.cancel(NS_BINDING_ABORTED);
         } catch(e) {} 
       }
     } else {
--- a/mobile/components/Makefile.in
+++ b/mobile/components/Makefile.in
@@ -56,25 +56,30 @@ EXTRA_PP_COMPONENTS = \
         Sidebar.js \
         SessionStore.js \
         $(NULL)
 
 EXTRA_COMPONENTS = \
         MobileComponents.manifest \
         BrowserStartup.js \
         GeolocationPrompt.js \
-        AlertsService.js \
         XPIDialogService.js \
         DownloadManagerUI.js \
         HelperAppDialog.js \
         PromptService.js \
         BrowserCLH.js \
         ContentDispatchChooser.js \
         AutoCompleteCache.js \
         AddonUpdateService.js \
         FormAutoComplete.js \
         LoginManager.js \
 	$(NULL)
 
+ifndef ANDROID
+EXTRA_COMPONENTS += AlertsService.js
+endif
+
+ifneq (Android,$(OS_TARGET))
 DIRS =  phone \
         $(NULL)
+endif
 
 include $(topsrcdir)/config/rules.mk
--- a/mobile/components/MobileComponents.manifest
+++ b/mobile/components/MobileComponents.manifest
@@ -1,23 +1,23 @@
 # AboutRedirector.js
+component {433d2d75-5923-49b0-854d-f37267b03dc7} AboutRedirector.js
+contract @mozilla.org/network/protocol/about;1?what=empty {433d2d75-5923-49b0-854d-f37267b03dc7}
 component {077ea23e-0f22-4168-a744-8e444b560197} AboutRedirector.js
 contract @mozilla.org/network/protocol/about;1?what=firstrun {077ea23e-0f22-4168-a744-8e444b560197}
 component {842a6d11-b369-4610-ba66-c3b5217e82be} AboutRedirector.js
 contract @mozilla.org/network/protocol/about;1?what=fennec {842a6d11-b369-4610-ba66-c3b5217e82be}
 component {dd40c467-d206-4f22-9215-8fcc74c74e38} AboutRedirector.js
 contract @mozilla.org/network/protocol/about;1?what=firefox {dd40c467-d206-4f22-9215-8fcc74c74e38}
 component {3b988fbf-ec97-4e1c-a5e4-573d999edc9c} AboutRedirector.js
 contract @mozilla.org/network/protocol/about;1?what=rights {3b988fbf-ec97-4e1c-a5e4-573d999edc9c}
 component {972efe64-8ac0-4e91-bdb0-22835d987815} AboutRedirector.js
 contract @mozilla.org/network/protocol/about;1?what=certerror {972efe64-8ac0-4e91-bdb0-22835d987815}
 component {b071364f-ab68-4669-a9db-33fca168271a} AboutRedirector.js
 contract @mozilla.org/network/protocol/about;1?what=home {b071364f-ab68-4669-a9db-33fca168271a}
-component {d503134a-f6f3-4824-bc3c-09c123177944} AboutRedirector.js
-contract @mozilla.org/network/protocol/about;1?what=sync-tabs {d503134a-f6f3-4824-bc3c-09c123177944}
 
 # DirectoryProvider.js
 component {ef0f7a87-c1ee-45a8-8d67-26f586e46a4b} DirectoryProvider.js
 contract @mozilla.org/browser/directory-provider;1 {ef0f7a87-c1ee-45a8-8d67-26f586e46a4b}
 category xpcom-directory-providers browser-directory-provider @mozilla.org/browser/directory-provider;1
 
 # Sidebar.js
 component {22117140-9c6e-11d3-aaf1-00805f8a4905} Sidebar.js
--- a/mobile/confvars.sh
+++ b/mobile/confvars.sh
@@ -31,16 +31,17 @@
 # decision by deleting the provisions above and replace them with the notice
 # and other provisions required by the GPL or the LGPL. If you do not delete
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 MOZ_APP_NAME=fennec
+MOZ_APP_UA_NAME=Fennec
 MOZ_BRANDING_DIRECTORY=mobile/branding/nightly
 MOZ_OFFICIAL_BRANDING_DIRECTORY=mobile/branding/official
 
 # MOZ_APP_DISPLAYNAME is set by branding/configure.sh
 
 case "$target" in
 *-wince*)
     . ${srcdir}/${MOZ_BUILD_APP}/winmo-version.txt
--- a/mobile/default-version.txt
+++ b/mobile/default-version.txt
@@ -1,1 +1,1 @@
-MOZ_APP_VERSION=2.0a1pre
+MOZ_APP_VERSION=2.0b1pre
--- a/mobile/locales/en-US/chrome/browser.dtd
+++ b/mobile/locales/en-US/chrome/browser.dtd
@@ -85,16 +85,18 @@
 <!ENTITY consoleErrFile.label      "Source File:">
 <!ENTITY consoleErrLine.label      "Line:">
 <!ENTITY consoleErrColumn.label    "Column:">
 
 <!ENTITY contextOpenInNewTab.label    "Open Link in New Tab">
 <!ENTITY contextSaveImage.label       "Save Image">
 <!ENTITY contextShareLink.label       "Share Link">
 <!ENTITY contextShareImage.label      "Share Image">
+<!ENTITY contextSaveVideo.label       "Save Video">
+<!ENTITY contextShareVideo.label      "Share Video">
 <!ENTITY contextEditBookmark.label    "Edit">
 <!ENTITY contextRemoveBookmark.label  "Remove">
 
 <!ENTITY pageactions.saveas.pdf      "Save As PDF">
 <!ENTITY pageactions.share.page      "Share Page">
 <!ENTITY pageactions.password.forget "Forget Password">
 <!ENTITY pageactions.reset           "Clear Site Preferences">
 <!ENTITY pageactions.findInPage      "Find In Page">
--- a/mobile/locales/en-US/chrome/browser.properties
+++ b/mobile/locales/en-US/chrome/browser.properties
@@ -149,8 +149,10 @@ pageactions.password=Password
 
 # Helper App Dialog (Save/Open)
 helperApp.title=Opening File
 helperApp.prompt=What would you like to do with:
 helperApp.open=Open
 helperApp.save=Save
 helperApp.nothing=Nothing
 
+# Open Search
+opensearch.searchWith=Search With:
--- a/mobile/themes/core/browser.css
+++ b/mobile/themes/core/browser.css
@@ -214,20 +214,33 @@ toolbarbutton.urlbar-cap-button {
   background: url("images/leftcapSSL-active-64.png");
 }
 
 #identity-box[mode="verifiedDomain"]:hover:active:-moz-locale-dir(rtl),
 #identity-box[mode="verifiedDomain"][open]:-moz-locale-dir(rtl) {
   background: url("images/rightcapSSL-active-64.png");
 }
 
+#urlbar-image-box[mode=edit] > #urlbar-favicon,
+#urlbar-image-box[mode=edit] > #urlbar-throbber {
+  display: none;
+}
+
 #urlbar-throbber[loading] {
   list-style-image: url("chrome://browser/skin/images/throbber.png");
 }
 
+#urlbar-magnifier {
+  list-style-image: url("chrome://browser/skin/images/navigation-magnifier-30.png");
+}
+
+#urlbar-image-box[mode=edit] > #urlbar-magnifier {
+  display: block !important;
+}
+
 #urlbar-favicon {
   width: 32px;
   height: 32px;
 }
 
 #urlbar-favicon[src=""] {
   list-style-image: url("chrome://browser/skin/images/favicon-default-30.png");
 }
@@ -239,29 +252,29 @@ toolbarbutton.urlbar-cap-button {
   margin: 0 !important;
   padding: 0 !important;
   border: none !important;
   border-top: 1px solid #262629 !important;
   border-bottom: 3px solid #262629 !important;
   -moz-border-radius: 0;
 }
 
+#urlbar-edit:not([open]):hover:active {
+  background-color: #8db8d8;
+}
+
 #urlbar-edit > hbox > .textbox-input-box {
   margin: 0;
 }
 
 #urlbar-edit > hbox > hbox > .textbox-input {
   min-height: 60px;
   text-indent: 3px;
 }
 
-#urlbar-edit:not([open]):hover:active {
-  background-color: #8db8d8;
-}
-
 /* make sure this endcap matches the other endcap */
 #urlbar-icons {
   min-height: 64px;
   min-width: 64px;
   background: url("images/rightcap-default-64.png") top right no-repeat;
   -moz-box-pack: center;
 }
 
@@ -757,16 +770,17 @@ placeitem > .bookmark-manage > image {
   max-height: 32px;
   /* margin-top = (1 - title's line-height) * title's font-size */
   margin-top: 5px;
   margin-bottom: 0;
   -moz-margin-end: 16px;
   -moz-margin-start: 8px;
 }
 
+.autocomplete-item-label > image[src=""],
 placeitem[src=""] .bookmark-item-label > image {
   list-style-image: url(chrome://mozapps/skin/places/defaultFavicon.png);
 }
 
 .autocomplete-item-label > vbox > label,
 .bookmark-item-label > vbox > label {
   -moz-margin-start: 1px;
 }
@@ -859,18 +873,16 @@ autocompleteresult.noresults > .autocomp
     font-size: 18px !important;
   }
 }
 
 #awesome-header > toolbarbutton:last-child {
   border-right-width: 0;
 }
 
-#awesome-header > toolbarbutton:hover,
-#awesome-header > toolbarbutton:hover,
 #awesome-header > toolbarbutton:hover:active,
 #awesome-header > toolbarbutton[checked="true"] {
   border-color: #36373b !important;
   color: white !important;
   background: -moz-radial-gradient(#757575, #636363, #666769) !important;
 }
 
 #awesome-header > toolbarbutton[checked="true"],
@@ -972,42 +984,42 @@ autocompleteresult.noresults > .autocomp
 
 box[type="documenttab"] {
   /* display:block allow us to change the line-height, it won't work otherwise */
   display: block;
   width: 128px;
   line-height: 0;
 }
 
-box[type="documenttab"] .documenttab-canvas {
+.documenttab-canvas {
   /* keep the unselected thumbnails aligned with the selected one */
   border: 8px solid #36373b;
   background-color: white;
 }
 
-box[type="documenttab"][selected="true"] .documenttab-canvas {
+.documenttab-canvas[selected="true"] {
   border: 8px solid;
   -moz-border-radius: 3px;
   -moz-border-top-colors: #8db8d8 #8db8d8 #8db8d8 #8db8d8 #36373b;
   -moz-border-right-colors: #8db8d8 #8db8d8 #8db8d8 #8db8d8 #36373b;
   -moz-border-bottom-colors: #8db8d8 #8db8d8 #8db8d8 #8db8d8 #36373b;
   -moz-border-left-colors: #8db8d8 #8db8d8 #8db8d8 #8db8d8 #36373b;
 }
 
-box[type="documenttab"] .documenttab-close {
+.documenttab-close {
   width: 40px;
   height: 40px;
   list-style-image: url("chrome://browser/skin/images/close-default-40.png");
 }
 
-box[type="documenttab"] hbox:hover:active .documenttab-close {
+hbox:hover:active > .documenttab-close {
   list-style-image: url("chrome://browser/skin/images/close-active-40.png");
 }
 
-box[type="documenttab"]:only-child .documenttab-close {
+box[type="documenttab"]:only-child > stack > hbox > .documenttab-close {
   display: none;
 }
 
 #newtab-button {
   list-style-image: url("images/newtab-default-64.png");
 }
 
 #newtab-button:hover:active {
@@ -1504,27 +1516,46 @@ pageaction:hover:active > vbox > .pageac
 
 /* menulist popup ---------------------------------------------------------- */
 #menulist-popup {
   border: none;
   padding: 1px;
   -moz-border-radius: 8px;
 }
 
+#menulist-popup > #menulist-title {
+  padding: 12px 4px 4px 4px;
+  font-size: 18px;
+}
+
+#menulist-popup > #menulist-title[value=""] {
+  display: none;
+}
+
 #menulist-commands {
   border: 1px solid rgb(207,207,207);
   -moz-border-radius: 8px;
 }
 
+#menulist-popup > label:not([value=""]) + #menulist-commands {
+  -moz-border-radius-topleft: 0px;
+  -moz-border-radius-topright: 0px;
+}
+
 .menulist-command {
   -moz-box-align: center;
   background-color: rgb(245,245,245);
   min-width: 200px; /* keep the command from being too narrow */
 }
 
+.menulist-command > image {
+  width: 32px;
+  height: 32px;
+}
+
 .menulist-command:first-child {
   background: -moz-linear-gradient(top, rgb(255,255,255), rgb(245,245,245));
   -moz-border-radius: 8px 8px 0 0;
 }
 
 .menulist-command:last-child {
   background: -moz-linear-gradient(top, rgb(245,245,245), rgb(215,215,215));
   -moz-border-radius: 0 0 8px 8px;
@@ -1533,19 +1564,31 @@ pageaction:hover:active > vbox > .pageac
 .menulist-command:first-child:last-child {
   -moz-border-radius: 8px;
 }
 
 .menulist-command:hover:active {
   background: #8db8d8;
 }
 
-.menulist-command[selected="true"] {
+.menulist-command.selected {
+  background: #8db8d8;
   pointer-events: none;
-  background: #8db8d8;
+}
+
+.menulist-command.selected > image {
+  width: 30px;
+  height: 30px;
+  list-style-image: url("chrome://browser/skin/images/check-30.png");
+  margin-right: 2px;
+  margin-top: 2px;
+}
+
+.menulist-command:not(.selected) > image[src=""] {
+  visibility: hidden;
 }
 
 /* context popup ----------------------------------------------------------- */
 #context-popup {
   /* Remove some dialog-dark styles */
   padding: 8px 0 0 0;
   border: none;
 }