W3C home > Mailing lists > Public > www-style@w3.org > January 2011

Re: Expected behavior of background-clip property on the html element?

From: Alan Gresley <alan@css-class.com>
Date: Wed, 12 Jan 2011 19:01:03 +1100
Message-ID: <4D2D5FBF.3020904@css-class.com>
To: fantasai <fantasai.lists@inkedblade.net>
CC: Cathy.Chan@nokia.com, www-style@w3.org
On 12/01/2011 6:20 PM, fantasai wrote:
> On 01/11/2011 11:03 PM, Alan Gresley wrote:
>> On 12/01/2011 5:13 PM, fantasai wrote:
>>> The spec says:
>>> http://www.w3.org/TR/css3-background/#background-clip
>>> # background-clip ... determines the <dfn>background painting
>>> area</dfn>. # ... # Note that the root element has a different
>>> background painting area. # See “The backgrounds of special
>>> elements.”
>>> http://www.w3.org/TR/css3-background/#special-backgrounds
>>> # The background of the root element becomes the background of
>>> the canvas # and its <em>background painting area</em> extends to
>>> cover the entire # canvas
>>> Exactly what is not clear?
>> Interesting how this is implemented. I ask you what browser handles
>>  this correct?
> Given the above-quoted spec text, the entire canvas, aside from the
> blue dots of the html border and the white background of the body box
> which is just high enough to contain the word "test", should be
> gray.

Have another look.


This time I have changed the <body> background-color to lime. I have not 
declared background-color white anywhere (this background-color is the 
default background setting of the UA) but this is seen in Opera 11 and 
Safari 5. Opera 11 clips the background to the <html> content-box. IE9 I 
believe does it correctly, please see screenshot[1]. I would be 
interested in know Gecko handles this test.

> I fail to understand why this is not clear from the spec. Perhaps you
> can walk me through an interpretation of the spec that gets you a
> different answer?
> ~fantasai

There may be a spec but we are dealing with rendering engines that 
create a tree which stems from some root.

   | If the root's ‘background-color’ value is ‘transparent’, the canvas's
   | background color is UA dependent. The root element does not paint this
   | background again, i.e., the used value of its background is 

The UA dependent background-color is the white (this background-color is 
the default background setting of the UA) that the test show. I can only 
assume that in Opera 11 and Safari 5 that the root element is not 
<html>. This beckons the questions like, is there an initial block 
formatting context.

1. <http://css-class.com/test/temp/ie9-bg-clip-html.png>

Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
Received on Wednesday, 12 January 2011 08:02:39 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:42 UTC