Bug 409310 - Make SVG image viewing in page info more robust. r=mano,sr=bzbarsky,a1.9=mconnor
git-svn-id: svn://10.0.0.236/trunk@242216 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
24acb468e4
commit
73a306db0b
@ -611,8 +611,12 @@ function grabAll(elem)
|
||||
(elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem, false);
|
||||
#ifdef MOZ_SVG
|
||||
else if (elem instanceof SVGImageElement) {
|
||||
var href = makeURLAbsolute(elem.baseURI, elem.href.baseVal);
|
||||
addImage(href, gStrings.mediaImg, "", elem, false);
|
||||
try {
|
||||
// Note: makeURLAbsolute will throw if either the baseURI is not a valid URI
|
||||
// or the URI formed from the baseURI and the URL is not a valid URI
|
||||
var href = makeURLAbsolute(elem.baseURI, elem.href.baseVal);
|
||||
addImage(href, gStrings.mediaImg, "", elem, false);
|
||||
} catch (e) { }
|
||||
}
|
||||
#endif
|
||||
else if (elem instanceof HTMLLinkElement) {
|
||||
|
||||
@ -497,7 +497,8 @@ function isElementVisible(aElement)
|
||||
|
||||
function makeURLAbsolute(aBase, aUrl)
|
||||
{
|
||||
return IO.newURI(IO.newURI(aBase).resolve(aUrl)).spec;
|
||||
// Note: IO.newURI(aUri) will throw if aUri is not a valid URI
|
||||
return IO.newURI(aUrl, null, IO.newURI(aBase)).spec;
|
||||
}
|
||||
|
||||
function getBrowserFromContentWindow(aContentWindow)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user