зеркало из https://github.com/mozilla/pjs.git
Bug 409310 - Make SVG image viewing in page info more robust. r=mano,sr=bzbarsky,a1.9=mconnor
This commit is contained in:
Родитель
aa10073bdd
Коммит
e03b83e384
|
@ -611,8 +611,12 @@ function grabAll(elem)
|
||||||
(elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem, false);
|
(elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem, false);
|
||||||
#ifdef MOZ_SVG
|
#ifdef MOZ_SVG
|
||||||
else if (elem instanceof SVGImageElement) {
|
else if (elem instanceof SVGImageElement) {
|
||||||
var href = makeURLAbsolute(elem.baseURI, elem.href.baseVal);
|
try {
|
||||||
addImage(href, gStrings.mediaImg, "", elem, false);
|
// 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
|
#endif
|
||||||
else if (elem instanceof HTMLLinkElement) {
|
else if (elem instanceof HTMLLinkElement) {
|
||||||
|
|
|
@ -497,7 +497,8 @@ function isElementVisible(aElement)
|
||||||
|
|
||||||
function makeURLAbsolute(aBase, aUrl)
|
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)
|
function getBrowserFromContentWindow(aContentWindow)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче