Bug 1391421 - Part 6 - Switch context menus to Unicode domains. r?jwu
MozReview-Commit-ID: 6yjtRGI6Aui
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -2824,17 +2824,17 @@ var NativeWindow = {
(node instanceof Ci.nsIDOMHTMLAreaElement && node.href)) {
return this._getLinkURL(node);
} else if (node instanceof Ci.nsIImageLoadingContent && node.currentURI) {
// The image is blocked by Tap-to-load Images
let originalURL = node.getAttribute("data-ctv-src");
if (originalURL) {
return originalURL;
}
- return node.currentURI.spec;
+ return node.currentURI.displaySpec;
} else if (node instanceof Ci.nsIDOMHTMLMediaElement) {
let srcUrl = node.currentSrc || node.src;
// If URL prepended with blob or mediasource, we'll remove it.
return srcUrl.replace(/^(?:blob|mediasource):/, '');
}
return "";
},
@@ -3037,17 +3037,17 @@ var NativeWindow = {
}
target = target.parentNode;
}
},
// XXX - These are stolen from Util.js, we should remove them if we bring it back
makeURLAbsolute: function makeURLAbsolute(base, url) {
// Note: makeURI() will throw if url is not a valid URI
- return this.makeURI(url, null, this.makeURI(base)).spec;
+ return this.makeURI(url, null, this.makeURI(base)).displaySpec;
},
makeURI: function makeURI(aURL, aOriginCharset, aBaseURI) {
return Services.io.newURI(aURL, aOriginCharset, aBaseURI);
},
_getLink: function(aElement) {
if (aElement.nodeType == Ci.nsIDOMNode.ELEMENT_NODE &&
@@ -3072,18 +3072,19 @@ var NativeWindow = {
return selector.matches(aElement, aX, aY);
}
};
},
_getLinkURL: function ch_getLinkURL(aLink) {
let href = aLink.href;
- if (href)
- return href;
+ if (href) {
+ return this.makeURI(href).displaySpec;
+ }
href = aLink.getAttribute("href") ||
aLink.getAttributeNS(kXLinkNamespace, "href");
if (!href || !href.match(/\S/)) {
// Without this we try to save as the current doc,
// for example, HTML case also throws if empty
throw "Empty href";
}