Bug 494808 - Page Info > Media doesn't list background images anymore. r=mano

This commit is contained in:
Dão Gottwald 2009-07-24 17:10:02 +02:00
parent e1d2f48c79
commit 82b4513da7

View File

@ -596,11 +596,14 @@ function addImage(url, type, alt, elem, isBg)
function grabAll(elem)
{
// check for background images, any node may have one
var ComputedStyle = elem.ownerDocument.defaultView.getComputedStyle(elem, "");
var url = ComputedStyle && ComputedStyle.getPropertyCSSValue("background-image");
if (url && url.primitiveType == CSSPrimitiveValue.CSS_URI)
addImage(url.getStringValue(), gStrings.mediaBGImg, gStrings.notSet, elem, true);
// check for background images, any node may have multiple
var computedStyle = elem.ownerDocument.defaultView.getComputedStyle(elem, "");
if (computedStyle) {
Array.forEach(computedStyle.getPropertyCSSValue("background-image"), function (url) {
if (url.primitiveType == CSSPrimitiveValue.CSS_URI)
addImage(url.getStringValue(), gStrings.mediaBGImg, gStrings.notSet, elem, true);
});
}
// one swi^H^H^Hif-else to rule them all
if (elem instanceof HTMLImageElement)