Bug 1316359 - autocomplete.xml must get userContextId from the attribute of the element instead using contentPrincipal, r=Gijs
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 09 Nov 2016 19:43:34 +0100
changeset 348635 5cd3eebd3f3c4e47230ca1ee10c30f33c525bbc3
parent 348634 1a2b9edaff2e1addbded9de836a56c9924b6254a
child 348636 ea14d2a7c5dc3893ed6d42d94cbe36c45d7fd975
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1316359
milestone52.0a1
Bug 1316359 - autocomplete.xml must get userContextId from the attribute of the element instead using contentPrincipal, r=Gijs
toolkit/content/widgets/autocomplete.xml
--- a/toolkit/content/widgets/autocomplete.xml
+++ b/toolkit/content/widgets/autocomplete.xml
@@ -654,18 +654,20 @@
       <handler event="compositionstart" phase="capturing"
                action="if (this.mController.input == this) this.mController.handleStartComposition();"/>
 
       <handler event="compositionend" phase="capturing"
                action="if (this.mController.input == this) this.mController.handleEndComposition();"/>
 
       <handler event="focus" phase="capturing"><![CDATA[
         this.attachController();
-        if (window.gBrowser) {
-          this.userContextId = window.gBrowser.selectedBrowser.contentPrincipal.originAttributes.userContextId;
+        if (window.gBrowser && window.gBrowser.selectedBrowser.hasAttribute("usercontextid")) {
+          this.userContextId = parseInt(window.gBrowser.selectedBrowser.getAttribute("usercontextid"));
+        } else {
+          this.userContextId = 0;
         }
       ]]></handler>
 
       <handler event="blur" phase="capturing"><![CDATA[
         if (!this._dontBlur) {
           if (this.forceComplete && this.mController.matchCount >= 1) {
             // mousemove sets selected index. Don't blindly use that selected
             // index in this blur handler since if the popup is open you can