[w3c/webcomponents] Shadow DOM Example 1 whithout slot attribute applied, select by class (#626)

Hi,

in "Example 1", section  "8. Shadow DOM Example", it comes with slot applied, as indicated in "issue 1".

What about in "Example 4" apply it imperatively :

function makeShadowTree(storyList)
{
    **storyList.querySelectorAll('il.breaking').forEach(function(element) {element.slot = 'breaking';});**
    var root = storyList.attachShadow({mode: 'open'});
    root.appendChild(createStyle());
    root.appendChild(createStoryGroup('breaking', 'breaking'));
    root.appendChild(createStoryGroup('other', ''));
}

So, it would be more similar of approach of version 0: <content select="breaking"> , isolating original HTML from knowing about internal about the slots in "example 2".

Any achanges in presentation in "Example 2" will not imply in changes in "Example 1".

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/626

Received on Tuesday, 14 February 2017 17:28:33 UTC