Bug 869086 - Make textbox.xml resilient against the changes in bug 653881. r=gavin
authorBlake Kaplan <mrbkap@gmail.com>
Mon, 06 May 2013 11:15:51 -0700
changeset 142257 775ab8588cec5fafdd78dd9c4fb1b4454ad6c7df
parent 142256 d558440ac511f1deef21a30ba96c00b48aa03775
child 142258 c36615f13b0ed74321f0515d7d790df8dc146a90
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs869086, 653881
milestone23.0a1
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 869086 - Make textbox.xml resilient against the changes in bug 653881. r=gavin
toolkit/content/widgets/textbox.xml
--- a/toolkit/content/widgets/textbox.xml
+++ b/toolkit/content/widgets/textbox.xml
@@ -454,18 +454,20 @@
     </content>
   </binding>
 
   <binding id="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="&deleteCmd.label;" accesskey="&deleteCmd.accesskey;" cmd="cmd_delete"/>
@@ -516,18 +518,20 @@
     </implementation>
   </binding>
 
   <binding id="input-box-spell" 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._doPopupItemEnablingSpell(this);"
                      onpopuphiding="this.parentNode._doPopupItemDisabling(this);"
                      oncommand="var cmd = event.originalTarget.getAttribute('cmd'); if(cmd) { this.parentNode.doCommand(cmd); event.stopPropagation(); }">
         <xul:menuitem label="&spellNoSuggestions.label;" anonid="spell-no-suggestions" disabled="true"/>
         <xul:menuitem label="&spellAddToDictionary.label;" accesskey="&spellAddToDictionary.accesskey;" anonid="spell-add-to-dictionary"
                       oncommand="this.parentNode.parentNode.spellCheckerUI.addToDictionary();"/>
         <xul:menuitem label="&spellUndoAddToDictionary.label;" accesskey="&spellUndoAddToDictionary.accesskey;" anonid="spell-undo-add-to-dictionary"
                       oncommand="this.parentNode.parentNode.spellCheckerUI.undoAddToDictionary();"/>