Re: Printing and background colors/images

On 23 Feb 2011, at 13:05, Boris Zbarsky <bzbarsky@MIT.EDU> wrote:
> 
> Actually, browsers are more or less conforming to CSS 2.1 here as far as I can see.  They just have preferences that act like a user rule along the lines of
> 
> @media print {
>  * { background: none ! important; }
> }
> 
> and some variations for printing background colors but not background images, all of which is perfectly per the spec.
> 
> Now the thing is that these preferences don't _quite_ act like the above, in that they affect the used value but not the computed value of background.  But that could be fixed, if really desired.  It wouldn't change the user-observed or author-observed behavior as far as I can tell.
> 

See my first mail to this thread, where I suggested much the same thing as a way to model current browser behaviour, except I suggested making it a user agent stylesheet to allow authors to override it. And, as you said, it does not actually really represent what browsers are doing right now, just a potential way to normalise it.

>> So long as the proposal is to add the new property to 2.1, then it will.
>> I was concerned the idea was to have this property in some new CSS 3
>> spec, in which case 2.1 would still be wrong.
> 
> I would certainly assume that any additions here are NOT going into 2.1.
> 
>> A key principal of software engineering is that you should always try to
>> fix errors in the component or layer where they occur, rather than
>> trying to work around them at a higher level. I think the same principal
>> applies here: the problem is that the spec says backgrounds apply to
>> print media, and it should be resolved by reorganising the media types,
>> or by introducing some general method to make them more flexible, not by
>> adding an ad-hoc, media type specific property or behaviour.
> 
> Well...  Backgrounds _can_ apply to print media in browsers right now. The user just has to check the appropriate checkboxes.

Yes, and if they do, then they end up wasting a lot of ink, because most authors don't take print into account when setting backgrounds. So a mechanism is needed to allow authors who really do need to print to do so, which is what this thread is about. In my opinion, such a mechanism should not rely on new CSS properties that target a single media type and only exist to work around (some) browser's behaviour.

> -Boris

Received on Wednesday, 23 February 2011 20:14:42 UTC