[Bug 22344] [Shadow]: Distribute into <shadow>, project into older shadow root

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

--- Comment #36 from Hayato Ito <hayato@chromium.org> ---
(In reply to Steve Orvell from comment #35)
> With the new semantics, the old <shadow> behavior of
> 'giveMeRemainingNodesAtLast' is just gone, so even though it would maintain
> backward compatibility, I think making an empty <shadow> work this way will
> just be confusing going forward since an empty <shadow> would be the *only*
> way to get that exact functionality.
> 
> We should view 'empty <shadow> acts as if it contains a <content>' as only a
> shorthand for the common case, adding no different behavior than if you took
> the time to type that out by hand. This way it's very easy to explain.

Thank you. We have different opinions. I am happy to discuss!

But this time, I guess you have difficult time to convince me. :)

Let's forget "<shadow><content giveMeRemainingNodesAtLast></content>". I am
feeling that this is not good explanation because it unnecessarily highlights a
phantom content element, which doesn't appear in code.

Instead of that, let's call my proposal, the rule of "An empty shadow insertion
point takes all remaining nodes".

- This rule satisfies the most common use cases which developers want. Users
don't have to be afraid whether a <content> element comes after the shadow
insertion point or not. Developers can put a shadow insertion point anywhere.

If a shadow insertion point acts like <shadow><content></content></shadow>, I
am afraid that developers have to be careful about the position of the shadow
insertion point. For example, when the following tree is given:

A)
 #shadow-root
     <content id=a select=".deco1"></content>
     <content id=c select=".deco2"></content>
     <shadow id=b></shadow>

If developers want to change the position of the shadow insertion point as
follows:

B)
 #shadow-root
     <content id=a select=".deco1"></content>
     <shadow id=b></shadow>
     <content id=c select=".deco2"></content>

This doesn't work because the shadow insertion point eats all nodes, including
'.deco2'.
Instead of B), developers have to write:

C)
 #shadow-root
     <content id=a select=".deco1"></content>
     <shadow id=b><content select=":not(.deco2)"></content></shadow>
     <content id=c select=".deco2"></content>

Unfortunately, according to the matching criteria
(https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#satisfying-matching-criteria),
developers cannot write easily such a select attribute (because :not is a
pseudo class), can we? The current support for selectors used by content
insertion points is too weak to achieve C.



- For explanation, I think all we have to say is "an empty shadow insertion
point takes all remaining nodes". That's easy to explain, isn't it? Actually,
this rule makes the spec and the implementation simpler than a hidden <content>
element, as far as I've tried so far.

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

Received on Thursday, 7 November 2013 04:25:37 UTC