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

Re: Printing and background colors/images

From: Simon Fraser <smfr@me.com>
Date: Tue, 22 Feb 2011 09:52:36 -0800
Cc: www-style@w3.org
Message-id: <ED8596AD-E773-4950-B22C-1FC1AA2DEC64@me.com>
To: ifette@google.com
On Feb 22, 2011, at 9:17 AM, Ian Fette (イアンフェッティ) wrote:

> 
> 2. Print backgrounds only if explicitly specified inside of a @media print{} block. Pros: Relatively explicit in terms of author intent, wouldn't require any major spec changes. Cons: Leads to some strange cases, e.g. if I specify ".highlight {background-color: yellow}" for highlighted text, I also have to explicitly specify "@media print { .highlight { background-color: yellow} }" ? Also, in WebKit, and presumably other browsers, this may lead to implementation difficulty as currently, all the styles are processed and then applied, and no state is kept as to where the style came from. When it's time to paint, the style is overridden if the option to print background colors is in its default state (false), and so this would require carrying around extra state for each resultant style to track if it came from a @media print{} block, which is both a bit heavy, and hacky. It could work though.

The problem with this method is that you're changing the way that the cascade works, for some subset of properties. I think that's a bad idea, and, as you note, it has implementation complexity.

Simon
Received on Tuesday, 22 February 2011 17:53:11 GMT

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