demo · v141

Anchor Navigation

Click any anchor link below. If the target sits inside a closed <details> or a hidden=until-found region, the browser opens every ancestor — exactly to the target, not all the surrounding ones. The 141 algorithm update makes this reliable across deeper nestings the old code couldn't handle.

checking support…

Anchor links:

Outer details
Inner details
Deepest details

#nested-deep target lives 3 levels deep. The whole chain opens on anchor navigation.

Sibling (was open)

#sibling-closed target — the algorithm leaves already-open siblings alone.

Outer with hidden=until-found inside

the algorithm in plain English

// When navigating to a fragment:
// 1. find the element matching the id
// 2. walk up its ancestor chain
// 3. for each closed 
, set open="" // 4. for each [hidden=until-found], remove the attribute // 5. scroll the element into view, focus if appropriate // // 141 fix: the walk now correctly handles slots and shadow boundaries // without re-entering the same node (the infinite-loop bug).

why this angle

Long structured documents (legal terms, API references, knowledge bases) increasingly mix <details> for performance with anchor-link navigation for permalinks. The revealing algorithm has to walk arbitrary nesting and stop cleanly. Pre-141 there was an edge case where a slot inside a custom element inside a details inside a hidden region could loop the walk. The fix is a guard; the user-visible result is "anchor links never hang the page."

see also