Bug 586212 - Don't carry out the command when clicking on a disabled splitmenu. r=dolske
authorDão Gottwald <dao@mozilla.com>
Thu, 03 Mar 2011 11:34:55 +0100
changeset 63312 39982a2ba344
parent 63311 f76fac273005
child 63313 0d3e9943f463
push idunknown
push userunknown
push dateunknown
reviewersdolske
bugs586212
milestone2.0b13pre
Bug 586212 - Don't carry out the command when clicking on a disabled splitmenu. r=dolske
browser/base/content/urlbarBindings.xml
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -1161,16 +1161,22 @@
 
       <handler event="popupshowing"><![CDATA[
         if (event.target == this.firstChild &&
             this._parentMenupopup._currentPopup)
           this._parentMenupopup._currentPopup.hidePopup();
       ]]></handler>
 
       <handler event="click" phase="capturing"><![CDATA[
+        if (this.getAttribute("disabled") == "true") {
+          // Prevent the command from being carried out
+          event.stopPropagation();
+          return;
+        }
+
         let node = event.originalTarget;
         while (true) {
           if (node == this.menuitem)
             break;
           if (node == this)
             return;
           node = node.parentNode;
         }