W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2015

Re: Proposal for changes to manage Shadow DOM content distribution

From: Ryosuke Niwa <rniwa@apple.com>
Date: Tue, 21 Apr 2015 22:29:06 -0700
Cc: "Edward O&amp,#39 Connor" <eoconnor@apple.com>, Jan Miksovsky <jan@component.kitchen>, WebApps WG <public-webapps@w3.org>
Message-id: <01CFA1CB-06FB-4945-81EA-C7AB609BD541@apple.com>
To: Brian Kardell <bkardell@gmail.com>

> On Apr 21, 2015, at 10:17 PM, Brian Kardell <bkardell@gmail.com> wrote:
> On Apr 21, 2015 8:22 PM, "Ryosuke Niwa" <rniwa@apple.com <mailto:rniwa@apple.com>> wrote:
> >
> > Hi all,
> >
> > Following WebApps discussion last year [1] and earlier this year [2] about template transclusions and inheritance in shadow DOM, Jan Miksovsky at Component Kitchen, Ted O'Connor and I (Ryosuke Niwa) at Apple had a meeting where we came up with changes to the way shadow DOM distributes nodes to better fit real world use cases.
> >
> > After studying various real world use of web component APIs as well as exiting GUI frameworks, we noticed that selector based node distribution as currently spec'ed doesn't address common use cases and the extra flexibility CSS selectors offers isn't needed in practice.  Instead, we propose named insertion "slots" that could be filled with the contents in the original DOM as well as contents in subclasses.  Because the proposal uses the same slot filling mechanism for content distributions and inheritance transclusions, it eliminates the need for multiple shadow roots.
> >
> > Please take a look at our proposal at https://github.com/w3c/webcomponents/wiki/Proposal-for-changes-to-manage-Shadow-DOM-content-distribution <https://github.com/w3c/webcomponents/wiki/Proposal-for-changes-to-manage-Shadow-DOM-content-distribution>
> >
> > [1] https://lists.w3.org/Archives/Public/public-webapps/2014AprJun/0151.html <https://lists.w3.org/Archives/Public/public-webapps/2014AprJun/0151.html>
> > [2] https://lists.w3.org/Archives/Public/public-webapps/2015JanMar/0611.html <https://lists.w3.org/Archives/Public/public-webapps/2015JanMar/0611.html>
> >
> I just wanted to note that a month or two I tried to assume nothing and come up with a bare essentials concept which involved named slots.  Is there a proposed a way to project from an attribute value into content or from attribute to attribute..?
> In other words, if I had <x-foo blah="hello ">. Can I map blah into a slot or identify an attribute value in my template *as* a slot?

Not at the moment but I could imagine that such a feature could be easily added. e.g.

<x-foo blah="hello">

<!-- implementation -->
<template element="x-foo">
  <content attrslot="blah">

- R. Niwa
Received on Wednesday, 22 April 2015 05:29:35 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:31 UTC