Re: [XBL] content element and locked

On Wed, 6 Dec 2006, Cyril Concolato wrote:
>
> "Each node that is to be distributed (each explicit child node) must be
> assigned to a content element as follows:
> 
>   1. If the node is already assigned to a content element, and the content
> element is locked, then that is the content element to which the node must be
> assigned, stop here."
>   The formulation is difficult to understand: why would I try to assign a node
> to content element if it is already assigned?

The nodes are redistributed for all kinds of reasons, as described in the 
very next section.


> Please give an example in the specification.

Done.


> Then, if it is not locked, should I remove the previous assignment ?

The algorithm reassigns all the children ("Each node that is to be 
distributed (each explicit child node) must be assigned to a content 
element as follows").


> Could you please clarify the following points in the spec:
> - is there a one-to-one mapping between a child of the bound element and a
> content element ?

No, there's a many-to-many mapping. Each explicit child can be assigned to 
multiple <content> elements (one per shadow scope), and each <content> 
element can be assigned multiple explicit children.

(An explicit child rarely has more than one <content> element assigned, 
but it can happen when an element in a shadow tree that contains a 
<content> element is itself bound to a shadow tree with <content> 
elements, as noted in the spec.)



> - Can two content elements match the same child of the bound element ?

Yes, in the rare case described above.


>   - if multiple children match the selector, are they all assigned to the
> content element ?

Yes, this seems clear to me in the spec; could you elaborate on what makes 
you think otherwise?


> - what happens if a selector matches a grandchild of the bound element ? is it
> valid ?

The grandchild is never examined for the purposes of <content> processing, 
only the explicit children are examined.


> I suggest adding a sentence like: "Only explicit child nodes are dispatched.
> It is not permitted for the includes attribute to specify other nodes than the
> explicit children of the bound element."

This is already there; the spec always says that it is only the explicit 
children that are distributed, not any random node.


> In section 5.4, there is a typo in step 3, remove 'and' 'If T contains a 
> correct and content element '

Fixed.

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

Received on Saturday, 6 January 2007 08:03:55 UTC