Re: [WICG/webcomponents] "open-stylable" Shadow Roots (#909)

@mayank99, @knowler:

> Shouldn't this attribute go on the template element? And similarly be available in attachShadow()?

> @mayank99 I believe it’s intended to be on the `<template>`, however, in order to support the declarative shadow DOM for the proof of concept it needs to be on the custom element (since DSD templates are removed after they are parsed).

Exactly. As the POC readme mentions:

"Note that the shadowlayers attribute is on the custom element, not on the template of a declarative shadow tree, because the parsing of a declarative shadow tree removes the template at parse time, and it never appears in the DOM."

But ... it might not make a practical difference if it were assumed, as the POC does, that the attribute on a shadow host would only be meaningful if the template element was also present.

The POC speculates there might be use cases where having both an attribute and an @layer present might enhance coordination between a shadow tree designer and user. 

But maybe both an attribute wherever placed and an attachShadow() option may be more of a convenience than a coordination use case.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/909#issuecomment-1996186693
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/909/1996186693@github.com>

Received on Thursday, 14 March 2024 00:35:20 UTC