mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 990672 - Remove query string from linked CSS file path in style editor; r=pbrosset
This commit is contained in:
parent
1ed8b5fa5c
commit
2531375fbc
@ -172,14 +172,16 @@ StyleSheetEditor.prototype = {
|
||||
let relatedSheet = this.styleSheet.relatedStyleSheet;
|
||||
|
||||
let path;
|
||||
var uri = NetUtil.newURI(relatedSheet.href);
|
||||
let href = removeQuery(relatedSheet.href);
|
||||
let uri = NetUtil.newURI(href);
|
||||
|
||||
if (uri.scheme == "file") {
|
||||
var file = uri.QueryInterface(Ci.nsIFileURL).file;
|
||||
let file = uri.QueryInterface(Ci.nsIFileURL).file;
|
||||
path = file.path;
|
||||
}
|
||||
else if (this.savedFile) {
|
||||
let origUri = NetUtil.newURI(this.styleSheet.href);
|
||||
let origHref = removeQuery(this.styleSheet.href);
|
||||
let origUri = NetUtil.newURI(origHref);
|
||||
path = findLinkedFilePath(uri, origUri, this.savedFile);
|
||||
}
|
||||
else {
|
||||
@ -700,3 +702,15 @@ function findUnsharedBranches(origUri, uri) {
|
||||
origBranch: origUri
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the query string from a url.
|
||||
*
|
||||
* @param {string} href
|
||||
* Url to remove query string from
|
||||
* @return {string}
|
||||
* Url without query string
|
||||
*/
|
||||
function removeQuery(href) {
|
||||
return href.replace(/\?.*/, "");
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<title>testcase for testing CSS source maps</title>
|
||||
<link rel="stylesheet" type="text/css" href="simple.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="sourcemap-css/sourcemaps.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="sourcemap-css/sourcemaps.css?test=1"/>
|
||||
</head>
|
||||
<body>
|
||||
<div>source maps <span>testcase</span></div>
|
||||
|
Loading…
Reference in New Issue
Block a user