Re: [whatwg/dom] Declarative Shadow DOM (#831)

Some noteworthy lines from the linked sources above:

> // If it is open, close it to **stop people stealing our secrets**!

> If you attach a shadow root to a custom element with mode: closed set, **you won't be able to access the shadow DOM from the outside**

> Note: As this blog post shows, **it is actually fairly easy to work around closed shadow DOMs**, and the hassle to completely hide them is often more than it's worth.

> This **security measure** prevents JavaScript from being able to obtain a reference to closed shadow roots.

> Creating closed shadow roots (**should avoid**)

> Here's my summary of why **you should never create web components with {mode: 'closed'}:**

> Closed mode prevents your custom element code from accessing its own shadow DOM. **That's complete fail**.

Anyone can add the missing bit of info why we even have this? What problem does it solve?



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/831#issuecomment-717788169

Received on Wednesday, 28 October 2020 08:49:15 UTC