Bug 949678 - Rule view should show inline sheet links as 'inline:<lineno>' instead of '/:<lineno>' when source maps are enabled; r=pbrosset

This commit is contained in:
Heather Arthur 2013-12-16 11:49:17 -08:00
Родитель fa291d77b5
Коммит 5d4ec3539c
3 изменённых файлов: 31 добавлений и 4 удалений

Просмотреть файл

@ -435,7 +435,28 @@ StyleEditorUI.prototype = {
editor.getSourceEditor().then(() => { editor.getSourceEditor().then(() => {
editor.sourceEditor.setCursor({line: line, ch: col}); editor.sourceEditor.setCursor({line: line, ch: col});
}); });
this._view.activeSummary = editor.summary;
this.getEditorSummary(editor).then((summary) => {
this._view.activeSummary = summary;
})
},
getEditorSummary: function(editor) {
if (editor.summary) {
return promise.resolve(editor.summary);
}
let deferred = promise.defer();
let self = this;
this.on("editor-added", function onAdd(e, selected) {
if (selected == editor) {
self.off("editor-added", onAdd);
deferred.resolve(editor.summary);
}
});
return deferred.promise;
}, },
/** /**

Просмотреть файл

@ -49,10 +49,11 @@ function RuleViewTool(aInspector, aWindow, aIFrame)
// Chrome stylesheets are not listed in the style editor, so show // Chrome stylesheets are not listed in the style editor, so show
// these sheets in the view source window instead. // these sheets in the view source window instead.
if (!sheet || !rule.href || sheet.isSystem) { if (!sheet || sheet.isSystem) {
let contentDoc = this.inspector.selection.document; let contentDoc = this.inspector.selection.document;
let viewSourceUtils = this.inspector.viewSourceUtils; let viewSourceUtils = this.inspector.viewSourceUtils;
viewSourceUtils.viewSource(rule.href, null, contentDoc, rule.line || 0); let href = rule.nodeHref || rule.href;
viewSourceUtils.viewSource(href, null, contentDoc, rule.line || 0);
return; return;
} }

Просмотреть файл

@ -769,7 +769,12 @@ var StyleRuleFront = protocol.FrontClass(StyleRuleActor, {
return this._form.href; return this._form.href;
} }
let sheet = this.parentStyleSheet; let sheet = this.parentStyleSheet;
return sheet.href || sheet.nodeHref; return sheet.href;
},
get nodeHref() {
let sheet = this.parentStyleSheet;
return sheet ? sheet.nodeHref : "";
}, },
get location() get location()