W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2017

Re: [custom-elements]

From: Jeff Robbins <jeffr@livedata.com>
Date: Mon, 11 Sep 2017 14:30:24 +0000
Message-ID: <CAP5X+re0OLgD_jU2bTX1_KKUX-yb9NB9QbwjdQjn9MBoXxCo+g@mail.gmail.com>
To: Tomek W <tomalecpub@gmail.com>
Cc: public-webapps@w3.org
So "shadow-including descendant" means "potentially shadow-including
descendant"?

Best,
Jeff

On Mon, Sep 11, 2017, 10:18 AM Tomek W <tomalecpub@gmail.com> wrote:

> Does this paragraph imply that the *only* custom elements that will be
>> upgraded are those that have a shadow root?
>>
>
> The answer is given at
> https://dom.spec.whatwg.org/#concept-shadow-including-descendant
>
> An object A is a shadow-including descendant of an object B, if A is a
>> descendant <https://dom.spec.whatwg.org/#concept-tree-descendant> of B,
>> or A’s root <https://dom.spec.whatwg.org/#concept-tree-root> is a shadow
>> root <https://dom.spec.whatwg.org/#concept-shadow-root> and A’s root
>> <https://dom.spec.whatwg.org/#concept-tree-root>’s host
>> <https://dom.spec.whatwg.org/#concept-documentfragment-host> is a shadow-including
>> inclusive descendant
>> <https://dom.spec.whatwg.org/#concept-shadow-including-inclusive-descendant>
>> of B.
>>
>
> And says "no". "shadow-including descendant" is Shadow or Light DOM
> descendant.
>
> Bes Regards,
> Tomek
>
>
> [image: photo]
> <https://www.facebook.com/starcounterdb/>
> <https://www.linkedin.com/company/starcounterdb>
> <https://twitter.com/StarcounterDB>
>  *Tomek Wytrębowicz *|| *JS & Web Apps*
> +48 507 134 110 | tomalecpub@gmail.com
> www.starcounter.com <http://starcounter.com/> | www.starcounter.io
> <http://starcounter.io/>
> Nybrokajen 5, 111 48 Stockholm, Sweden
>
> 2017-09-09 4:01 GMT+02:00 Jeff Robbins <jeffr@livedata.com>:
>
>> We're building commercial apps with the emerging custom elements
>> standard.  We love the approach, and think that custom elements are a
>> wonderful productivity tool, and reduce the "div soup" we are tired of!
>>
>> I noticed in Custom Elements W3C Working Draft 13 October 2016, Section
>> 2.4 The CustomElementRegistry interface, paragraph #14 under Element
>> definition a detail that caught me by surprise:
>>
>> Let upgrade candidates be all elements that are shadow-including
>> descendants
>> <https://dom.spec.whatwg.org/#concept-shadow-including-descendant> of
>> document, whose namespace is the HTML namespace
>> <https://html.spec.whatwg.org/multipage/infrastructure.html#html-namespace-2> and
>> whose local name is localName, in shadow-including tree order
>> <https://dom.spec.whatwg.org/#concept-shadow-including-tree-order>.
>> Additionally, if extends is non-null, only include elements whose is
>>  value <https://www.w3.org/TR/custom-elements/#concept-element-is-value> is
>> equal to name.
>>
>> What surprised me is that I would have thought a custom element with only
>> "light DOM" children would also qualify as an "upgrade candidate".  Does
>> this paragraph imply that the *only* custom elements that will be upgraded
>> are those that have a shadow root?   I'm thinking that is, perhaps, overly
>> specified?
>>
>> (We need such custom elements here and now because polyfills and our
>> hospital customers running IE11.)
>>
>> If it indeed expresses a hard requirement, then it would appear to
>> contradict section 2.2 Requirements for custom element constructors:
>>
>> In general, the constructor should be used to set up initial state and
>> default values, and to set up event listeners and possibly a shadow root
>> <https://dom.spec.whatwg.org/#concept-shadow-root>.
>>
>> If the constructor only "possibly" sets up a shadow root, then there's a
>> custom element lacking a shadow root, and thus isn't an upgrade candidate?!?
>>
>> Any clarification would be much appreciated!  Thank you again for the
>> great work making the browser dev environment much better!
>>
>> Best,
>> Jeff Robbins
>> jeffr@livedata.com
>> www.livedata.com
>>
>>
>>
>
Received on Monday, 11 September 2017 14:30:59 UTC

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