W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2012

Re: [webcomponents]: Changing API from constructable ShadowRoot to factory-like

From: Alex Russell <slightlyoff@google.com>
Date: Mon, 3 Dec 2012 18:33:12 +0000
Message-ID: <CANr5HFXsYugJGMiruL3LfT9aOHZgZJEwwgZr8eQ6=R4SXh4-Dw@mail.gmail.com>
To: Dimitri Glazkov <dglazkov@google.com>
Cc: Elliott Sprehn <esprehn@google.com>, Maciej Stachowiak <mjs@apple.com>, Erik Arvidsson <arv@chromium.org>, public-webapps <public-webapps@w3.org>, Blake Kaplan <mrbkap@mozilla.com>, Jonas Sicking <sicking@mozilla.com>, Boris Zbarsky <bzbarsky@mit.edu>
Sorry for the late response.

Adding more "create*" methods feels like a bug. I understand that there are
a couple of concerns/arguments here:

   - Current implementations that aren't self-hosting are going to have
   trouble with the idea of unattached ("floating") ShadowRoot instances
   - As a result, the mental model implementers seem to have is that "new
   ShadowRoot(element)" has side-effects *on the element*, and that pretty
   clearly feels wrong. A future when re-attaching a ShadowRoot to a different
   element solves this (root.attach(element)?), but it's not planned for now.
   - "new" may lead to errors when a ShadowRoot instance is allocated out
   of one window and an element to attach to is from another. The general DOM
   solution of "allocate out of the element's ownerDocument window" feels
   right here, but isn't elegant in some corner cases.

So while I still favor something like "new ShadowRoot().attach(element)" or
"new ShadowRoot(element)", I think I can live with the create*() version
for now.

I would like for us to support one of the forward-looking versions,
however, if only in a known-limited form.


On Tue, Nov 20, 2012 at 12:08 AM, Dimitri Glazkov <dglazkov@google.com>wrote:

> I made the change to the editor's draft:
> http://dvcs.w3.org/hg/webcomponents/rev/e0dfe2ac8104
>
> You can read the shiny new parts of the spec here:
>
> http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#extensions-to-element
>
> Please let me know if I goofed up something, preferably by filing bugs :)
>
> :DG<
>
>
Received on Monday, 3 December 2012 18:34:11 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:56 GMT