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

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>

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.

Thanks,
-Matt

-----Original Message-----
From: Simon Sapin [mailto:simon.sapin@exyr.org] 
Sent: Wednesday, July 9, 2014 7:40 AM
To: www-style@w3.org
Subject: [css-backgrounds] Canvas background with display:none or visibility:hidden

§3.11. "Backgrounds of Special Elements" explains how the background of :root or <body> extends to cover the entire canvas, but does not specify what happens when the corresponding element has `visibility: hidden` or
`display: none`.

Firefox 30, Chromium 35, IE 11, and Opera 12 all agree to paint the background with `visibility: hidden`, but not with `display: none`. I suggest specifying both cases explicitly.

Test cases:

data:text/html,<style>html{background:green}</style>
data:text/html,<style>body{background:green}</style>

data:text/html,<style>html{background:green;visibility:hidden}</style>
data:text/html,<style>body{background:green;visibility:hidden}</style>

data:text/html,<style>html{background:red;display:none}</style>
data:text/html,<style>body{background:red;display:none}</style>

--
Simon Sapin

Received on Wednesday, 9 July 2014 21:27:25 UTC