Bug 1235154 - Port Bug 869086 to fix right click urlbar error [TypeError this.parentNode.firstChild.focus is not a function] r=Ratty a=IanN for comm-aurora and comm-beta
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Tue, 29 Dec 2015 19:09:34 +0800
changeset 26566 bd946322edbdf07bcba844b2c4ef9eb1c876ca7e
parent 26565 cf1b57ad7dd6c48dc948871b8ec74eb5a6767167
child 26567 6286686b0b1c5ea6e96ccf43cc9f044b1552094f
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersRatty, IanN
bugs1235154, 869086, 653881
Bug 1235154 - Port Bug 869086 to fix right click urlbar error [TypeError this.parentNode.firstChild.focus is not a function] r=Ratty a=IanN for comm-aurora and comm-beta References: Bug 869086 - Make textbox.xml resilient against the changes in bug 653881 Bug 653881 - Fix up our XBL1 shadow tree implementation so that we can reuse it for XBL2
suite/browser/urlbarBindings.xml
--- a/suite/browser/urlbarBindings.xml
+++ b/suite/browser/urlbarBindings.xml
@@ -656,18 +656,20 @@
     </handlers>
   </binding>
 
   <binding id="input-box-paste" extends="chrome://global/content/bindings/textbox.xml#input-box">
     <content context="_child">
       <children/>
       <xul:menupopup anonid="input-box-contextmenu"
                      class="textbox-contextmenu"
-                     onpopupshowing="if (document.commandDispatcher.focusedElement != this.parentNode.firstChild)
-                                       this.parentNode.firstChild.focus();
+                     onpopupshowing="var input =
+                                       this.parentNode.getElementsByAttribute('anonid', 'input')[0];
+                                     if (document.commandDispatcher.focusedElement != input)
+                                       input.focus();
                                      this.parentNode._doPopupItemEnabling(this);"
                      oncommand="var cmd = event.originalTarget.getAttribute('cmd'); if(cmd) { this.parentNode.doCommand(cmd); event.stopPropagation(); }">
         <xul:menuitem label="&undoCmd.label;" accesskey="&undoCmd.accesskey;" cmd="cmd_undo"/>
         <xul:menuseparator/>
         <xul:menuitem label="&cutCmd.label;" accesskey="&cutCmd.accesskey;" cmd="cmd_cut"/>
         <xul:menuitem label="&copyCmd.label;" accesskey="&copyCmd.accesskey;" cmd="cmd_copy"/>
         <xul:menuitem label="&pasteCmd.label;" accesskey="&pasteCmd.accesskey;" cmd="cmd_paste"/>
         <xul:menuitem label="&pasteGoCmd.label;" accesskey="&pasteGoCmd.accesskey;" cmd="cmd_pasteAndGo"/>