Bug 1596800 - Remove document.getBindingParent usage from autocomplete-popup. r=mconley
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 18 Nov 2019 19:06:51 +0000
changeset 502474 d5db2146b9c5519a2d42233c4699818ba347ec2a
parent 502473 c2817cb864536cf73287225833f89c0619209ac6
child 502475 26d109ef85da49b7f113e65c61908dbb5d7ea846
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
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 autocomplete-popup. r=mconley This preserves the behavior, though I think we could probably remove that block altogether? Depends on D53340 Differential Revision: https://phabricator.services.mozilla.com/D53341
toolkit/content/widgets/autocomplete-popup.js
--- a/toolkit/content/widgets/autocomplete-popup.js
+++ b/toolkit/content/widgets/autocomplete-popup.js
@@ -550,23 +550,22 @@
         // Set an attribute for styling the popup based on the input.
         let inputID = "";
         if (
           this.mInput &&
           this.mInput.ownerDocument &&
           this.mInput.ownerDocument.documentURIObject.schemeIs("chrome")
         ) {
           inputID = this.mInput.id;
-          // Take care of elements with no id that are inside xbl bindings
+          // Take care of elements with no id that are inside shadow DOM
+          // FIXME: Do we really need this?
           if (!inputID) {
-            let bindingParent = this.mInput.ownerDocument.getBindingParent(
-              this.mInput
-            );
-            if (bindingParent) {
-              inputID = bindingParent.id;
+            let shadow = this.mInput.containingShadowRoot;
+            if (shadow) {
+              inputID = shadow.host.id;
             }
           }
         }
         this.setAttribute("autocompleteinput", inputID);
 
         this.mPopupOpen = true;
       });