mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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:
parent
c5250fd127
commit
b5b4861210
@ -435,7 +435,28 @@ StyleEditorUI.prototype = {
|
||||
editor.getSourceEditor().then(() => {
|
||||
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
|
||||
// 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 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;
|
||||
}
|
||||
|
||||
|
@ -769,7 +769,12 @@ var StyleRuleFront = protocol.FrontClass(StyleRuleActor, {
|
||||
return this._form.href;
|
||||
}
|
||||
let sheet = this.parentStyleSheet;
|
||||
return sheet.href || sheet.nodeHref;
|
||||
return sheet.href;
|
||||
},
|
||||
|
||||
get nodeHref() {
|
||||
let sheet = this.parentStyleSheet;
|
||||
return sheet ? sheet.nodeHref : "";
|
||||
},
|
||||
|
||||
get location()
|
||||
|
Loading…
Reference in New Issue
Block a user