Backout changesets d811aa4cf0cf and 96ca77c43cb9 from bug 432599
authorRyan Flint <rflint@ryanflint.com>
Tue, 29 Jul 2008 16:04:50 -0700
changeset 16287 cab5a570f46e10259bcd9152bcd3fab535a35e5c
parent 16286 96ca77c43cb9addf18588d138e910a5d201a1111
child 16288 74297bc2ef7621039e48f234668692e6ecc34288
push id901
push userrflint@ryanflint.com
push dateTue, 29 Jul 2008 23:05:50 +0000
treeherdermozilla-central@cab5a570f46e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs432599
milestone1.9.1a2pre
backs outd811aa4cf0cf2c0c23fb423ed23a452bd4f94cf0
96ca77c43cb9addf18588d138e910a5d201a1111
Backout changesets d811aa4cf0cf and 96ca77c43cb9 from bug 432599
browser/base/content/browser-places.js
browser/base/content/test/Makefile.in
browser/base/content/test/browser_bug432599.js
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -159,59 +159,59 @@ var StarUI = {
     };
     this._overlayLoading = true;
     document.loadOverlay("chrome://browser/content/places/editBookmarkOverlay.xul",
                          loadObserver);
   },
 
   _doShowEditBookmarkPanel:
   function SU__doShowEditBookmarkPanel(aItemId, aAnchorElement, aPosition) {
-    if (this.panel.state == "closed") {
-      this._blockCommands(); // un-done in the popuphiding handler
+    this._blockCommands(); // un-done in the popuphiding handler
 
-      var bundle = this._element("bundle_browser");
+    var bundle = this._element("bundle_browser");
 
-      // Set panel title:
-      // if we are batching, i.e. the bookmark has been added now,
-      // then show Page Bookmarked, else if the bookmark did already exist,
-      // we are about editing it, then use Edit This Bookmark.
-      this._element("editBookmarkPanelTitle").value =
-        this._batching ?
-          bundle.getString("editBookmarkPanel.pageBookmarkedTitle") :
-          bundle.getString("editBookmarkPanel.editBookmarkTitle");
+    // Set panel title:
+    // if we are batching, i.e. the bookmark has been added now,
+    // then show Page Bookmarked, else if the bookmark did already exist,
+    // we are about editing it, then use Edit This Bookmark.
+    this._element("editBookmarkPanelTitle").value =
+      this._batching ?
+        bundle.getString("editBookmarkPanel.pageBookmarkedTitle") :
+        bundle.getString("editBookmarkPanel.editBookmarkTitle");
 
-      // No description; show the Done, Cancel;
-      // hide the Edit, Undo buttons
-      this._element("editBookmarkPanelDescription").textContent = "";
-      this._element("editBookmarkPanelBottomButtons").hidden = false;
-      this._element("editBookmarkPanelContent").hidden = false;
-      this._element("editBookmarkPanelEditButton").hidden = true;
-      this._element("editBookmarkPanelUndoRemoveButton").hidden = true;
+    // No description; show the Done, Cancel;
+    // hide the Edit, Undo buttons
+    this._element("editBookmarkPanelDescription").textContent = "";
+    this._element("editBookmarkPanelBottomButtons").hidden = false;
+    this._element("editBookmarkPanelContent").hidden = false;
+    this._element("editBookmarkPanelEditButton").hidden = true;
+    this._element("editBookmarkPanelUndoRemoveButton").hidden = true;
 
-      // The remove button is shown only if we're not already batching, i.e.
-      // if the cancel button/ESC does not remove the bookmark.
-      this._element("editBookmarkPanelRemoveButton").hidden = this._batching;
+    // The remove button is shown only if we're not already batching, i.e.
+    // if the cancel button/ESC does not remove the bookmark.
+    this._element("editBookmarkPanelRemoveButton").hidden = this._batching;
 
-      // unset the unstarred state, if set
-      this._element("editBookmarkPanelStarIcon").removeAttribute("unstarred");
+    // unset the unstarred state, if set
+    this._element("editBookmarkPanelStarIcon").removeAttribute("unstarred");
 
-      this._itemId = aItemId !== undefined ? aItemId : this._itemId;
-      this.beginBatch();
+    this._itemId = aItemId !== undefined ? aItemId : this._itemId;
+    this.beginBatch();
 
-      // XXXmano hack: We push a no-op transaction on the stack so it's always
-      // safe for the Cancel button to call undoTransaction after endBatch.
-      // Otherwise, if no changes were done in the edit-item panel, the last
-      // transaction on the undo stack may be the initial createItem transaction,
-      // or worse, the batched editing of some other item.
-      PlacesUIUtils.ptm.doTransaction({ doTransaction: function() { },
-                                        undoTransaction: function() { },
-                                        redoTransaction: function() { },
-                                        isTransient: false,
-                                        merge: function() { return false; } });
+    // XXXmano hack: We push a no-op transaction on the stack so it's always
+    // safe for the Cancel button to call undoTransaction after endBatch.
+    // Otherwise, if no changes were done in the edit-item panel, the last
+    // transaction on the undo stack may be the initial createItem transaction,
+    // or worse, the batched editing of some other item.
+    PlacesUIUtils.ptm.doTransaction({ doTransaction: function() { },
+                                      undoTransaction: function() { },
+                                      redoTransaction: function() { },
+                                      isTransient: false,
+                                      merge: function() { return false; } });
 
+    if (this.panel.state == "closed") {
       // Consume dismiss clicks, see bug 400924
       this.panel.popupBoxObject
           .setConsumeRollupEvent(Ci.nsIPopupBoxObject.ROLLUP_CONSUME);
       this.panel.openPopup(aAnchorElement, aPosition, -1, -1);
     }
     else {
       var namePicker = this._element("editBMPanel_namePicker");
       namePicker.focus();
--- a/browser/base/content/test/Makefile.in
+++ b/browser/base/content/test/Makefile.in
@@ -51,17 +51,16 @@ include $(topsrcdir)/config/rules.mk
 
 # browser_bug423833.js disabled temporarily since it's unreliable: bug 428712
 # browser_sanitize-download-history.js disabled temporarily since it's unreliable: bug 432425
 _BROWSER_FILES = browser_bug321000.js \
                  browser_bug405137.js \
                  browser_bug409481.js \
                  browser_autodiscovery.js \
                  browser_bug420160.js \
-                 browser_bug432599.js \
                  autodiscovery.html \
                  moz.png \
                  browser_getshortcutoruri.js \
     $(NULL)
 
 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 _BROWSER_FILES += browser_customize.js \
     $(NULL)
deleted file mode 100644
--- a/browser/base/content/test/browser_bug432599.js
+++ /dev/null
@@ -1,58 +0,0 @@
-function invokeUsingCtrlD(close) {
-  if (close)
-    EventUtils.sendMouseEvent({ type: "click", button: 1 }, "editBookmarkPanelDoneButton");
-  else
-    EventUtils.synthesizeKey("d", { accelKey: true });
-}
-
-function invokeUsingStarButton(close) {
-  if (close)
-    EventUtils.sendMouseEvent({ type: "click", button: 1 }, "editBookmarkPanelDoneButton");
-  else
-    EventUtils.sendMouseEvent({ type: "click", button: 1 }, "star-button");
-}
-
-let testBrowser = null;
-
-// test bug 432599
-function test() {
-  waitForExplicitFinish();
-
-  let testTab = gBrowser.addTab();
-  gBrowser.selectedTab = testTab;
-  testBrowser = gBrowser.getBrowserForTab(testTab);
-  testBrowser.addEventListener("load", initTest, true);
-
-  testBrowser.contentWindow.location = 'data:text/plain,Content';
-}
-
-function initTest() {
-  let invokers = [invokeUsingStarButton, invokeUsingCtrlD];
-
-  // first, bookmark the page
-  PlacesCommandHook.bookmarkPage(testBrowser);
-
-  invokers.forEach(checkBookmarksPanel);
-
-  finish();
-}
-
-function checkBookmarksPanel(invoker)
-{
-  let titleElement = document.getElementById("editBookmarkPanelTitle");
-  let removeElement = document.getElementById("editBookmarkPanelRemoveButton");
-
-  // invoke the panel for the first time
-  invoker();
-
-  let initialValue = titleElement.value;
-  let initialRemoveHidden = removeElement.hidden;
-  invoker(true);
-
-  // invoke the panel for the second time
-  invoker();
-
-  is(titleElement.value, initialValue, "The bookmark panel's title should be the same");
-  is(removeElement.hidden, initialRemoveHidden, "The bookmark panel's visibility should not change");
-  invoker(true);
-}