Re: background-print

On Fri, Aug 12, 2011 at 6:35 AM, Håkon Wium Lie <howcome@opera.com> wrote:
> Also sprach Tab Atkins Jr.:
>
>  > > > http://lists.w3.org/Archives/Public/www-style/2011Jul/0341.html
>
>  > > What's wrong with this?:
>  > >
>  > > @media print {
>  > >  * { background: none }
>  > > }
>  >
>  > I'm not sure I understand.  Are you suggesting that the UA put that in
>  > its UA stylesheet, such that it can be overridden by the author as
>  > desired?
>
> The start of the thread, in the above URL reads:
>
>  Want authors to be able to specify whether backgrounds should be printed
>
> And this code turns off printing of backgrounds:
>
>   @media print {
>     * { background: none }
>   }
>
> So it seems like a simple solution to the problem statement.
> It can be used in user/browser/author style sheets.

As noted, this is the opposite of what we're trying to allow.
Backgrounds are currently suppressed when printing, and we'd like the
author to be able to hint that they actually do mean for backgrounds
to print.  (I recognize that you're now aware of this, but still
wanted to respond to it in-context.)


>  > If so, then the suggestion has several problems, unfortunately.  For
>  > one, UAs do more than suppress backgrounds; they also adjust text
>  > colors to ensure that there is still adequate contrast.
>
> Now you're extenting the scope of the problem. But this can also be expressed:
>
>   @media print {
>     * { color: black; background: white }
>   }
>
> Opera provides high-contrast style sheets like these in View->Style->

I'm not extending the problem at all.  I'm expressing what the
browsers currently do, and what we'd like to turn off.  The fact that
browsers adjust both backgrounds and colors means that we can't solve
this by doing something with only backgrounds.


>  > For two, that
>  > rule would get overridden by a background set in media=all, which is
>  > the default for stylesheets that don't specify a @media.
>
> No, it's the weight, specificity and order of appearance that
> determine winning declarations -- media type does not matter.

You misunderstand my point, but I think this is just because of the
above misunderstanding.


>  > It's the color-adjustment that really clinches the fact that we can't
>  > solve this solely by fiddling with 'background'.  This really is a
>  > separate control with unique behavior, and has to be addressed with
>  > its own property (or some other entity, like an @-rule).  I still
>  > suggest:
>  >
>  > printer-safe-colors: _prefer_ | avoid;
>
> If we just need a document-wide switch to turn on magic, the @page
> context seems to be the right place:
>
>  @page {
>    size: a4;
>    print: magic; /* or something */
>
>  }

I had previously suggested an @page switch, but that didn't seem
popular for whatever reason.  That would be fine with me as well.

However, Peter believes that this property can apply more widely than
just print, and thus it may not be appropriate to specify just within
a printing context.  It was brought up by Mikko that one could use
this to let the UA adjust colors on an AMOLED screen, for example, to
reduce battery consumption.

~TJ

Received on Friday, 12 August 2011 17:36:55 UTC