Bug 1511130 - Part I, Backed out changeset faacbb32e16a (Bug 1511130). r=bgrins, a=RyanVM
authorTimothy Guan-tin Chien <timdream@gmail.com>
Sat, 01 Dec 2018 22:28:46 +0000
changeset 509093 17a1d1be96f474b846b1bdbb82786c3238407b53
parent 509092 da461fa0a394f281b886840bd768f7dc8a1f25d0
child 509094 c41c18787e43e3ce0d9008226f21810eb19c634b
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins, RyanVM
bugs1511130, 1505957
milestone65.0
Bug 1511130 - Part I, Backed out changeset faacbb32e16a (Bug 1511130). r=bgrins, a=RyanVM My approach in bug 1505957 turned out to be flawed. Differential Revision: https://phabricator.services.mozilla.com/D13607
toolkit/actors/UAWidgetsChild.jsm
--- a/toolkit/actors/UAWidgetsChild.jsm
+++ b/toolkit/actors/UAWidgetsChild.jsm
@@ -74,39 +74,23 @@ class UAWidgetsChild extends ActorChild 
     let shadowRoot = aElement.openOrClosedShadowRoot;
     let sandbox = aElement.nodePrincipal.isSystemPrincipal ?
       Object.create(null) : Cu.getUAWidgetScope(aElement.nodePrincipal);
 
     if (!sandbox[widgetName]) {
       Services.scriptloader.loadSubScript(uri, sandbox, "UTF-8");
     }
 
-    let widget;
-    try {
-      widget = new sandbox[widgetName](shadowRoot);
-    } catch (ex) {
-      // The widget may have thrown during construction.
-      // Report the failure and recover by clearing the Shadow DOM.
-      shadowRoot.innerHTML = "";
-      Cu.reportError(ex);
-      return;
-    }
+    let widget = new sandbox[widgetName](shadowRoot);
     this.widgets.set(aElement, widget);
   }
 
   teardownWidget(aElement) {
     let widget = this.widgets.get(aElement);
     if (!widget) {
       return;
     }
     if (typeof widget.wrappedJSObject.destructor == "function") {
-      try {
-        widget.wrappedJSObject.destructor();
-      } catch (ex) {
-        // The widget may have thrown during destruction.
-        // Report the failure and recover by clearing the Shadow DOM.
-        aElement.openOrClosedShadowRoot.innerHTML = "";
-        Cu.reportError(ex);
-      }
+      widget.wrappedJSObject.destructor();
     }
     this.widgets.delete(aElement);
   }
 }