[whatwg] Transparent Content

On Mon, 12 Oct 2009, Yuvalik Webdesign wrote:
>
> I have an argument with a colleague of mine regarding Transparent 
> elements. He filed a bug regarding this in bugzilla and I wrote to the 
> html5doctor about it with a question, but neither action has answered 
> our question.
> 
> The way I understand it, a Transparent Element can contain the same 
> elements its direct parent can. The way my colleague understands it, is 
> that a transparent element can be wrapped around any other element.
>
> The section about Transparent Content (3.2.5.2) Is not very easy to 
> understand, any chance it could be re-phrased? Specifically this 
> sentence:
> 
> ?When a content model includes a part that is "transparent", those 
> parts must not contain content that would not be conformant if all 
> transparent elements in the tree were replaced, in their parent element, 
> by the children in the "transparent" part of their content model, 
> retaining order.?
> 
> If I knew what it meant I would offer a suggestion, but I am at a loss 
> as to understand this.

On Mon, 12 Oct 2009, Tab Atkins Jr. wrote:
> 
> Neither of you are *quite* right, but you are much closer to correct 
> than your colleague.  A transparent element *must* contain the same 
> kinds of elements that its direct parent can.  The meaning of 
> transparent is simply that, if you removed the element but left its 
> children, the document would still be conforming.
> 
> It does *not* mean that you can wrap a transparent element around 
> anything, as some elements have very specific rules about what children 
> they may have.  Frex, you can't wrap an arbitrary transparent element 
> around a <td>.

On Mon, 12 Oct 2009, Yuvalik Webdesign wrote:
> 
> So, if I understand correctly I should read:
> 
> When a content model includes a part that is "transparent", that part 
> must not contain content that would not be conformant if the transparent 
> element in the tree would be removed, while retaining the order of the 
> tree."

On Mon, 12 Oct 2009, Tab Atkins Jr. wrote:
> 
> Yes, that's correct.  It's essentially a rewording of what's in the spec 
> (just more focused on the element rather than the parent/children, as 
> the current spec text is).

It doesn't say that because if you remove the element, you implicitly also 
remove all its children (the children are part of the element in the DOM).

Other than that, the conclusions above are correct. If there's another way 
of saying what the spec says that is technically precise but more 
understandable, I'd be happy to use it. In the meantime, I've added an 
example to explain it better.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 13 October 2009 02:24:21 UTC