W3C home > Mailing lists > Public > www-style@w3.org > February 2011

Re: Printing and background colors/images

From: Jon Rimmer <jon.rimmer@gmail.com>
Date: Wed, 23 Feb 2011 00:55:05 +0000
Message-ID: <AANLkTiku_18-qezyHxHA26jP=zCaBnU+TTqsY85UiHYT@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: ifette@google.com, Simon Fraser <smfr@me.com>, Brad Kemper <brad.kemper@gmail.com>, "www-style@w3.org" <www-style@w3.org>
On 22 February 2011 23:24, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> Right.
>
> I still kinda like the idea of doing this automagically by honoring
> backgrounds set in print stylesheets, but that's too magical from an
> implementation perspective.
>
> I think we should handle this through a property, like your option #3,
> which controls the behavior of background printing.  I'm not sure of a
> good name.
>

See this, particularly the table at the end:
http://www.w3.org/TR/CSS2/media.html

CSS 2.1 maps properties apply to media groups, not individual media
types. The properties page-break-* that people are citing as
media-specific belong to the media group paged, which is mapped to the
print, projection and embossed media types. The background properties
belong to media type visual, which is mapped to both print and screen
media types.

So, right now, browsers are not conforming to CSS 2.1 by ignoring
background properties when printing. Requiring backgrounds to be
duplicated in a print stylesheet, or adding a new property that
applies only to print media would essentially standardise this
non-conformity as part of CSS 3. This seems wrong.

My suggestion of a default user-agent print stylesheet that turns off
backgrounds would at least resolve this non-conformity. However, a
more 'proper' solution would seem to be reorganising the CSS 2.1 media
types to reflect the reality of browser behaviour. This could be done
by creating a new media group called, perhaps, 'visual-decorative',
into which the background properties would be moved. The 'screen'
media type would map to this group, but print would not. You could
then create an additional media type called 'print-rich', which
_would_ map to 'visual-decorative'.

Browser behaviour could then be to default to 'print' media type for
printing, unless a stylesheet has been linked that is mapped to the
'print-rich' media type like so:

<link rel="stylesheet" href="foo.css" media="screen, print-rich" />

This would also allow users to specify both print and print-rich
stylesheets, and also mean that browsers current ability to turn
on-and-off background printing would be relatable to CSS, as it could
represent the choice between defaulting to printing using the 'print'
media type vs the 'print-rich' type.

Obviously, it's not ideal to be making changes like this to CSS 2.1 at
this point, but if the alternative is that it will be perpetually
wrong, it seems preferable.

Jon

> ~TJ
>
>
Received on Wednesday, 23 February 2011 00:55:37 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:37 GMT