From 905abfaa231165d83e33aa9a11b192ae96691b5c Mon Sep 17 00:00:00 2001 From: Mihai Sucan Date: Fri, 6 Jan 2012 21:34:56 +0200 Subject: [PATCH 01/12] Bug 609890 - window.console API messages from before the Web Console is opened don't show. r=gavin.sharp --- browser/devtools/webconsole/HUDService.jsm | 60 ++++++++++++++- browser/devtools/webconsole/test/Makefile.in | 1 + .../test/browser_ConsoleAPICachedMessages.js | 74 +++++++++++++++++++ .../test/browser_webconsole_notifications.js | 22 +++--- 4 files changed, 144 insertions(+), 13 deletions(-) create mode 100644 browser/devtools/webconsole/test/browser_ConsoleAPICachedMessages.js diff --git a/browser/devtools/webconsole/HUDService.jsm b/browser/devtools/webconsole/HUDService.jsm index bfece24da8ad..632bfd8e2d96 100644 --- a/browser/devtools/webconsole/HUDService.jsm +++ b/browser/devtools/webconsole/HUDService.jsm @@ -125,6 +125,12 @@ XPCOMUtils.defineLazyGetter(this, "namesAndValuesOf", function () { return obj.namesAndValuesOf; }); +XPCOMUtils.defineLazyGetter(this, "gConsoleStorage", function () { + let obj = {}; + Cu.import("resource://gre/modules/ConsoleAPIStorage.jsm", obj); + return obj.ConsoleAPIStorage; +}); + function LogFactory(aMessagePrefix) { function log(aMessage) { @@ -1414,6 +1420,18 @@ HUD_SERVICE.prototype = return aWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils).outerWindowID; }, + /** + * Gets the ID of the inner window of this DOM window + * + * @param nsIDOMWindow aWindow + * @returns integer + */ + getInnerWindowId: function HS_getInnerWindowId(aWindow) + { + return aWindow.QueryInterface(Ci.nsIInterfaceRequestor). + getInterface(Ci.nsIDOMWindowUtils).currentInnerWindowID; + }, + /** * Gets the top level content window that has an outer window with * the given ID or returns null if no such content window exists @@ -2891,7 +2909,7 @@ HUD_SERVICE.prototype = if (!hudNode) { // get nBox object and call new HUD let config = { parentNode: nBox, - contentWindow: aContentWindow + contentWindow: aContentWindow.top }; hud = new HeadsUpDisplay(config); @@ -2904,6 +2922,8 @@ HUD_SERVICE.prototype = _browser.webProgress.addProgressListener(hud.progressListener, Ci.nsIWebProgress.NOTIFY_STATE_ALL); + + hud.displayCachedConsoleMessages(); } else { hud = this.hudReferences[hudId]; @@ -3572,6 +3592,35 @@ HeadsUpDisplay.prototype = { } }, + /** + * Display cached messages that may have been collected before the UI is + * displayed. + * + * @returns void + */ + displayCachedConsoleMessages: function HUD_displayCachedConsoleMessages() + { + // Get the messages from the ConsoleStorageService. + let windowId = HUDService.getInnerWindowId(this.contentWindow); + + let messages = gConsoleStorage.getEvents(windowId); + + // Turn off scrolling for the moment. + ConsoleUtils.scroll = false; + + messages.forEach(function(aMessage) { + HUDService.logConsoleAPIMessage(this.hudId, aMessage); + }, this); + + ConsoleUtils.scroll = true; + + // Scroll to bottom. + let numChildren = this.outputNode.childNodes.length; + if (numChildren) { + this.outputNode.ensureIndexIsVisible(numChildren - 1); + } + }, + /** * Re-attaches a console when the contentWindow is recreated * @@ -5662,6 +5711,11 @@ FirefoxApplicationHooks.prototype = { */ ConsoleUtils = { + /** + * Flag to turn on and off scrolling. + */ + scroll: true, + supString: function ConsoleUtils_supString(aString) { let str = Cc["@mozilla.org/supports-string;1"]. @@ -5705,6 +5759,10 @@ ConsoleUtils = { * @returns void */ scrollToVisible: function ConsoleUtils_scrollToVisible(aNode) { + if (!this.scroll) { + return; + } + // Find the enclosing richlistbox node. let richListBoxNode = aNode.parentNode; while (richListBoxNode.tagName != "richlistbox") { diff --git a/browser/devtools/webconsole/test/Makefile.in b/browser/devtools/webconsole/test/Makefile.in index d9f08c4b70b6..05d89cdbe511 100644 --- a/browser/devtools/webconsole/test/Makefile.in +++ b/browser/devtools/webconsole/test/Makefile.in @@ -150,6 +150,7 @@ _BROWSER_TEST_FILES = \ browser_webconsole_bug_658368_time_methods.js \ browser_webconsole_bug_622303_persistent_filters.js \ browser_webconsole_window_zombie.js \ + browser_ConsoleAPICachedMessages.js \ head.js \ $(NULL) diff --git a/browser/devtools/webconsole/test/browser_ConsoleAPICachedMessages.js b/browser/devtools/webconsole/test/browser_ConsoleAPICachedMessages.js new file mode 100644 index 000000000000..523e9d0eff85 --- /dev/null +++ b/browser/devtools/webconsole/test/browser_ConsoleAPICachedMessages.js @@ -0,0 +1,74 @@ +/* vim:set ts=2 sw=2 sts=2 et: */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is DevTools test code. + * + * The Initial Developer of the Original Code is Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * David Dahl + * Mihai Sucan + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +const TEST_URI = "data:text/html,

Web Console test for bug 609890"; + +function test() +{ + waitForExplicitFinish(); + + gBrowser.selectedTab = gBrowser.addTab(TEST_URI); + + gBrowser.selectedBrowser.addEventListener("load", testOpenUI, true); +} + +function testOpenUI() +{ + gBrowser.selectedBrowser.removeEventListener("load", testOpenUI, true); + + // test to see if the messages are + // displayed when the console UI is opened + + let console = content.wrappedJSObject.console; + console.log("log Bazzle"); + console.info("info Bazzle"); + console.warn("warn Bazzle"); + console.error("error Bazzle"); + + HUDService.activateHUDForContext(gBrowser.selectedTab); + let hudId = HUDService.getHudIdByWindow(content); + let hud = HUDService.getHudReferenceById(hudId); + + testLogEntry(hud.outputNode, "log Bazzle", + "Find a console log entry from before console UI is opened", + false, null); + + HUDService.deactivateHUDForContext(gBrowser.selectedTab); + + executeSoon(finish); +} diff --git a/browser/devtools/webconsole/test/browser_webconsole_notifications.js b/browser/devtools/webconsole/test/browser_webconsole_notifications.js index 8815a067fe9b..9ef948da0cb6 100644 --- a/browser/devtools/webconsole/test/browser_webconsole_notifications.js +++ b/browser/devtools/webconsole/test/browser_webconsole_notifications.js @@ -19,7 +19,8 @@ * the Initial Developer. All Rights Reserved. * * Contributor(s): - * David Dahl + * David Dahl + * Mihai Sucan * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -35,37 +36,34 @@ * * ***** END LICENSE BLOCK ***** */ -const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html"; +const TEST_URI = "data:text/html,

Web Console test for notifications"; function test() { observer.init(); addTab(TEST_URI); - browser.addEventListener("DOMContentLoaded", onLoad, false); + browser.addEventListener("load", onLoad, true); } function webConsoleCreated(aID) { Services.obs.removeObserver(observer, "web-console-created"); - executeSoon(function (){ - ok(HUDService.hudReferences[aID], "We have a hud reference"); - let console = browser.contentWindow.wrappedJSObject.console; - console.log("adding a log message"); - }); + ok(HUDService.hudReferences[aID], "We have a hud reference"); + content.wrappedJSObject.console.log("adding a log message"); } function webConsoleDestroyed(aID) { Services.obs.removeObserver(observer, "web-console-destroyed"); ok(!HUDService.hudReferences[aID], "We do not have a hud reference"); - finishTest(); + executeSoon(finishTest); } function webConsoleMessage(aID, aNodeID) { Services.obs.removeObserver(observer, "web-console-message-created"); ok(aID, "we have a console ID"); - ok(typeof aNodeID == 'string', "message node id is not null"); - closeConsole(); + is(typeof aNodeID, "string", "message node id is a string"); + executeSoon(closeConsole); } let observer = { @@ -100,6 +98,6 @@ let observer = { }; function onLoad() { - browser.removeEventListener("DOMContentLoaded", onLoad, false); + browser.removeEventListener("load", onLoad, true); openConsole(); } From 93268df253e080ec9b3772b7c45b52bcd937cab6 Mon Sep 17 00:00:00 2001 From: Mihai Sucan Date: Wed, 11 Jan 2012 12:51:49 +0200 Subject: [PATCH 02/12] Bug 611032 - Errors from before the Web Console is opened do not show. r=gavin.sharp,rcampbell f=rcampbell --HG-- rename : browser/devtools/webconsole/test/browser_ConsoleAPICachedMessages.js => browser/devtools/webconsole/test/browser_cached_messages.js --- browser/devtools/webconsole/HUDService.jsm | 161 +++++++++++------- browser/devtools/webconsole/test/Makefile.in | 3 +- ...Messages.js => browser_cached_messages.js} | 33 ++-- .../test/browser_webconsole_bug_611795.js | 3 + .../test/test-webconsole-error-observer.html | 24 +++ dom/base/ConsoleAPI.js | 3 +- dom/base/ConsoleAPIStorage.jsm | 2 +- 7 files changed, 148 insertions(+), 81 deletions(-) rename browser/devtools/webconsole/test/{browser_ConsoleAPICachedMessages.js => browser_cached_messages.js} (74%) create mode 100644 browser/devtools/webconsole/test/test-webconsole-error-observer.html diff --git a/browser/devtools/webconsole/HUDService.jsm b/browser/devtools/webconsole/HUDService.jsm index 632bfd8e2d96..c2db89f06f7f 100644 --- a/browser/devtools/webconsole/HUDService.jsm +++ b/browser/devtools/webconsole/HUDService.jsm @@ -2159,7 +2159,8 @@ HUD_SERVICE.prototype = sourceURL, sourceLine, clipboardText, - level); + level, + aMessage.timeStamp); // Make the node bring up the property panel, to allow the user to inspect // the stack trace. @@ -2226,18 +2227,38 @@ HUD_SERVICE.prototype = /** * Reports an error in the page source, either JavaScript or CSS. * - * @param number aCategory - * The category of the message; either CATEGORY_CSS or CATEGORY_JS. * @param nsIScriptError aScriptError * The error message to report. * @return void */ - reportPageError: function HS_reportPageError(aCategory, aScriptError) + reportPageError: function HS_reportPageError(aScriptError) { - if (aCategory != CATEGORY_CSS && aCategory != CATEGORY_JS) { - throw Components.Exception("Unsupported category (must be one of CSS " + - "or JS)", Cr.NS_ERROR_INVALID_ARG, - Components.stack.caller); + if (!aScriptError.outerWindowID) { + return; + } + + let category; + + switch (aScriptError.category) { + // We ignore chrome-originating errors as we only care about content. + case "XPConnect JavaScript": + case "component javascript": + case "chrome javascript": + case "chrome registration": + case "XBL": + case "XBL Prototype Handler": + case "XBL Content Sink": + case "xbl javascript": + return; + + case "CSS Parser": + case "CSS Loader": + category = CATEGORY_CSS; + break; + + default: + category = CATEGORY_JS; + break; } // Warnings and legacy strict errors become warnings; other types become @@ -2256,12 +2277,14 @@ HUD_SERVICE.prototype = let chromeDocument = outputNode.ownerDocument; let node = ConsoleUtils.createMessageNode(chromeDocument, - aCategory, + category, severity, aScriptError.errorMessage, hudId, aScriptError.sourceName, - aScriptError.lineNumber); + aScriptError.lineNumber, + null, null, + aScriptError.timeStamp); ConsoleUtils.outputMessageNode(node, hudId); } @@ -3600,23 +3623,46 @@ HeadsUpDisplay.prototype = { */ displayCachedConsoleMessages: function HUD_displayCachedConsoleMessages() { - // Get the messages from the ConsoleStorageService. - let windowId = HUDService.getInnerWindowId(this.contentWindow); + let innerWindowId = HUDService.getInnerWindowId(this.contentWindow); - let messages = gConsoleStorage.getEvents(windowId); + let messages = gConsoleStorage.getEvents(innerWindowId); + + let errors = {}; + Services.console.getMessageArray(errors, {}); + + // Filter the errors to find only those we should display. + let filteredErrors = (errors.value || []).filter(function(aError) { + return aError instanceof Ci.nsIScriptError && + aError.innerWindowID == innerWindowId; + }, this); + + messages.push.apply(messages, filteredErrors); + messages.sort(function(a, b) { return a.timeStamp - b.timeStamp; }); // Turn off scrolling for the moment. ConsoleUtils.scroll = false; + this.outputNode.hidden = true; + // Display all messages. messages.forEach(function(aMessage) { - HUDService.logConsoleAPIMessage(this.hudId, aMessage); + if (aMessage instanceof Ci.nsIScriptError) { + HUDService.reportPageError(aMessage); + } + else { + // In this case the cached message is a console message generated + // by the ConsoleAPI, not an nsIScriptError + HUDService.logConsoleAPIMessage(this.hudId, aMessage); + } }, this); + this.outputNode.hidden = false; ConsoleUtils.scroll = true; // Scroll to bottom. let numChildren = this.outputNode.childNodes.length; - if (numChildren) { + if (numChildren && this.outputNode.clientHeight) { + // We also check the clientHeight to force a reflow, otherwise + // ensureIndexIsVisible() does not work after outputNode.hidden = false. this.outputNode.ensureIndexIsVisible(numChildren - 1); } }, @@ -4053,7 +4099,7 @@ HeadsUpDisplay.prototype = { function HUD_clearButton_onCommand() { let hud = HUDService.getHudReferenceById(hudId); if (hud.jsterm) { - hud.jsterm.clearOutput(); + hud.jsterm.clearOutput(true); } if (hud.gcliterm) { hud.gcliterm.clearOutput(); @@ -4571,7 +4617,7 @@ function JSTermHelper(aJSTerm) aJSTerm.sandbox.clear = function JSTH_clear() { aJSTerm.helperEvaluated = true; - aJSTerm.clearOutput(); + aJSTerm.clearOutput(true); }; /** @@ -5163,7 +5209,14 @@ JSTerm.prototype = { return type.toLowerCase(); }, - clearOutput: function JST_clearOutput() + /** + * Clear the Web Console output. + * + * @param boolean aClearStorage + * True if you want to clear the console messages storage associated to + * this Web Console. + */ + clearOutput: function JST_clearOutput(aClearStorage) { let hud = HUDService.getHudReferenceById(this.hudId); hud.cssNodes = {}; @@ -5181,6 +5234,11 @@ JSTerm.prototype = { hud.HUDBox.lastTimestamp = 0; hud.groupDepth = 0; + + if (aClearStorage) { + let windowId = HUDService.getInnerWindowId(hud.contentWindow); + gConsoleStorage.clearEvents(windowId); + } }, /** @@ -5800,6 +5858,9 @@ ConsoleUtils = { * a string, then the clipboard text must be supplied. * @param number aLevel [optional] * The level of the console API message. + * @param number aTimeStamp [optional] + * The timestamp to use for this message node. If omitted, the current + * date and time is used. * @return nsIDOMNode * The message node: a XUL richlistitem ready to be inserted into * the Web Console output node. @@ -5807,7 +5868,8 @@ ConsoleUtils = { createMessageNode: function ConsoleUtils_createMessageNode(aDocument, aCategory, aSeverity, aBody, aHUDId, aSourceURL, - aSourceLine, aClipboardText, aLevel) { + aSourceLine, aClipboardText, aLevel, + aTimeStamp) { if (typeof aBody != "string" && aClipboardText == null && aBody.innerText) { aClipboardText = aBody.innerText; } @@ -5867,7 +5929,7 @@ ConsoleUtils = { // Create the timestamp. let timestampNode = aDocument.createElementNS(XUL_NS, "label"); timestampNode.classList.add("webconsole-timestamp"); - let timestamp = ConsoleUtils.timestamp(); + let timestamp = aTimeStamp || ConsoleUtils.timestamp(); let timestampString = ConsoleUtils.timestampString(timestamp); timestampNode.setAttribute("value", timestampString); @@ -6573,48 +6635,22 @@ HUDConsoleObserver = { init: function HCO_init() { Services.console.registerListener(this); - Services.obs.addObserver(this, "xpcom-shutdown", false); + Services.obs.addObserver(this, "quit-application-granted", false); }, uninit: function HCO_uninit() { Services.console.unregisterListener(this); - Services.obs.removeObserver(this, "xpcom-shutdown"); + Services.obs.removeObserver(this, "quit-application-granted"); }, observe: function HCO_observe(aSubject, aTopic, aData) { - if (aTopic == "xpcom-shutdown") { + if (aTopic == "quit-application-granted") { this.uninit(); - return; } - - if (!(aSubject instanceof Ci.nsIScriptError) || - !aSubject.outerWindowID) { - return; - } - - switch (aSubject.category) { - // We ignore chrome-originating errors as we only - // care about content. - case "XPConnect JavaScript": - case "component javascript": - case "chrome javascript": - case "chrome registration": - case "XBL": - case "XBL Prototype Handler": - case "XBL Content Sink": - case "xbl javascript": - return; - - case "CSS Parser": - case "CSS Loader": - HUDService.reportPageError(CATEGORY_CSS, aSubject); - return; - - default: - HUDService.reportPageError(CATEGORY_JS, aSubject); - return; + else if (aSubject instanceof Ci.nsIScriptError) { + HUDService.reportPageError(aSubject); } } }; @@ -6729,21 +6765,14 @@ function appName() throw new Error("appName: UNSUPPORTED APPLICATION UUID"); } -/////////////////////////////////////////////////////////////////////////// -// HUDService (exported symbol) -/////////////////////////////////////////////////////////////////////////// - -try { - // start the HUDService - // This is in a try block because we want to kill everything if - // *any* of this fails - var HUDService = new HUD_SERVICE(); -} -catch (ex) { - Cu.reportError("HUDService failed initialization.\n" + ex); - // TODO: kill anything that may have started up - // see bug 568665 -} +XPCOMUtils.defineLazyGetter(this, "HUDService", function () { + try { + return new HUD_SERVICE(); + } + catch (ex) { + Cu.reportError(ex); + } +}); /////////////////////////////////////////////////////////////////////////// // GcliTerm diff --git a/browser/devtools/webconsole/test/Makefile.in b/browser/devtools/webconsole/test/Makefile.in index 05d89cdbe511..8592d9e4df64 100644 --- a/browser/devtools/webconsole/test/Makefile.in +++ b/browser/devtools/webconsole/test/Makefile.in @@ -150,7 +150,7 @@ _BROWSER_TEST_FILES = \ browser_webconsole_bug_658368_time_methods.js \ browser_webconsole_bug_622303_persistent_filters.js \ browser_webconsole_window_zombie.js \ - browser_ConsoleAPICachedMessages.js \ + browser_cached_messages.js \ head.js \ $(NULL) @@ -223,6 +223,7 @@ _BROWSER_TEST_PAGES = \ test-file-location.js \ browser_gcli_inspect.html \ test-bug-658368-time-methods.html \ + test-webconsole-error-observer.html \ $(NULL) libs:: $(_BROWSER_TEST_FILES) diff --git a/browser/devtools/webconsole/test/browser_ConsoleAPICachedMessages.js b/browser/devtools/webconsole/test/browser_cached_messages.js similarity index 74% rename from browser/devtools/webconsole/test/browser_ConsoleAPICachedMessages.js rename to browser/devtools/webconsole/test/browser_cached_messages.js index 523e9d0eff85..da283813b69a 100644 --- a/browser/devtools/webconsole/test/browser_ConsoleAPICachedMessages.js +++ b/browser/devtools/webconsole/test/browser_cached_messages.js @@ -36,30 +36,27 @@ * * ***** END LICENSE BLOCK ***** */ -const TEST_URI = "data:text/html,

Web Console test for bug 609890"; +const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-webconsole-error-observer.html"; function test() { waitForExplicitFinish(); + expectUncaughtException(); + gBrowser.selectedTab = gBrowser.addTab(TEST_URI); - gBrowser.selectedBrowser.addEventListener("load", testOpenUI, true); + gBrowser.selectedBrowser.addEventListener("load", function onLoad() { + gBrowser.selectedBrowser.removeEventListener("load", onLoad, true); + testOpenUI(true); + }, true); } -function testOpenUI() +function testOpenUI(aTestReopen) { - gBrowser.selectedBrowser.removeEventListener("load", testOpenUI, true); - // test to see if the messages are // displayed when the console UI is opened - let console = content.wrappedJSObject.console; - console.log("log Bazzle"); - console.info("info Bazzle"); - console.warn("warn Bazzle"); - console.error("error Bazzle"); - HUDService.activateHUDForContext(gBrowser.selectedTab); let hudId = HUDService.getHudIdByWindow(content); let hud = HUDService.getHudReferenceById(hudId); @@ -68,7 +65,19 @@ function testOpenUI() "Find a console log entry from before console UI is opened", false, null); + testLogEntry(hud.outputNode, "error Bazzle", + "Find a console error entry from before console UI is opened", + false, null); + + testLogEntry(hud.outputNode, "bazBug611032", "Found the JavaScript error"); + testLogEntry(hud.outputNode, "cssColorBug611032", "Found the CSS error"); + HUDService.deactivateHUDForContext(gBrowser.selectedTab); - executeSoon(finish); + if (aTestReopen) { + HUDService.deactivateHUDForContext(gBrowser.selectedTab); + executeSoon(testOpenUI); + } else { + executeSoon(finish); + } } diff --git a/browser/devtools/webconsole/test/browser_webconsole_bug_611795.js b/browser/devtools/webconsole/test/browser_webconsole_bug_611795.js index 42ee1a6e0d9d..8f1ee20c1dbf 100644 --- a/browser/devtools/webconsole/test/browser_webconsole_bug_611795.js +++ b/browser/devtools/webconsole/test/browser_webconsole_bug_611795.js @@ -48,6 +48,9 @@ function test() browser.removeEventListener("load", arguments.callee, true); openConsole(); + // Clear cached messages that are shown once the Web Console opens. + HUDService.getHudByWindow(content).jsterm.clearOutput(true); + browser.addEventListener("load", onContentLoaded, true); content.location.reload(); }, true); diff --git a/browser/devtools/webconsole/test/test-webconsole-error-observer.html b/browser/devtools/webconsole/test/test-webconsole-error-observer.html new file mode 100644 index 000000000000..cc08b97bacfd --- /dev/null +++ b/browser/devtools/webconsole/test/test-webconsole-error-observer.html @@ -0,0 +1,24 @@ + + + + WebConsoleErrorObserver test - bug 611032 + + + + + +

WebConsoleErrorObserver test

+ + + diff --git a/dom/base/ConsoleAPI.js b/dom/base/ConsoleAPI.js index a2239eab9515..6c7799b8513c 100644 --- a/dom/base/ConsoleAPI.js +++ b/dom/base/ConsoleAPI.js @@ -202,7 +202,8 @@ ConsoleAPI.prototype = { filename: frame.filename, lineNumber: frame.lineNumber, functionName: frame.functionName, - arguments: aArguments + arguments: aArguments, + timeStamp: Date.now(), }; consoleEvent.wrappedJSObject = consoleEvent; diff --git a/dom/base/ConsoleAPIStorage.jsm b/dom/base/ConsoleAPIStorage.jsm index 4706a888d49e..4c57a75dcd6b 100644 --- a/dom/base/ConsoleAPIStorage.jsm +++ b/dom/base/ConsoleAPIStorage.jsm @@ -121,7 +121,7 @@ var ConsoleAPIStorage = { */ getEvents: function CS_getEvents(aId) { - return _consoleStorage[aId] || []; + return (_consoleStorage[aId] || []).slice(0); }, /** From 39695474b7c3153d689fb60cd16abeb6986a35c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Wed, 11 Jan 2012 11:16:42 -0800 Subject: [PATCH 03/12] Bug 714083 - Update app.support.baseURL to point to support.mozilla.org [r=gavin] --- browser/app/profile/firefox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 5f8f826cf3c4..07d63c8f4cc0 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -872,7 +872,7 @@ pref("browser.zoom.updateBackgroundTabs", true); pref("breakpad.reportURL", "http://crash-stats.mozilla.com/report/index/"); // base URL for web-based support pages -pref("app.support.baseURL", "http://support.mozilla.com/1/firefox/%VERSION%/%OS%/%LOCALE%/"); +pref("app.support.baseURL", "http://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/"); // Name of alternate about: page for certificate errors (when undefined, defaults to about:neterror) pref("security.alternate_certificate_error_page", "certerror"); From 2d1a9edfb0d0017ea99bd32abbe696f23c1fff9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Wed, 11 Jan 2012 11:16:52 -0800 Subject: [PATCH 04/12] Bug 717030 - Cancel fullscreen animation when entering dom fullscreen [r=dao] --- browser/base/content/browser.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 9620d28e8e0b..b1ffeac036d4 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -3907,13 +3907,10 @@ var FullScreen = { } else { // The user may quit fullscreen during an animation - window.mozCancelAnimationFrame(this._animationHandle); - this._animationHandle = 0; - clearTimeout(this._animationTimeout); + this._cancelAnimation(); gNavToolbox.style.marginTop = ""; if (this._isChromeCollapsed) this.mouseoverToggle(true); - this._isAnimating = false; // This is needed if they use the context menu to quit fullscreen this._isPopupOpen = false; @@ -3974,10 +3971,7 @@ var FullScreen = { // Cancel any "hide the toolbar" animation which is in progress, and make // the toolbar hide immediately. - clearInterval(this._animationInterval); - clearTimeout(this._animationTimeout); - this._isAnimating = false; - this._shouldAnimate = false; + this._cancelAnimation(); this.mouseoverToggle(false); // If there's a full-screen toggler, remove its listeners, so that mouseover @@ -4122,11 +4116,8 @@ var FullScreen = { if (pos >= 1) { // We've animated enough - window.mozCancelAnimationFrame(this._animationHandle); + this._cancelAnimation(); gNavToolbox.style.marginTop = ""; - this._animationHandle = 0; - this._isAnimating = false; - this._shouldAnimate = false; // Just to make sure this.mouseoverToggle(false); return; } @@ -4135,6 +4126,14 @@ var FullScreen = { this._animationHandle = window.mozRequestAnimationFrame(this); }, + _cancelAnimation: function() { + window.mozCancelAnimationFrame(this._animationHandle); + this._animationHandle = 0; + clearTimeout(this._animationTimeout); + this._isAnimating = false; + this._shouldAnimate = false; + }, + cancelWarning: function(event) { if (!this.warningBox) { return; From 00bc0879609a96e402d4b0106e8fb71b8f360b83 Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Thu, 12 Jan 2012 09:57:07 +0000 Subject: [PATCH 05/12] Bug 715501 - GCLI should be built with the latest version of dryice --- browser/devtools/webconsole/gcli.jsm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/browser/devtools/webconsole/gcli.jsm b/browser/devtools/webconsole/gcli.jsm index 0053238afcd2..321b06007f2a 100644 --- a/browser/devtools/webconsole/gcli.jsm +++ b/browser/devtools/webconsole/gcli.jsm @@ -5324,7 +5324,8 @@ define('gcli/ui/domtemplate', ['require', 'exports', 'module' ], function(requir exports.template = obj.template; }); -define("text!gcli/commands/help.css", [], void 0); +define("text!gcli/commands/help.css", [], ""); + define("text!gcli/commands/help_intro.html", [], "\n" + "

${l10n.introHeader}

\n" + "\n" + @@ -6286,7 +6287,8 @@ History.prototype.backward = function() { exports.History = History; -});define("text!gcli/ui/inputter.css", [], void 0); +});define("text!gcli/ui/inputter.css", [], ""); + /* * Copyright 2009-2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE.txt or: @@ -7419,7 +7421,8 @@ exports.CommandMenu = CommandMenu; }); -define("text!gcli/ui/menu.css", [], void 0); +define("text!gcli/ui/menu.css", [], ""); + define("text!gcli/ui/menu.html", [], "\n" + "\n" + " \n" + ""); -define("text!gcli/ui/arg_fetch.css", [], void 0); +define("text!gcli/ui/arg_fetch.css", [], ""); + define("text!gcli/ui/arg_fetch.html", [], "\n" + "