зеркало из https://github.com/mozilla/gecko-dev.git
bug 229441: Background images are not shown in Media tab (Page Info)
patch by Florian QUEZE <f.qu@laposte.net>, r=db48x, sr=jag
This commit is contained in:
Родитель
beb03a1515
Коммит
629e0a078f
|
@ -23,6 +23,7 @@
|
|||
* smorrison@gte.com
|
||||
* Terry Hayes <thayes@netscape.com>
|
||||
* Daniel Brooks <db48x@yahoo.com>
|
||||
* Florian QUEZE <f.qu@laposte.net>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
|
@ -886,10 +887,21 @@ function makePreview(row)
|
|||
physWidth = newImage.width;
|
||||
physHeight = newImage.height;
|
||||
|
||||
if ("width" in item && item.width)
|
||||
newImage.width = item.width;
|
||||
if ("height" in item && item.height)
|
||||
newImage.height = item.height;
|
||||
// "width" and "height" attributes must be set to newImage,
|
||||
// even if there is no "width" or "height attribute in item;
|
||||
// otherwise, the preview image cannot be displayed correctly.
|
||||
if (!isBG)
|
||||
{
|
||||
newImage.width = ("width" in item && item.width) || newImage.naturalWidth;
|
||||
newImage.height = ("height" in item && item.height) || newImage.naturalHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
// the Width and Height of an HTML tag should not be use for its background image
|
||||
// (for example, "table" can have "width" or "height" attributes)
|
||||
newImage.width = newImage.naturalWidth;
|
||||
newImage.height = newImage.naturalHeight;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче