Re: XHTML as XML

Ryan Cannon wrote:
> Anne van Kesteren wrote:
> 
>> The BODY is just another element. It is not special or anything. 
>> Mozilla's UA style sheet is the same for HTML and XHTML.
> 
> Not precisely. When the document is served as text/html and there is
> no styling for the html element, the body element magically controls
> the viewport background.

No. The 'background' property, when applied to the BODY element (only
when there is no 'background' property applied to the HTML element or it
is, but with a value of 'transparant') is propagated to the *canvas* in
HTML documents.

This is a special behavior for the 'background' property, not for the
BODY element.


> This behavior changes when styling (at least background-color) is
> added to the html element.

Only when that value if not 'transparant' as pointed out above and by
the CSS 2.1 CR specification.


> The behavior is similar in Opera and IE5/Mac (although it cannot
> handle application/xhtml+xml), although Opera does not add the margin
> to the body element.

It adds 'padding'. But that is not a very big deal or so.


> Interestingly, Safari does not treat BODY as just another element
> even when served as application/xhtml+xml. I am not sure how this
> does or does not relate to specifications.

I can not test with Safari at the moment, but if it does not treat the
BODY element like that, please file a bug. Also file a bug if it does
treat the BODY element like that but propagates the 'background'
property to the canvas in XML context.


-- 
  Anne van Kesteren
  <http://annevankesteren.nl/>

Received on Friday, 11 February 2005 15:36:43 UTC