Bug 1596800 - Remove document.getBindingParent usage from preferences search. r=mconley
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 18 Nov 2019 19:07:47 +0000
changeset 502472 cceae677e859c9915d895bee2783ca1c0c34a296
parent 502471 5bc4fbe48df7276c4b6da448e9b85953620ac913
child 502473 c2817cb864536cf73287225833f89c0619209ac6
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1596800, 1547382
milestone72.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 1596800 - Remove document.getBindingParent usage from preferences search. r=mconley When the focus moves elsewhere inside the <tree> blur events aren't dispatched outside the shadow tree (as expected), so checking the originalTarget is always bogus. Furthermore, the event handler does nothing if the input isn't focused, and when the input is blurred the tree takes care of calling stopEditing itself, so this change should be pretty safe in general: https://searchfox.org/mozilla-central/rev/492214c05cde6e6db5feff9465ece4920400acc3/toolkit/content/widgets/tree.js#1083 It's not clear to me whether the blur event handler is doing anything at all after bug 1547382 (before this patch), as the binding parent is not a <xul:textbox> anymore, so <input>.getBindingParent() will return the <tree>... Depends on D53338 Differential Revision: https://phabricator.services.mozilla.com/D53339
browser/components/preferences/in-content/search.js
--- a/browser/components/preferences/in-content/search.js
+++ b/browser/components/preferences/in-content/search.js
@@ -383,21 +383,17 @@ var gSearchPane = {
         }
         break;
       case "select":
         if (aEvent.target.id == "engineList") {
           gSearchPane.onTreeSelect();
         }
         break;
       case "blur":
-        if (
-          aEvent.target.id == "engineList" &&
-          aEvent.target.inputField ==
-            document.getBindingParent(aEvent.originalTarget)
-        ) {
+        if (aEvent.target.id == "engineList") {
           gSearchPane.onInputBlur(aEvent);
         }
         break;
     }
   },
 
   observe(aEngine, aTopic, aVerb) {
     if (aTopic == "browser-search-engine-modified") {