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

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

From: Matt Rakow <marakow@microsoft.com>
Date: Wed, 9 Jul 2014 21:26:55 +0000
To: Simon Sapin <simon.sapin@exyr.org>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <e46927b89aac405db0dfb852b032d086@BL2PR03MB260.namprd03.prod.outlook.com>
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

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