Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into issue5878
Browse files Browse the repository at this point in the history
  • Loading branch information
fflorent committed Oct 26, 2012
2 parents 14563b2 + 81cacd2 commit 7b82c8c
Show file tree
Hide file tree
Showing 21 changed files with 348 additions and 369 deletions.
14 changes: 2 additions & 12 deletions extension/chrome.bz.tpl.manifest
Expand Up @@ -7,8 +7,8 @@ content firebug content/firebug/ contentaccessible=yes
# Maps resource://moduleloader/* to files in modules/*
# resource moduleloader modules/

skin firebug classic/1.0 skin/classic/
skin firebug-os classic/1.0 skin/classic/win/
skin firebug classic/1.0 skin/classic/
skin firebug-os classic/1.0 skin/classic/win/

locale firebug aa-AH locale/aa-AH/
locale firebug ar-SA locale/ar-SA/
Expand Down Expand Up @@ -64,16 +64,6 @@ locale firebug vi locale/vi/
locale firebug zh-CN locale/zh-CN/
locale firebug zh-TW locale/zh-TW/

#overlay chrome://browser/content/browser.xul chrome://firebug/content/browserOverlay.xul
#overlay chrome://browser/content/browser.xul chrome://firebug/content/firefox/browserOverlayWithFrame.xul

#overlay chrome://global/content/customizeToolbar.xul chrome://firebug/content/firefox/start-button/customizeToolbarOverlay.xul
#overlay chrome://mozapps/content/extensions/about.xul chrome://firebug/content/firefox/aboutOverlay.xul

# Sea Monkey
#overlay chrome://navigator/content/navigator.xul chrome://firebug/content/browserOverlay.xul
#overlay chrome://navigator/content/navigator.xul chrome://firebug/content/firefox/browserOverlayWithFrame.xul

# Support for Mac
override chrome://firebug/skin/debugger.css chrome://firebug/skin/mac/debugger.css os=Darwin
override chrome://firebug-os/skin/firebug.css chrome://firebug/skin/mac/firebug.css os=Darwin
Expand Down
14 changes: 2 additions & 12 deletions extension/chrome.manifest
Expand Up @@ -7,8 +7,8 @@ content firebug content/firebug/ contentaccessible=yes
# Maps resource://moduleloader/* to files in modules/*
# resource moduleloader modules/

skin firebug classic/1.0 skin/classic/
skin firebug-os classic/1.0 skin/classic/win/
skin firebug classic/1.0 skin/classic/
skin firebug-os classic/1.0 skin/classic/win/

locale firebug bg locale/bg/
locale firebug ca-AD locale/ca-AD/
Expand Down Expand Up @@ -46,16 +46,6 @@ locale firebug vi locale/vi/
locale firebug zh-CN locale/zh-CN/
locale firebug zh-TW locale/zh-TW/

#overlay chrome://browser/content/browser.xul chrome://firebug/content/browserOverlay.xul
#overlay chrome://browser/content/browser.xul chrome://firebug/content/firefox/browserOverlayWithFrame.xul

#overlay chrome://global/content/customizeToolbar.xul chrome://firebug/content/firefox/start-button/customizeToolbarOverlay.xul
#overlay chrome://mozapps/content/extensions/about.xul chrome://firebug/content/firefox/aboutOverlay.xul

# Sea Monkey
#overlay chrome://navigator/content/navigator.xul chrome://firebug/content/browserOverlay.xul
#overlay chrome://navigator/content/navigator.xul chrome://firebug/content/firefox/browserOverlayWithFrame.xul

# Support for Mac
override chrome://firebug/skin/debugger.css chrome://firebug/skin/mac/debugger.css os=Darwin
override chrome://firebug-os/skin/firebug.css chrome://firebug/skin/mac/firebug.css os=Darwin
Expand Down
26 changes: 15 additions & 11 deletions extension/content/firebug/accessible/a11y.js
Expand Up @@ -57,7 +57,7 @@ Firebug.A11yModel = Obj.extend(Firebug.Module,
this.onNetFocus = Obj.bind(this.onNetFocus, this);
this.onNetBlur = Obj.bind(this.onNetBlur, this);

// mark ourselves disabled so we don't performDisable() if we are not enabled.
// Mark ourselves disabled, so we don't performDisable() if we are not enabled.
Firebug.chrome.window.a11yEnabled = false;

Firebug.connection.addListener(this);
Expand Down Expand Up @@ -98,7 +98,7 @@ Firebug.A11yModel = Obj.extend(Firebug.Module,
{
// Update for current chrome
this.set(value, Firebug.chrome);
// If the current chrome is external window, update also original chrome.
// If the current chrome is an external window, update also the original chrome.
if (Firebug.chrome != Firebug.originalChrome)
{
this.set(value, Firebug.originalChrome);
Expand Down Expand Up @@ -584,7 +584,7 @@ Firebug.A11yModel = Obj.extend(Firebug.Module,

ensurePanelTabStops: function()
{
// XXXjjb: seems like this shoudl be !Firebug.chrome
// XXXjjb: seems like this should be !Firebug.chrome
if (!Firebug.currentContext || !Firebug.currentContext.chrome)
return;
var panel = Firebug.chrome.getSelectedPanel();
Expand Down Expand Up @@ -1037,7 +1037,7 @@ Firebug.A11yModel = Obj.extend(Firebug.Module,
cell = Dom.getChildByClass(cell, "a11yFocus");
this.focus(cell);
}
// for Net Panel. Focus selected tab rather than the tablist
// for Net Panel. Focus selected tab rather than the tab list
else if (Css.hasClass(row, "netInfoTabs"))
{
var tabs = row.getElementsByClassName("netInfoTab");
Expand Down Expand Up @@ -1552,7 +1552,8 @@ Firebug.A11yModel = Obj.extend(Firebug.Module,
onBeforeCSSRulesAdded: function(panel)
{
// Panel content is about to be recreated, possibly wiping out focus.
// Use the focused element's xpath to remember which rule had focus so that it can be refocused when the panel content is drawn again
// Use the focused element's xpath to remember which rule had focus,
// so that it can be refocused when the panel content is drawn again
var panelA11y = this.getPanelA11y(panel);
if (!panelA11y || !this.panelHasFocus(panel))
return;
Expand Down Expand Up @@ -2290,7 +2291,8 @@ Firebug.A11yModel = Obj.extend(Firebug.Module,

var node = line.getElementsByClassName("sourceRowText").item(0);
this.insertCaretToNode(panel, node);
this.focus(focusElem); // move focus back to where it was
// move focus back to where it was
this.focus(focusElem);
},

insertCaretToNode: function(panel, node, startOffset)
Expand Down Expand Up @@ -2633,10 +2635,12 @@ Firebug.A11yModel = Obj.extend(Firebug.Module,
}
var rangeParent = Dom.getAncestorByClass(target, "netRow");
var browser = Firebug.chrome.getPanelBrowser(panel);
// these two lines are necessary, because otherwise the infoTip will not have the correct dimensions when it's positioned, and the contents
// could be placed outside FB's viewport (making it impossible to read for keyboard users)
// these two lines are necessary, because otherwise the info tip will not have the correct
// dimensions when it's positioned, and the contentscould be placed outside of Firebug's
// viewport (making it impossible to read for keyboard users)
// This will be called again in showInfoTip
panel.showInfoTip(browser.infoTip, target, target.offsetLeft, target.offsetTop,
rangeParent, 0); //will be called again in showInfoTip
rangeParent, 0);
browser.infoTip.setAttribute("active", "true");
var left = Css.hasClass(target, "netTimeCol") ?
target.offsetLeft - browser.infoTip.offsetWidth - 12 :
Expand Down Expand Up @@ -3024,8 +3028,8 @@ Firebug.A11yModel = Obj.extend(Firebug.Module,
},

// These utils are almost the same as their DOM namesakes,
// except that that the routine skips containers that are not visible
// (rather than wasting time on their childnodes)
// except that the routine skips invisible containers
// (rather than wasting time on their child nodes)
getPreviousByClass: function (node, className, downOnly, maxRoot)
{
if (!node)
Expand Down
69 changes: 42 additions & 27 deletions extension/content/firebug/bti/inProcess/browser.js
Expand Up @@ -155,7 +155,8 @@ Browser.prototype.clearAllBreakpoints = function()
*/
Browser.prototype.clearAnnotations = function()
{
Firebug.Activation.clearAnnotations(); // should trigger event onClearAnnotations
// should trigger event onClearAnnotations
Firebug.Activation.clearAnnotations();
}

Browser.prototype.getWebAppByWindow = function(win)
Expand Down Expand Up @@ -279,7 +280,8 @@ Browser.prototype.getOrCreateContextByWebApp = function(webApp)

browser.showFirebug = true;

Events.dispatch(TabWatcher.fbListeners, "watchBrowser", [browser]); // TODO remove
// TODO remove
Events.dispatch(TabWatcher.fbListeners, "watchBrowser", [browser]);
}
return context;
}
Expand Down Expand Up @@ -487,13 +489,18 @@ Browser.prototype.toggleResume = function(resume)
FBTrace.sysout("BTI.toggleResume" + (Firebug.getSuspended() ? "OFF" : "ON") +
" -> " + (!!resume ? "ON" : "OFF"));

// this should be the only method to call suspend and resume.
if (resume) // either a new context or revisiting an old one
// This should be the only method to call suspend() and resume().
// either a new context or revisiting an old one
if (resume)
{
if (Firebug.getSuspended())
Firebug.resume(); // This will cause onResumeFirebug for every context including this one.
{
// This will cause onResumeFirebug for every context including this one.
Firebug.resume();
}
}
else // this browser has no context
// this browser has no context
else
{
Firebug.suspend();
}
Expand Down Expand Up @@ -688,7 +695,8 @@ var TabWatchListener =
{
dispatchName: "TabWatchListener",

initContext: function(context, persistedState) // called after a context is created.
// called after a context is created.
initContext: function(context, persistedState)
{
context.panelName = context.browser.panelName;
if (context.browser.sidePanelNames)
Expand All @@ -706,25 +714,29 @@ var TabWatchListener =
Firebug.connection.toggleResume(context);
},

/**
* To be called from Firebug.TabWatcher only, see selectContext
*/
showContext: function(browser, context) // Firebug.TabWatcher showContext. null context means we don't debug that browser

// To be called from Firebug.TabWatcher only, see selectContext
// null as context means we don't debug that browser
showContext: function(browser, context)
{
Firebug.chrome.setFirebugContext(context); // the context becomes the default for its view
Firebug.connection.toggleResume(context); // resume, after setting Firebug.currentContext
// the context becomes the default for its view
Firebug.chrome.setFirebugContext(context);
// resume, after setting Firebug.currentContext
Firebug.connection.toggleResume(context);

Events.dispatch(Firebug.modules, "showContext", [browser, context]); // tell modules we may show UI
// tell modules we may show UI
Events.dispatch(Firebug.modules, "showContext", [browser, context]);

Firebug.showContext(browser, context);
},

unwatchBrowser: function(browser) // the context for this browser has been destroyed and removed
// The context for this browser has been destroyed and removed.
unwatchBrowser: function(browser)
{
Firebug.connection.toggleResume(false);
},

// Either a top level or a frame, (interior window) for an exist context is seen by the tabWatcher.
// Either a top level or a frame (interior window) for an existing context is seen by the TabWatcher.
watchWindow: function(context, win)
{
for (var panelName in context.panelMap)
Expand Down Expand Up @@ -757,20 +769,23 @@ var TabWatchListener =

destroyContext: function(context, persistedState, browser)
{
if (!context) // then we are called just to clean up
// then we are called just to clean up
if (!context)
return;

Events.dispatch(Firebug.modules, "destroyContext", [context, persistedState]);

// xxxHonza: not sure if this code is correct. Test case: Firebug active, reload
// xxxHonza: Not sure if this code is correct. Test case: Firebug active, reload
// 1) The Firebug.currentContext can be already set to the new one
// 2) The Firebug.currentContext can be already null.
// Calling clearPanels is important because it also clears the statuPath, which
// contains references to panel objects (e.g. Page document in case of the HTML panel)
// Calling clearPanels() is important, because it also clears the statusPath, which
// contains references to panel objects (e.g. the page document in case of the HTML panel)
if (Firebug.currentContext == context || !Firebug.currentContext)
{
Firebug.chrome.clearPanels(); // disconnect the to-be-destroyed panels from the panelBar
Firebug.chrome.setFirebugContext(null); // Firebug.currentContext is about to be destroyed
// disconnect the to-be-destroyed panels from the panelBar
Firebug.chrome.clearPanels();
// Firebug.currentContext is about to be destroyed
Firebug.chrome.setFirebugContext(null);
}

var browser = context.browser;
Expand All @@ -787,8 +802,8 @@ var TabWatchListener =
FBTrace.sysout("browser.destroyContext; " + e, e);
}

// next the context is deleted and removed from the Firebug.TabWatcher,
// we clean up in unWatchBrowser
// Next time the context is deleted and removed from the Firebug.TabWatcher,
// we clean up in unWatchBrowser.
},

onSourceFileCreated: function()
Expand Down Expand Up @@ -825,11 +840,11 @@ var TabWatchListener =

Browser.prototype.connect = function ()
{
// Events fired on browser are re-broadcast to Firebug.modules
// Events fired on browser are re-broadcasted to Firebug.modules
Firebug.connection.addListener(Firebug);

//Listen for preference changes. This way options module is not dependent on tools
//xxxHonza: can this be in Browser interface?
// Listen for preference changes. This way the options module is not dependent on tools
// xxxHonza: can this be in Browser interface?
Options.addListener(
{
updateOption: function(name, value)
Expand Down
9 changes: 5 additions & 4 deletions extension/content/firebug/bti/inProcess/compilationunit.js
Expand Up @@ -58,7 +58,8 @@ CompilationUnit.prototype.getKind = function getKind()

CompilationUnit.prototype.isExecutableLine = function isExecutableLine(lineNo)
{
return this.sourceFile.isExecutableLine(lineNo); // TODO no sourceFiles!
// TODO no sourceFiles!
return this.sourceFile.isExecutableLine(lineNo);
}

/**
Expand Down Expand Up @@ -103,7 +104,7 @@ CompilationUnit.prototype.getBrowserContext = function()
*/
CompilationUnit.prototype.getBreakpoints = function()
{
// return a copy of scripts so the master copy is not corrupted
// Return a copy of the breakpoints, so the master copy is not corrupted.
var bps = [];
for ( var i = 0; i < this.breakpoints.length; i++)
bps.push(this.breakpoints[i]);
Expand Down Expand Up @@ -135,8 +136,8 @@ CompilationUnit.prototype.eachBreakpoint = function( fnOfLineProps )
*/
CompilationUnit.prototype.getSourceLines = function(firstLine, lastLine, listener)
{
// xxxHonza: do not cache the source lines in compilation unit
// The Script panel doesn't display whole script if it's downloaded
// xxxHonza: Do not cache the source lines in the compilation unit.
// The Script panel doesn't display the whole script if it's downloaded
// partially and the following caching happens sooner.
// Or tabCache.storeSplitLines should trigger an update.
//if (!this.lines)
Expand Down
21 changes: 14 additions & 7 deletions extension/content/firebug/bti/inProcess/javascripttool.js
Expand Up @@ -39,7 +39,7 @@ JavaScriptTool.breakOnNext = function(context, enable)

JavaScriptTool.setBreakpoint = function(context, url, lineNumber)
{
// TODO we should be sending urls over not compilation units
// TODO we should be sending URLs over, not compilation units
var compilationUnit = context.getCompilationUnit(url);
JSDebugger.setBreakpoint(compilationUnit, lineNumber);
};
Expand Down Expand Up @@ -71,7 +71,7 @@ JavaScriptTool.getBreakpointCondition = function(context, url, lineNumber)
};

// ********************************************************************************************* //
// These functions should be on stack instead
// These functions should be on the stack instead.

JavaScriptTool.rerun = function(context)
{
Expand Down Expand Up @@ -111,7 +111,8 @@ JavaScriptTool.onConnect = function(connection)
{
if (!Firebug.connection.getTool("script"))
{
JavaScriptTool.asTool = new Tool("script"), // this is the script tool
// this is the script tool
JavaScriptTool.asTool = new Tool("script"),
connection.registerTool(JavaScriptTool.asTool);
}
else
Expand Down Expand Up @@ -188,8 +189,12 @@ JavaScriptTool.onStartDebugging = function(context, frame)
JavaScriptTool.onStopDebugging = function(context)
{
var panel = context.getPanel("script", true);
if (panel && panel === Firebug.chrome.getSelectedPanel()) // then we are looking at the script panel
panel.showNoStackFrame(); // unhighlight and remove toolbar-status line
// Then we are looking at the Script panel.
if (panel && panel === Firebug.chrome.getSelectedPanel())
{
// unhighlight and remove toolbar-status line
panel.showNoStackFrame();
}

if (panel)
panel.onStopDebugging();
Expand Down Expand Up @@ -217,12 +222,14 @@ JavaScriptTool.initialize = function()
if (FBTrace.DBG_INITIALIZE)
FBTrace.sysout("JavaScriptTool initialize");

Firebug.connection.addListener(JavaScriptTool); // This is how we get events
// This is how we get events.
Firebug.connection.addListener(JavaScriptTool);
}

JavaScriptTool.shutdown = function()
{
Firebug.connection.removeListener(JavaScriptTool); // This is how we get events
// This is how we get events.
Firebug.connection.removeListener(JavaScriptTool);
}

// ********************************************************************************************* //
Expand Down

0 comments on commit 7b82c8c

Please sign in to comment.