~/talk

Independent Popups with Element Reparenting & The HTML Popover API

Talkat XtremeJS 2024 · 2024-11-12..11-13· [web-platform, javascript]
slides:none on file

Compares CSS-only popups to the new popover API (landed April 2024) and a fallback built via element reparenting used at chatam: popups are hoisted into a document-body container using a proxy element with its own shadow DOM, assigned styles copied via adoptedStyleSheets, slotted children mirrored with mutation observers, z-index hoisted to the proxy, and scroll listeners to reposition. Hundreds of lines produce a working replacement, but it is notably slower, can break accessibility/tab order, and requires consumer workarounds.

AI-written summary · about

  1. 0:00Popups and anatomy
  2. 1:04CSS-only popup limits
  3. 2:05HTML Popover API benefits
  4. 3:49Top layer in Popover API
  5. 5:13HTML attributes with Popover
  6. 6:15Auto vs manual popovers
  7. 7:18When to avoid Popover API
  8. 7:58Element reparenting for popups
  9. 9:21Shadow DOM and slots
  10. 11:47Correlating elements after reparent
  11. 12:50Copying styles and inheritance
  12. 14:55Tracking CSS variable changes
  13. 15:38Containing blocks fundamentals
  14. 17:23Positioning popups to anchors
  15. 18:47Stacking contexts and Z-index
  16. 20:31Managing Z-index in reparented
  17. 21:34Scrolling and repositioning
  18. 22:37Performance vs accessibility
  19. 23:58Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.