.title > .key")
- .getAttribute("value"), "Array",
- "Should have the right property name for Array.");
+ .getAttribute("value"), "InstallTrigger",
+ "Should have the right property name for InstallTrigger.");
ok(localNodes[0].querySelector(".property > .title > .value")
.getAttribute("value").search(/object/) != -1,
"Array should be an object.");
diff --git a/browser/devtools/debugger/test/browser_dbg_propertyview-09.js b/browser/devtools/debugger/test/browser_dbg_propertyview-09.js
index 78b037a820f7..4cece3ef54dd 100644
--- a/browser/devtools/debugger/test/browser_dbg_propertyview-09.js
+++ b/browser/devtools/debugger/test/browser_dbg_propertyview-09.js
@@ -38,7 +38,7 @@ function testFrameParameters()
var frames = gDebugger.DebuggerView.StackFrames._frames,
globalScope = gDebugger.DebuggerView.Properties._vars.lastChild,
- globalNodes = globalScope.querySelector(".details").childNodes;
+ globalNodes = globalScope.childNodes[2].childNodes;
globalScope.expand();
@@ -55,11 +55,11 @@ function testFrameParameters()
"Should have the right property value for |Array|.");
let len = globalNodes.length - 1;
- is(globalNodes[len].querySelector(".name").getAttribute("value"), "window",
- "Should have the right property name for |window|.");
+ is(globalNodes[len].querySelector(".name").getAttribute("value"), "uneval",
+ "Should have the right property name for |uneval|.");
- is(globalNodes[len].querySelector(".value").getAttribute("value"), "[object Proxy]",
- "Should have the right property value for |window|.");
+ is(globalNodes[len].querySelector(".value").getAttribute("value"), "[object Function]",
+ "Should have the right property value for |uneval|.");
resumeAndFinish();
}}, 0);
diff --git a/browser/devtools/debugger/test/browser_dbg_propertyview-10.js b/browser/devtools/debugger/test/browser_dbg_propertyview-10.js
index 1da2d06f159d..0885d3e4d939 100644
--- a/browser/devtools/debugger/test/browser_dbg_propertyview-10.js
+++ b/browser/devtools/debugger/test/browser_dbg_propertyview-10.js
@@ -59,11 +59,11 @@ function testWithFrame()
is(innerNodes[1].querySelector(".value").getAttribute("value"), "1",
"Should have the right property value for |one|.");
- is(globalNodes[0].querySelector(".name").getAttribute("value"), "Array",
+ is(globalNodes[0].querySelector(".name").getAttribute("value"), "InstallTrigger",
"Should have the right property name for |Array|.");
- is(globalNodes[0].querySelector(".value").getAttribute("value"), "[object Function]",
- "Should have the right property value for |Array|.");
+ is(globalNodes[0].querySelector(".value").getAttribute("value"), "undefined",
+ "Should have the right property value for |InstallTrigger|.");
let len = globalNodes.length - 1;
is(globalNodes[len].querySelector(".name").getAttribute("value"), "window",
diff --git a/browser/devtools/debugger/test/test-script-switching-02.js b/browser/devtools/debugger/test/test-script-switching-02.js
index 56ab14ccb922..6606bd366aa9 100644
--- a/browser/devtools/debugger/test/test-script-switching-02.js
+++ b/browser/devtools/debugger/test/test-script-switching-02.js
@@ -4,4 +4,8 @@
function secondCall() {
// This comment is useful for browser_dbg_select-line.js. ☺
eval("debugger;");
+ function foo() {}
+ if (true) {
+ foo();
+ }
}
diff --git a/browser/devtools/styleeditor/StyleEditorChrome.jsm b/browser/devtools/styleeditor/StyleEditorChrome.jsm
index 9ce4002f2ecb..93d02f27cafd 100644
--- a/browser/devtools/styleeditor/StyleEditorChrome.jsm
+++ b/browser/devtools/styleeditor/StyleEditorChrome.jsm
@@ -350,10 +350,12 @@ StyleEditorChrome.prototype = {
if (!aEditor.sourceEditor) {
// If a line or column was specified we move the caret appropriately.
if (setCaret) {
+ let self = this;
aEditor.addActionListener({
onAttach: function SEC_selectSheet_onAttach()
{
aEditor.removeActionListener(this);
+ self.selectedStyleSheetIndex = aEditor.styleSheetIndex;
aEditor.sourceEditor.setCaretPosition(aLine - 1, aCol - 1);
}
});
@@ -367,6 +369,7 @@ StyleEditorChrome.prototype = {
aEditor.sourceEditor.setCaretPosition(aLine - 1, aCol - 1);
}
}
+ this.selectedStyleSheetIndex = aEditor.styleSheetIndex;
}.bind(this);
if (!this.editors.length) {
diff --git a/browser/devtools/webconsole/HUDService.jsm b/browser/devtools/webconsole/HUDService.jsm
index 19d5e9c14fb4..860f5a62ac4a 100644
--- a/browser/devtools/webconsole/HUDService.jsm
+++ b/browser/devtools/webconsole/HUDService.jsm
@@ -900,6 +900,53 @@ WebConsole.prototype = {
this.chromeWindow.openUILinkIn(aLink, "tab");
},
+ /**
+ * Open a link in Firefox's view source.
+ *
+ * @param string aSourceURL
+ * The URL of the file.
+ * @param integer aSourceLine
+ * The line number which should be highlighted.
+ */
+ viewSource: function WC_viewSource(aSourceURL, aSourceLine)
+ {
+ this.gViewSourceUtils.viewSource(aSourceURL, null,
+ this.iframeWindow.document, aSourceLine);
+ },
+
+ /**
+ * Tries to open a Stylesheet file related to the web page for the web console
+ * instance in the Style Editor. If the file is not found, it is opened in
+ * source view instead.
+ *
+ * @param string aSourceURL
+ * The URL of the file.
+ * @param integer aSourceLine
+ * The line number which you want to place the caret.
+ * TODO: This function breaks the client-server boundaries.
+ * To be fixed in bug 793259.
+ */
+ viewSourceInStyleEditor:
+ function WC_viewSourceInStyleEditor(aSourceURL, aSourceLine)
+ {
+ let styleSheets = this.tab.linkedBrowser.contentWindow.document.styleSheets;
+ for each (let style in styleSheets) {
+ if (style.href == aSourceURL) {
+ let SEM = this.chromeWindow.StyleEditor.StyleEditorManager;
+ let win = SEM.getEditorForWindow(this.chromeWindow.content.window);
+ if (win) {
+ SEM.selectEditor(win, style, aSourceLine);
+ }
+ else {
+ this.chromeWindow.StyleEditor.openChrome(style, aSourceLine);
+ }
+ return;
+ }
+ }
+ // Open view source if style editor fails.
+ this.viewSource(aSourceURL, aSourceLine);
+ },
+
/**
* Destroy the object. Call this method to avoid memory leaks when the Web
* Console is closed.
diff --git a/browser/devtools/webconsole/test/Makefile.in b/browser/devtools/webconsole/test/Makefile.in
index d5d88fe8c3f9..147588efa38e 100644
--- a/browser/devtools/webconsole/test/Makefile.in
+++ b/browser/devtools/webconsole/test/Makefile.in
@@ -109,6 +109,7 @@ MOCHITEST_BROWSER_FILES = \
browser_webconsole_bug_622303_persistent_filters.js \
browser_webconsole_bug_770099_bad_policyuri.js \
browser_webconsole_bug_770099_violation.js \
+ browser_webconsole_bug_782653_CSS_links_in_Style_Editor.js \
browser_webconsole_window_zombie.js \
browser_cached_messages.js \
browser_bug664688_sandbox_update_after_navigation.js \
@@ -186,6 +187,9 @@ MOCHITEST_BROWSER_FILES += \
test-bug-644419-log-limits.html \
test-bug-632275-getters.html \
test-bug-646025-console-file-location.html \
+ test-bug-782653-css-errors.html \
+ test-bug-782653-css-errors-1.css \
+ test-bug-782653-css-errors-2.css \
test-file-location.js \
test-bug-658368-time-methods.html \
test-webconsole-error-observer.html \
diff --git a/browser/devtools/webconsole/test/browser_webconsole_bug_782653_CSS_links_in_Style_Editor.js b/browser/devtools/webconsole/test/browser_webconsole_bug_782653_CSS_links_in_Style_Editor.js
new file mode 100644
index 000000000000..5cb32b066c76
--- /dev/null
+++ b/browser/devtools/webconsole/test/browser_webconsole_bug_782653_CSS_links_in_Style_Editor.js
@@ -0,0 +1,133 @@
+/* vim:set ts=2 sw=2 sts=2 et: */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ * ***** END LICENSE BLOCK ***** */
+
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test" +
+ "/test-bug-782653-css-errors.html";
+
+let nodes;
+
+let styleEditorWin;
+
+function test() {
+ addTab(TEST_URI);
+ browser.addEventListener("load", function onLoad() {
+ browser.removeEventListener("load", onLoad, true);
+ openConsole(null, testViewSource);
+ }, true);
+}
+
+function testViewSource(hud) {
+
+ waitForSuccess({
+ name: "find the location node",
+ validatorFn: function()
+ {
+ return hud.outputNode.querySelector(".webconsole-location");
+ },
+ successFn: function()
+ {
+ nodes = hud.outputNode.querySelectorAll(".webconsole-location");
+
+ Services.ww.registerNotification(observer);
+
+ EventUtils.sendMouseEvent({ type: "click" }, nodes[0]);
+ },
+ failureFn: finishTest,
+ });
+}
+
+function checkStyleEditorForSheetAndLine(aStyleSheetIndex, aLine, aCallback) {
+
+ function doCheck(aEditor) {
+ if (aEditor.styleSheetIndex != aStyleSheetIndex) {
+ ok(false, "Correct Style Sheet was not selected.");
+ if (aCallback) {
+ executeSoon(aCallback);
+ }
+ return;
+ }
+
+ ok(true, "Correct Style Sheet is selected in the editor");
+
+ // Editor is already loaded, check the current line of caret.
+ if (aEditor.sourceEditor) {
+ executeSoon(function() {
+ is(aEditor.sourceEditor.getCaretPosition().line, aLine,
+ "Correct line is selected");
+ if (aCallback) {
+ aCallback();
+ }
+ });
+ return;
+ }
+
+ // Wait for source editor to be loaded.
+ aEditor.addActionListener({
+ onAttach: function onAttach() {
+ aEditor.removeActionListener(this);
+
+ executeSoon(function() {
+ is(aEditor.sourceEditor.getCaretPosition().line, aLine,
+ "Correct line is selected");
+ if (aCallback) {
+ aCallback();
+ }
+ });
+ }
+ });
+ }
+
+ let SEC = styleEditorWin.styleEditorChrome;
+ ok(SEC, "Syle Editor Chrome is defined properly while calling for [" +
+ aStyleSheetIndex + ", " + aLine + "]");
+
+ // Editors are not ready, so wait for them.
+ if (!SEC.editors.length) {
+ SEC.addChromeListener({
+ onEditorAdded: function onEditorAdded(aChrome, aEditor) {
+ aChrome.removeChromeListener(this);
+ doCheck(aEditor);
+ }
+ });
+ }
+ // Execute soon so that selectedStyleSheetIndex has correct value.
+ else {
+ executeSoon(function() {
+ let aEditor = SEC.editors[SEC.selectedStyleSheetIndex];
+ doCheck(aEditor);
+ });
+ }
+}
+
+let observer = {
+ observe: function(aSubject, aTopic, aData) {
+ if (aTopic != "domwindowopened") {
+ return;
+ }
+ Services.ww.unregisterNotification(observer);
+ ok(true, "Style Editor window was opened in response to clicking " +
+ "the location node");
+
+ executeSoon(function() {
+ styleEditorWin = window.StyleEditor
+ .StyleEditorManager
+ .getEditorForWindow(content.window);
+ ok(styleEditorWin, "Style Editor Window is defined");
+ styleEditorWin.addEventListener("load", function onStyleEditorWinLoad() {
+ styleEditorWin.removeEventListener("load", onStyleEditorWinLoad);
+
+ checkStyleEditorForSheetAndLine(0, 7, function() {
+ checkStyleEditorForSheetAndLine(1, 6, function() {
+ window.StyleEditor.toggle();
+ styleEditorWin = null;
+ finishTest();
+ });
+ EventUtils.sendMouseEvent({ type: "click" }, nodes[1]);
+ });
+ });
+ });
+ }
+};
diff --git a/browser/devtools/webconsole/test/test-bug-782653-css-errors-1.css b/browser/devtools/webconsole/test/test-bug-782653-css-errors-1.css
new file mode 100644
index 000000000000..ad7fd1999542
--- /dev/null
+++ b/browser/devtools/webconsole/test/test-bug-782653-css-errors-1.css
@@ -0,0 +1,10 @@
+/*
+ * Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+body {
+ color: #0f0;
+ font-weight: green;
+}
+
diff --git a/browser/devtools/webconsole/test/test-bug-782653-css-errors-2.css b/browser/devtools/webconsole/test/test-bug-782653-css-errors-2.css
new file mode 100644
index 000000000000..91b14137a273
--- /dev/null
+++ b/browser/devtools/webconsole/test/test-bug-782653-css-errors-2.css
@@ -0,0 +1,10 @@
+/*
+ * Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+body {
+ color: #0fl;
+ font-weight: bold;
+}
+
diff --git a/browser/devtools/webconsole/test/test-bug-782653-css-errors.html b/browser/devtools/webconsole/test/test-bug-782653-css-errors.html
new file mode 100644
index 000000000000..7ca11fc34078
--- /dev/null
+++ b/browser/devtools/webconsole/test/test-bug-782653-css-errors.html
@@ -0,0 +1,14 @@
+
+
+
+
+ Web Console test for bug 782653 : Open CSS Links in Style Editor
+
+
+
+
+
+ Web Console test for bug 782653 : Open CSS Links in Style Editor.
+
+
diff --git a/browser/devtools/webconsole/webconsole.js b/browser/devtools/webconsole/webconsole.js
index a7c40d7d0e14..4714ceabdd1b 100644
--- a/browser/devtools/webconsole/webconsole.js
+++ b/browser/devtools/webconsole/webconsole.js
@@ -1398,8 +1398,7 @@ WebConsoleFrame.prototype = {
urlNode, null, null, aFileURI);
this.makeOutputMessageLink(outputNode, function WCF__onFileClick() {
- let viewSourceUtils = this.owner.gViewSourceUtils;
- viewSourceUtils.viewSource(aFileURI, null, this.document);
+ this.owner.viewSource(aFileURI);
}.bind(this));
return outputNode;
@@ -2389,10 +2388,13 @@ WebConsoleFrame.prototype = {
if (win) {
win.focus();
}
- return;
}
- let viewSourceUtils = this.owner.gViewSourceUtils;
- viewSourceUtils.viewSource(aSourceURL, null, this.document, aSourceLine);
+ else if (locationNode.parentNode.category == CATEGORY_CSS) {
+ this.owner.viewSourceInStyleEditor(aSourceURL, aSourceLine);
+ }
+ else {
+ this.owner.viewSource(aSourceURL, aSourceLine);
+ }
}.bind(this), true);
return locationNode;
diff --git a/browser/locales/en-US/chrome/browser/devtools/debugger.dtd b/browser/locales/en-US/chrome/browser/devtools/debugger.dtd
index d88efe3d0232..4302a1eee341 100644
--- a/browser/locales/en-US/chrome/browser/devtools/debugger.dtd
+++ b/browser/locales/en-US/chrome/browser/devtools/debugger.dtd
@@ -39,6 +39,11 @@
- checkbox that toggles pausing on exceptions. -->
+
+
+
diff --git a/browser/themes/gnomestripe/devtools/markup-view.css b/browser/themes/gnomestripe/devtools/markup-view.css
index 9e80d56f09b6..e6ef611057cd 100644
--- a/browser/themes/gnomestripe/devtools/markup-view.css
+++ b/browser/themes/gnomestripe/devtools/markup-view.css
@@ -43,10 +43,7 @@ li.container {
.expander {
position: absolute;
-moz-appearance: treetwisty;
- top: 0;
- left: 0;
- width: 14px;
- height: 14px;
+ padding: 11px 0;
}
.expander[expanded] {