[Bug 26365] [Shadow]: Need an equivalent definition of 'in a Document' for shadow trees

https://www.w3.org/Bugs/Public/show_bug.cgi?id=26365

--- Comment #36 from Hayato Ito <hayato@chromium.org> ---
Thanks. If we agree that we should include shadow trees hosted by #c in 'D'
(aka 'in a document deeply), I am wondering what is the difference between:

- the shadow tree hosted by #c
and
-  the oldest shadow tree in the example.

Any node in either tree isn't used in rendering at all (aka they are not in the
composed tree (with document as root)), however,
- Nodes in the shadow tree hosted by #c *are* 'in a document deeply',
- Nodes in the oldest shadow trees, such as #f and #g, *are not* 'in a document
deeply'.

That looks inconsistent to me.

Now I am thinking that the proposal in comment #34 is more consistent and even
*better* than the proposal in comment #33 in most cases.
You can see the difference between the two proposals bellow (in the summary).
Node #f and #g, which are in the oldest shadow tree, are the difference.


Here is the rationale why I thought proposal 2 (comment #34) is helpful than
proposal 1 (comment #33):

I think 'nodes aren't contributing rendering' doesn't matter here because it's
like a node with *display: none* in a document.
My design principle of shadow trees so far is that shadow trees are mainly used
to construct *one dom tree* so that we can separate different concerns to each
shadow trees.
Each node in shadow trees are 'in a document', conceptually. Although some
nodes don't participate in the composed tree after the composition algorithm, I
think we should consider such nodes like a node marked with 'display: none'.
That's still *in the document* (conceptually, again).


Note that if we try to consider the nodes which doesn't participate in the
composed tree are not 'in a document deeply', that will fail because node #c
(or #d) is in a document, but it doesn't participate in the composed tree (with
document as root). We can't adapt this idea because it would break
backward-compatibility.



The summary is:


Proposal 1 (in comment #33):

A node, |A|, is 'in a document deeply' if |A| meets at least one of the
following conditions:

- |A| is in a document
- |A| is in the youngest shadow tree, |T|, and the shadow host which hosts |T|
is 'in a document deeply'
- |A| is in an older shadow tree, |T|, and the younger shadow tree relative to
|T| has a shadow insertion point, |I|, and |I| is 'in a document deeply'

The result would be:
(We use the example tree of trees in comment #21 again here. In addition to
that, suppose that #c hosts a shadow tree, which contains the node |q|)

                                              a b c d e f g h i j k l m n o p q
A). In a document                             x x x x x
B). In a shadow tree                                    x x x x x x x x x   X X
C). In a composed tree (root is a document)   x x     x     x           x
D). In a document deeply                      x x x x x     x x x x x x x     X
E). Disconnected (from D)                               x x               x x



Proposal 2 (in comment #34):

A node, |A| is 'in a document deeply' if |A| is *inclusive deep descendant* [1]
of a document.

[1]:
http://w3c.github.io/webcomponents/spec/shadow/#dfn-inclusive-deep-descendant


The result would be:

                                              a b c d e f g h i j k l m n o p q
A). In a document                             x x x x x
B). In a shadow tree                                    x x x x x x x x x   X X
C). In a composed tree (root is a document)   x x     x     x           x
D). In a document deeply                      x x x x x x x x x x x x x x     X
E). Disconnected (from D)                                                 x x


If you find any mistake on this summary or any other ideas, please let me know
that.
I'd like to make a decision and add the definition of 'in a document deeply' (a
better name is still wanted) in the spec.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Tuesday, 11 November 2014 06:32:11 UTC