From 5dbedbdb8f104f071b5a9f9c719b589f48e16ab3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Fri, 24 Jul 2009 17:10:02 +0200 Subject: [PATCH] Bug 494808 - Page Info > Media doesn't list background images anymore. r=mano --- browser/base/content/pageinfo/pageInfo.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/browser/base/content/pageinfo/pageInfo.js b/browser/base/content/pageinfo/pageInfo.js index 84d627c753b9..adedce7601a6 100644 --- a/browser/base/content/pageinfo/pageInfo.js +++ b/browser/base/content/pageinfo/pageInfo.js @@ -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)