Merge from mozilla-central to mozilla-inbound
authorMatt Brubeck <mbrubeck@mozilla.com>
Mon, 26 Sep 2011 10:44:16 -0700
changeset 77598 89fb82b4b6bcecbf2b457981162672b3db8eb720
parent 77597 d99fd9c7975469522c6edbb06577c8a9a01ccf93 (current diff)
parent 77570 42f80b4629c212f4bade981660d879396e9a6a0c (diff)
child 77599 87e488a819a6216911de0fbbc739c1e33394611c
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
milestone9.0a1
Merge from mozilla-central to mozilla-inbound
--- a/mobile/chrome/content/PageActions.js
+++ b/mobile/chrome/content/PageActions.js
@@ -256,16 +256,18 @@ var PageActions = {
     aNode.hidden = true;
     this._updateAttributes();
   },
 
   _updateAttributes: function _updateAttributes() {
     let container = document.getElementById("pageactions-container");
     let visibleNodes = container.querySelectorAll("pageaction:not([hidden=true])");
     let visibleCount = visibleNodes.length;
+    if (visibleCount == 0)
+      return;
 
     for (let i = 0; i < visibleCount; i++)
       visibleNodes[i].classList.remove("odd-last-child");
 
     visibleNodes[visibleCount - 1].classList.add("last-child");
     if (visibleCount % 2)
       visibleNodes[visibleCount - 1].classList.add("odd");
   }
--- a/mobile/chrome/tests/browser_rememberPassword.js
+++ b/mobile/chrome/tests/browser_rememberPassword.js
@@ -1,23 +1,24 @@
 var testURL_01 = chromeRoot + "browser_blank_01.html";
 
 // Tests for the Remember Password UI
 
 let gCurrentTab = null;
 function test() {
   waitForExplicitFinish();
 
-  gCurrentTab = Browser.addTab(testURL_01, true);
   messageManager.addMessageListener("pageshow", function() {
     if (gCurrentTab.browser.currentURI.spec == testURL_01) {
       messageManager.removeMessageListener("pageshow", arguments.callee);
       pageLoaded();
     }
   });
+
+  gCurrentTab = Browser.addTab(testURL_01, true);
 }
 
 function pageLoaded() {
   let iHandler = getIdentityHandler();
   let iPassword = document.getElementById("pageaction-password");
   let lm = getLoginManager();
   let host = gCurrentTab.browser.currentURI.prePath;
   let nullSubmit = createLogin(host, host, null);