Re: background-print

On Mon, Aug 15, 2011 at 4:30 PM, Håkon Wium Lie <howcome@opera.com> wrote:
> Also sprach Tab Atkins Jr.:
>
>  > >  > Authors don't want to turn off printing of backgrounds, they want to turn
>  > >  > it on, as various browsers automatically turn them off by default to save
>  > >  > ink or improve readability. A way to override that is what we are looking
>  > >  > for.
>  > >
>  > > We could do this by defining where in the cascade the user setting is
>  > > defined.
>  > >
>  > > For example, this could could be overridden by the user setting:
>  > >
>  > >  html { background: red }
>  > >
>  > > while this would be printed:
>  > >
>  > >  html { background: red !important }
>  >
>  > This doesn't work at all with the existing specificity rules, and it's
>  > a bad idea anyway.
>  >
>  > It doesn't work with existing specificity because normal user rules
>  > are below author rules, while !important user rules are *above*
>  > !important author rules.  You're looking for a specificity level
>  > *between* normal author and !important author rules, and that doesn't
>  > exist.
>
> We don't need any such level -- we will simply use the !important as a
> flag to signal that, um, something is important. Seems spot on.
>
> We basically did the same to handle non-CSS presentational hints:
>
>  http://www.w3.org/TR/CSS21/cascade.html#preshint

Do you mean that the user setting they choose from the print dialog
would have that special specificity level?  That makes sense - we're
allowed to put things wherever we want, specificity-wise, if they're
not expressed in real CSS.

It still has the problem that we do *not* actually want the authors to
have ultimate control.  Thus, the user setting still needs to be more
powerful than what the author says.

>  > It's a bad idea anyway because we don't actually want the author to
>  > have control over this.  We want them to be able to *hint* that
>  > they've thought of printing and thus it's probably okay to let them
>  > print what they want.
>
> And I'm suggesting that authors could use !important to express that hint.
>
> It's an option that doesn't require any new CSS properties or syntax,
> and, as such, is lightweight and elegant.
>
> However, I'm not convinced users will welcome the a new third level of
> user preference. And it's hard to label it. On/off/auto works in CSS
> values, but I'm not sure it can be used with the current "print
> background images" which tend to be binary choices.

It does still need something special, because we don't want the author
to have an ultimate control, just the ability to hint what the default
behavior should be.

~TJ

Received on Monday, 15 August 2011 23:57:10 UTC