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

Re: Imperative API for Node Distribution in Shadow DOM (Revisited)

From: Ryosuke Niwa <rniwa@apple.com>
Date: Thu, 30 Apr 2015 10:42:20 -0700
Cc: Olli Pettay <olli@pettay.fi>, WebApps WG <public-webapps@w3.org>, Erik Bryn <erik@erikbryn.com>, Dimitri Glazkov <dglazkov@google.com>
Message-id: <0EEE9E45-9E28-4D06-AAA3-2B7CE40511B1@apple.com>
To: Anne van Kesteren <annevk@annevk.nl>

> On Apr 30, 2015, at 5:12 AM, Anne van Kesteren <annevk@annevk.nl> wrote:
> 
> On Mon, Apr 27, 2015 at 11:05 PM, Ryosuke Niwa <rniwa@apple.com> wrote:
>>> The other thing I would like to explore is what an API would look like
>>> that does the subclassing as well.
>> 
>> For the slot approach, we can model the act of filling a slot as if attaching a shadow root to the slot and the slot content going into the shadow DOM for both content distribution and filling of slots by subclasses.
>> 
>> Now we can do this in either of the following two strategies:
>> 1. Superclass wants to see a list of slot contents from subclasses.
>> 2. Each subclass "overrides" previous distribution done by superclass by inspecting insertion points in the shadow DOM and modifying them as needed.
> 
> With the existence of closed shadow trees, it seems like you'd want to
> allow for the superclass to not have to share its details with the
> subclass.

Neither approach needs to expose internals of superclass' shadow DOM.  In 1, what superclass seems is a list of proxies of slot contents subclasses provided.  In 2, what subclass sees is a list of wrappers of overridable insertion points superclass defined.

I can't think of an inheritance model in any programming language in which overridable pieces are unknown to subclasses.

- R. Niwa
Received on Thursday, 30 April 2015 17:42:52 UTC

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