W3C home > Mailing lists > Public > www-style@w3.org > July 2014

Re: [css-backgrounds] Canvas background with display:none or visibility:hidden

From: Bert Bos <bert@w3.org>
Date: Wed, 16 Jul 2014 17:51:33 +0200
To: www-style@w3.org
Message-Id: <201407161751.33895.bert@w3.org>
On Wednesday 09 July 2014 23:26:55 Matt Rakow wrote:
> Went and tried this out after the conf. call today.  Actually IE11 does
> paint the background in this case:
> data:text/html,<style>html{background:red;display:none}</style>

So does Opera 12, and Konqueror 4, too. But they don't paint the background 
in the version with <body>:


> Reading the spec as currently written, it seems clear to me that the
> background actually _should_ be painted for all 6 of the test cases
> below, since the computed style of the background color for the <html>
> or <body> is non-transparent in every case.
> I'm not necessarily opposed to a change here, but I don't really think
> the spec seems ambiguous at present.  I also think that special-casing
> display:none adds complexity that isn't really necessary.

The WG decided[1] nevertheless to add that special case, also because it is 
unclear how to interpret 'background-position' for an element with 'display: 

Simon Sapin was going to propose concrete text, but as I was adding an entry 
to the list of errata, I though I could try to write it myself as well. 
Thus, I propose to add, right after the paragraph in 14.2[2] that ends

    [...] Such backgrounds must also be anchored at the same point as they
    would be if they were painted only for the root element.

the following two new paragraphs:

#   However, if the element whose background would be used for the
#   background of the canvas has 'display: none', or is a descendant of an
#   element with 'display: none', then the canvas background is undefined.
#   Note that, if the element has 'visibility: hidden' but not 'display:
#   none', its background _is_ used for the canvas.

Simon and others, can you check that this captures our resolution?

[1] http://lists.w3.org/Archives/Public/www-style/2014Jul/0162.html
[2] http://www.w3.org/TR/2011/REC-CSS2-20110607/colors.html#background

  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos                               W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Wednesday, 16 July 2014 15:52:03 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:23 UTC