element-worklet icon indicating copy to clipboard operation
element-worklet copied to clipboard

Opportunity to leave out the bad parts of DOM.

Open trusktr opened this issue 4 years ago • 1 comments

The article mentions

What DOM APIs should be available to Element Worklet code? Can WorkletElement provide a sufficient API surface to allow current libraries and approaches to be reused with minimal modification?

This made me think that element worklets may provide an opportunity to provide only a subset of DOM APIs: only the good parts based on decades of learnings from main-thread DOM, dropping the bad parts.

trusktr avatar Aug 16 '21 21:08 trusktr

Absolutely. There are a number of DOM warts that could be intentionally omitted from a layout-less threaded DOM API:

  • no cross-realm append / importNode
  • no DOM-based scripting (event handler attributes, <script>, document.write, etc)
  • no parser-only behaviors (invalid nesting correction, head coercion, etc)
  • no global handlers
  • required (or implied) strict containment
  • maybe no namespaces? (would need something for svg)

developit avatar Nov 02 '21 16:11 developit