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: Thu, 17 Jul 2014 15:59:36 +0200
To: www-style@w3.org
Message-Id: <201407171559.36978.bert@w3.org>
On Wednesday 16 July 2014 17:51:33 Bert Bos wrote:

> 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: none'.
> 
> 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 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.

After discussion, the WG decided[3] to modify the above (1) to say that the 
canvas background is transparent rather than undefined, and (2) to phrase 
the condition indirectly, in terms of the existence or not of a box for the 
element, rather than a specific value of the 'display' property. The 
indirection may avoid another erratum in the future if we ever add other 
properties that suppress box generation. (The proposed 'display-box' 
property, if accepted, would be one such property.)

With that in mind, here is an updated proposal for the errata. 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 no boxes are generated for the element whose background
#   would be used for the background of the canvas, then the canvas
#   background is transparent. (in CSS 2.1, that is the case when the
#   element or an ancestor has 'display: none'.)
#
#   Note that, if the element has 'visibility: hidden' but not 'display:
#   none', boxes _are_ generated for it and its background _is_ used for
#   the canvas.

> [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

[3] http://lists.w3.org/Archives/Public/www-style/2014Jul/0299.html



Bert
-- 
  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 Thursday, 17 July 2014 14:00:10 UTC

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