Shadow DOM – Full attachShadow, Slot Assignment, Event Retargeting #123
Labels
No labels
bug
docs
feature
housekeeping
html-spec
performance
react-compat
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
glow-all/true-headless-browser#123
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Gap
Wir haben einen installShadowDOM() Shim, aber kein echtes Shadow Root, kein echtes Slot-Assignment, kein korrektes Event Retargeting. Das bricht Frameworks die Shadow DOM nutzen (Lit, Stencil, Angular mit ViewEncapsulation.ShadowDom).
Was wir brauchen
1. attachShadow(init)
Element.attachShadow({ mode, delegatesFocus, slotAssignment })element.shadowRootgetter2. ShadowRoot Interface
mode- 'open' | 'closed'delegatesFocus- booleanslotAssignment- 'manual' | 'named'host- das Host-ElementinnerHTML- Serialisierung + Parsing (wie Document)styleSheets/adoptedStyleSheetsgetSelection()- noopelementFromPoint()- noop3. Slots
<slot>Elementslot.name/slot.assignedNodes(options)/slot.assignedElements(options)slotchangeEvent feuert wenn assignedNodes sich aendern4. Slottable Interface
element.slot- Attribut-Reflection fuer slot="..."assignedSlot- Zeigt auf das slot-Element dem das Child zugewiesen ist5. Event Retargeting
event.composedPath()muss korrekt seinevent.target/event.relatedTargetwerden auf Host-Element retargetedevent.composedflag steuert ob Event ueber Shadow Boundary hinaus propagiertcomposed: falseEvents (z.B.focus,mouseenter) propagieren NICHT6. Declarative Shadow DOM
<template shadowrootmode="open">- Parser muss declarative Shadow Roots erkennen<template shadowrootmode="closed">Labels
feature, html-spec
Architektur
Tests