Fix XLink handling in page info. Bug 286949, patch by Christian Schmidt

<bugzilla.mozilla.org@chsc.dk>, r=db48x, sr=neil
This commit is contained in:
bzbarsky%mit.edu 2006-06-24 02:20:13 +00:00
Родитель cb31692afe
Коммит fdb5ed5105
1 изменённых файлов: 10 добавлений и 7 удалений

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

@ -584,13 +584,16 @@ function grabAll(elem)
addImage(elem.data, gStrings.mediaObject, getValueText(elem), elem, false);
else if (elem instanceof nsIEmbedElement)
addImage(elem.src, gStrings.mediaEmbed, "", elem, false);
else
if (elem.hasAttributeNS(XLinkNS, "href"))
linkView.addRow([getValueText(elem),
ioService.newURI(elem.getAttributeNS(XLinkNS, "href"), null, elem.baseURI).spec,
gStrings.linkX,
""]);
else if (elem.hasAttributeNS(XLinkNS, "href")) {
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
url = elem.getAttributeNS(XLinkNS, "href");
try {
var baseURI = ioService.newURI(elem.baseURI, elem.ownerDocument.characterSet, null);
url = ioService.newURI(href, elem.ownerDocument.characterSet, baseURI).spec;
} catch (e) {}
linkView.addRow([getValueText(elem), url, gStrings.linkX, ""]);
}
return NodeFilter.FILTER_ACCEPT;
}