Re: [CSS Backgrounds] root element

Brad Kemper wrote:
> 
>> You're missing the first sentence of that section. See also CSS2.1:14.2.
> 
> Oh, I did read all that in both places. It just didn't clarify to me 
> what was going on. I'm probably suffering from some sort of mental 
> deficiency. 

Nah, you're probably just not being pedantic enough. :)

>> http://www.w3.org/TR/css3-background/#special-backgrounds
>>
>>  # The background of the root element becomes the background of the
>>  # canvas and its background painting area  extends to cover the
>>  # entire canvas, 
> 
> OK, so the background of the root (HTML element) is the background of 
> the canvas, and the canvas presumably fills the viewport. So, 
> background-color also fills the viewport.
> 
>> although any images are sized and positioned
>>  # relative to the root element as if they were painted for that
>>  # element alone.
> 
> So, "any images" includes background images, and "that element" is the 
> root element, and the root element is not necessarily as big as its 
> background (which is canvas-sized)? When I read that, I assumed that "as 
> if they were painted for that element alone" meant that they were 
> painted for "that element" that now had a canvas-height background 
> painting area, and would thus fill that area with the image. Since you 
> are saying that that this first sentence holds my answer, I now 
> understand you to be saying that :

The sentence doesn't say anything about changing the size of the root
element. It only says that the background becomes the background of
the canvas (which is infinite, btw). The size of the root element
remains unchanged. (You can see that by putting borders on it.)

Also the sentence says "sized and positioned as if painted for that
element alone",  not "painted as if painted for that element alone".
So we size and position the  image as if we were only painting for
the root element, but then when we actually paint the background,
instead of painting it on the root element only and clipping at its
boundaries, we paint the entire canvas.

~fantasai

Received on Thursday, 12 November 2009 22:07:06 UTC