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 39982a2ba3446d77c210c2d0eff85bfb261540a9
parent 63311 f76fac2730054ea2b0eb9dc1fe4c44dd1ebfe11c
child 63313 0d3e9943f4635971130aecbb2a0a1c18d076caf3
push id19140
push userdgottwald@mozilla.com
push dateThu, 03 Mar 2011 10:36:04 +0000
treeherdermozilla-central@0d3e9943f463 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdolske
bugs586212
milestone2.0b13pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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;
         }