Re: handling fallback content for still images

2007/7/7, scott lewis:
> On 6 Jul 2007, at 1644, Robert Burns wrote:
> >
> > I'm not sure if Thomas is confused.

I wasn't.

> > There is certainly an issue that our recommendations should deal with.
> > In other words when serializing as XML, should a translating UA include
> > explicit <tbody> elements when serializing to XMl? There may problems
> > with doing so, but there will also be problems with not doing so. For
> > example, a user may wonder why the CSS stopped working simply from
> > saving to a different serialization.
> How would the CSS break? CSS rules are applied against the DOM and
> the <tbody> will always be represented in the DOM. (If the element is
> not present in a serialized document it is inserted into the DOM by
> the UA.)

No it won't, in the case of application/xhtml+xml.

The relationship between XML and the XML Infoset is clearly defined;
as is the relationship between the XML Infoset and the DOM.
There's no reason an XML parser would insert an element in a document
if it's not present in its XML serialization.

If you have <table><tr><td>cell</td></tr></table> in an XHTML document
(XHTML 1.0 or 1.1, or the XML serialization of HTML 5), the DOM won't
contain a <tbody> but <tr> will actually be a direct-child element of
<table>, so any CSS selector using tbody won't match.
If you insert the same snippet in an HTML document, a <tbody> will be
inserted, because that's how the relationship between the
serialization and the infoset/DOM is defined (there's always a <tbody>
and in some cases its start and end tags can be omitted, so it doesn't
appear at all in the serialization); so the CSS selector "table > tr"
won't ever match any <tr> element.

Thomas Broyer

Received on Sunday, 8 July 2007 21:23:20 UTC