summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2016-10-13 13:55:13 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2016-10-13 13:55:13 +0200
commitdbf9cf0c853baa2e0b59280290e4da4ec927cd99 (patch)
treeed0efa1b5be5f7e74f4374df11e63ba3220c0e4d
parentd0dbd921dc9568b9c09764360730a7aea321e1cb (diff)
downloadpalemoon-gre-dbf9cf0c853baa2e0b59280290e4da4ec927cd99.tar.gz
Minor fix: DevTools - Style editor (editing CSS)
-rw-r--r--toolkit/devtools/server/actors/csscoverage.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/toolkit/devtools/server/actors/csscoverage.js b/toolkit/devtools/server/actors/csscoverage.js
index 18b045687..08d6cc447 100644
--- a/toolkit/devtools/server/actors/csscoverage.js
+++ b/toolkit/devtools/server/actors/csscoverage.js
@@ -720,6 +720,7 @@ exports.SEL_ALL = [
/**
* Find a URL for a given stylesheet
+ * @param stylesheet {StyleSheet|StyleSheetActor}
*/
const sheetToUrl = exports.sheetToUrl = function(stylesheet) {
// For <link> elements
@@ -735,6 +736,11 @@ const sheetToUrl = exports.sheetToUrl = function(stylesheet) {
return getURL(document) + ' → <style> index ' + index;
}
+ // When `stylesheet` is a StyleSheetActor, we don't have access to ownerNode
+ if (stylesheet.nodeHref) {
+ return stylesheet.nodeHref + " → <style> index " + stylesheet.styleSheetIndex;
+ }
+
throw new Error("Unknown sheet source");
}