From dfab09deff42f98847323f0be256aeee9ae13f33 Mon Sep 17 00:00:00 2001 From: Diogo Golovanevsky Monteiro Date: Tue, 31 Jan 2012 17:58:19 +0100 Subject: [PATCH] Bug 713383 - Directly viewed images should be printed with a transparent background on the body. r=dao --- layout/style/TopLevelImageDocument.css | 42 ++++++++++++++------------ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/layout/style/TopLevelImageDocument.css b/layout/style/TopLevelImageDocument.css index 9bb5cfa100b3..4f6aaffdfd03 100644 --- a/layout/style/TopLevelImageDocument.css +++ b/layout/style/TopLevelImageDocument.css @@ -37,25 +37,27 @@ are top level (e.g. not iframes). */ -body { - background-color: #222; - margin: 0; -} +@media not print { + body { + background-color: #222; + margin: 0; + } -/* We must declare the image as a block element. If we stay as -an inline element, our parent LineBox will be inline too and -ignore the available height during reflow. -This is bad during printing, it means tall image frames won't know -the size of the paper and cannot break into continuations along -multiple pages. */ -img { - color: #eee; - text-align: center; - display: block; - position: absolute; - margin: auto; - top: 0; - right: 0; - bottom: 0; - left: 0; + /* We must declare the image as a block element. If we stay as + an inline element, our parent LineBox will be inline too and + ignore the available height during reflow. + This is bad during printing, it means tall image frames won't know + the size of the paper and cannot break into continuations along + multiple pages. */ + img { + color: #eee; + text-align: center; + display: block; + position: absolute; + margin: auto; + top: 0; + right: 0; + bottom: 0; + left: 0; + } }