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

On 7/9/14, 5:26 PM, Matt Rakow wrote:
> 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.

There's an issue here: the painting of the canvas background depends on 
the sizing (and positioning within the viewport) of the root element's 
box.  That's not obvious with a solid color background, but becomes very 
clear with a background image.

So you need some sort of special casing no matter what.  I just tested 
what IE11 does here; compare 
<http://web.mit.edu/bzbarsky/www/testcases/css-backgrounds/root-background-image-display-block.html> 
and 
<http://web.mit.edu/bzbarsky/www/testcases/css-backgrounds/root-background-image-display-none.html>. 
  It looks like in the latter case IE11 uses the viewport instead of the 
(nonexistent) root element's box for the background positioning area. 
This is clearly special-casing the display:none case, no?

-Boris

Received on Thursday, 10 July 2014 02:20:15 UTC