we (web engine): Experimental web browser project to understand the limits of Claude

html/style/dom: render declarative shadow DOM (isu issue 348) master

Recognise <template shadowrootmode="open|closed"> (and the legacy shadowroot attribute) in the tree builder and attach the template contents as a shadow root on the host element instead of inserting an inert <template> into the light tree. - dom: Document gains host->root / root->host shadow maps plus attach_shadow_root / shadow_root / shadow_host. The shadow fragment is detached from the light tree (children(host) never returns it). - html: <template> with shadowrootmode/shadowroot attaches a shadow root and directs subsequent insertions into the shadow fragment; the matching </template> pops it. Ordinary <template> is unchanged. - style: resolve_node walks an element's shadow tree as its rendered children, styled by the outer stylesheet plus the shadow's own <style> rules; the shadow stylesheet's :host rules cascade onto the host. - e2e dom_dump descends into shadow roots (#shadow-root marker). The blocket.se finn-topbar header lives in a declarative shadow root; it now lays out and its "Logga in" link is clickable. Adds a regression probe (assert_link_at [data-automation-id=profile-link] /auth/login) to blocket.se.we and unit tests across dom/html/style. The scenario keeps its screenshot xfail (parity gap tracked by isu issue 331). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>


+352 -16
7 changed files