Bug 185236 part 1. Fix add-ons manager to ignore load events on stylesheet PIs. r=mossop
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 26 Sep 2011 17:25:59 -0400
changeset 78924 bb87ceae27a5d682c2f28450300e31438d95d096
parent 78923 b1cd65ceeb47fa400a4c3f2c175fcf4d8676da0b
child 78925 465554cdfbcc1785afd3804b7ba711add1ecdd32
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop
bugs185236
milestone9.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 185236 part 1. Fix add-ons manager to ignore load events on stylesheet PIs. r=mossop
toolkit/mozapps/extensions/content/extensions.js
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -110,17 +110,22 @@ XPCOMUtils.defineLazyGetter(gStrings, "a
 });
 
 document.addEventListener("load", initialize, true);
 window.addEventListener("unload", shutdown, false);
 
 var gPendingInitializations = 1;
 __defineGetter__("gIsInitializing", function() gPendingInitializations > 0);
 
-function initialize() {
+function initialize(event) {
+  // XXXbz this listener gets _all_ load events for all nodes in the
+  // document... but relies on not being called "too early".
+  if (event.target instanceof XMLStylesheetProcessingInstruction) {
+    return;
+  }
   document.removeEventListener("load", initialize, true);
   gViewController.initialize();
   gCategories.initialize();
   gHeader.initialize();
   gEventManager.initialize();
   Services.obs.addObserver(sendEMPong, "EM-ping", false);
   Services.obs.notifyObservers(window, "EM-loaded", "");