Skip to content

Commit

Permalink
Do not use mutation events (related to 5768 and 2912)
Browse files Browse the repository at this point in the history
  • Loading branch information
janodvarko committed Oct 18, 2012
1 parent 088648e commit 84c0ecb
Showing 1 changed file with 0 additions and 50 deletions.
50 changes: 0 additions & 50 deletions extension/content/firebug/js/debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -2561,58 +2561,11 @@ Firebug.Debugger = Obj.extend(Firebug.ActivableModule,
}
*/

// context.watchScriptAdditions = Obj.bind(this.watchScriptAdditions, this, context);
// context.window.document.addEventListener("DOMNodeInserted", context.watchScriptAdditions, false);

if (FBTrace.DBG_SOURCEFILES)
FBTrace.sysout("debugger("+this.debuggerName+").loadedContext enabled on load: "+
context.onLoadWindowContent+" context.sourceFileMap", context.sourceFileMap);
},

/*
* A DOM Mutation Event handler for script tag additions
* FAILS see http://code.google.com/p/fbug/issues/detail?id=2912
*/
watchScriptAdditions: function(event, context)
{
if (event.type !== "DOMNodeInserted")
return;

if (event.target.tagName.toLowerCase() !== "script")
return;

FBTrace.sysout("debugger.watchScriptAdditions ", event.target.innerHTML);
var location = Win.safeGetWindowLocation(context.window);

jsd.enumerateScripts({enumerateScript: function(script)
{
if (Url.normalizeURL(script.fileName) === location)
{
var sourceFile = Firebug.SourceFile.getSourceFileByScript(context, script);
FBTrace.sysout('debugger.watchScriptAdditions '+script.tag+" in "+
(sourceFile?sourceFile.href:"NONE")+" "+script.functionSource,
script.functionSource);
// The dynamically added script tags via element.appendChild do not show up.
}
}});

if (context.pendingScriptTagSourceFile)
{
var sourceFile = context.pendingScriptTagSourceFile;
sourceFile.scriptTag = event.target;
sourceFile.source = Str.splitLines(event.target.innerHTML);

var panel = context.getPanel("script", true);
if (panel)
panel.removeSourceBoxBySourceFile(sourceFile);

FBTrace.sysout("debugger.watchScriptAdditions connected tag to sourcefile",
sourceFile);

delete context.pendingScriptTagSourceFile;
}
},

// clean up the source file map in case the frame is being reloaded.
unwatchWindow: function(context, win)
{
Expand All @@ -2639,9 +2592,6 @@ Firebug.Debugger = Obj.extend(Firebug.ActivableModule,
{
Firebug.ActivableModule.destroyContext.apply(this, arguments);

Events.removeEventListener(context.window.document, "DOMNodeInserted",
context.watchScriptAdditions, false);

if (context.stopped)
{
// the abort will call resume, but the nestedEventLoop would continue the load...
Expand Down

0 comments on commit 84c0ecb

Please sign in to comment.