scala-js-dom icon indicating copy to clipboard operation
scala-js-dom copied to clipboard

Support for Shadow DOM

Open schmitch opened this issue 9 years ago • 4 comments

Hello, it would be great if Scala JS would also have a Shadow DOM implementation, i.e. provide a way to access Shadow DOM's.

Currently the Spec is in Draft: https://w3c.github.io/webcomponents/spec/shadow/#widl-Element-attachShadow-ShadowRoot-ShadowRootInit-shadowRootInitDict

However there are already really great polyfills here: http://webcomponents.org/polyfills/shadow-dom/

schmitch avatar Dec 22 '15 16:12 schmitch

Definitely a sound addition!

If anyone wants to contribute this a few thoughts:

  • It should probably live in org.scalajs.dom.experimental.shadowdom
  • There would be a package object for shadowdom defining implicit coercions from Element onto a trait exposing shadowRoot, attachShadow etc. members.
  • Since the API is experimental and likely to change in future, a comment at the top of the file linking the version of the specification implemented and a note with it's release date (currently 15th December) will aid tracking support longer term.

mseddon avatar Dec 23 '15 10:12 mseddon

ShadowDOM has a dependency on https://www.w3.org/TR/cssom-view/, which we currently do not implement.

mseddon avatar Feb 16 '16 09:02 mseddon

Now, core parts of the ShadowDOM are in the DOM Standard. https://github.com/WICG/webcomponents/issues/661

Also now can we have this as a non-experimental API? https://caniuse.com/shadowdomv1

unarist avatar Nov 23 '20 13:11 unarist

@unarist if you're up for it will consider a PR! :)

armanbilge avatar Aug 11 '21 03:08 armanbilge