зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 398c202ed56e (bug 1647200) for bc failures on browser_copying.js. CLOSED TREE
This commit is contained in:
Родитель
16c941758d
Коммит
9ac909be70
|
@ -1551,7 +1551,6 @@ class UrlbarInput {
|
|||
}
|
||||
}
|
||||
uri = this.makeURIReadable(uri);
|
||||
let displaySpec = uri.displaySpec;
|
||||
|
||||
// If the entire URL is selected, just use the actual loaded URI,
|
||||
// unless we want a decoded URI, or it's a data: or javascript: URI,
|
||||
|
@ -1562,17 +1561,19 @@ class UrlbarInput {
|
|||
!uri.schemeIs("data") &&
|
||||
!UrlbarPrefs.get("decodeURLsOnCopy")
|
||||
) {
|
||||
return displaySpec;
|
||||
return uri.displaySpec;
|
||||
}
|
||||
|
||||
// Just the beginning of the URL is selected, or we want a decoded
|
||||
// url. First check for a trimmed value.
|
||||
|
||||
if (
|
||||
!selectedVal.startsWith(BrowserUtils.trimURLProtocol) &&
|
||||
displaySpec != this._trimValue(displaySpec)
|
||||
) {
|
||||
selectedVal = BrowserUtils.trimURLProtocol + selectedVal;
|
||||
let spec = uri.displaySpec;
|
||||
let trimmedSpec = this._trimValue(spec);
|
||||
if (spec != trimmedSpec) {
|
||||
// Prepend the portion that _trimValue removed from the beginning.
|
||||
// This assumes _trimValue will only truncate the URL at
|
||||
// the beginning or end (or both).
|
||||
let trimmedSegments = spec.split(trimmedSpec);
|
||||
selectedVal = trimmedSegments[0] + selectedVal;
|
||||
}
|
||||
|
||||
return selectedVal;
|
||||
|
|
|
@ -237,38 +237,6 @@ var tests = [
|
|||
copyVal: "<example.com/би>ография",
|
||||
copyExpected: "http://example.com/би",
|
||||
},
|
||||
{
|
||||
setup() {
|
||||
// Setup a valid intranet url that resolves but is not yet known.
|
||||
const proxyService = Cc[
|
||||
"@mozilla.org/network/protocol-proxy-service;1"
|
||||
].getService(Ci.nsIProtocolProxyService);
|
||||
let proxyInfo = proxyService.newProxyInfo(
|
||||
"http",
|
||||
"localhost",
|
||||
8888,
|
||||
"",
|
||||
"",
|
||||
0,
|
||||
4096,
|
||||
null
|
||||
);
|
||||
const proxyFilter = {
|
||||
applyFilter(channel, defaultProxyInfo, callback) {
|
||||
callback.onProxyFilterResult(
|
||||
channel.URI.host === "mytest" ? proxyInfo : defaultProxyInfo
|
||||
);
|
||||
},
|
||||
};
|
||||
proxyService.registerChannelFilter(proxyFilter, 0);
|
||||
registerCleanupFunction(() => {
|
||||
proxyService.unregisterChannelFilter(proxyFilter);
|
||||
});
|
||||
},
|
||||
loadURL: "http://mytest/",
|
||||
expectedURL: "mytest",
|
||||
copyExpected: "http://mytest",
|
||||
},
|
||||
];
|
||||
|
||||
function nextTest() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче