[csswg-drafts] [css-scroll-snap-1][interop-2026] Clarify how to handle the snap target having the focused element (#13673)

hiikezoe has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-scroll-snap-1][interop-2026] Clarify how to handle the snap target having the focused element ==
In [the section](https://drafts.csswg.org/css-scroll-snap-1/#multiple-aligned-snap-areas)  "Selecting between multiple aligned snap areas;

> 4-1. If list contains the focused box, remove all other boxes from list.

And in [the overview](https://drafts.csswg.org/css-scroll-snap-1/#overview);

> Snap positions only affect the nearest ancestor scroll container on the element’s containing block chain.

So if these sentences are naively interpreted, a snap target **scroll container** having the focused element would not be preferred over other targets. But [prefer-focused-nested-containers.html](https://wpt.fyi/results/css/css-scroll-snap/snap-after-relayout/multiple-aligned-targets/prefer-focused-nested-containers.html?label=master&label=experimental&aligned&view=interop&q=label%3Ainterop-2026-scroll-snap) is supposed to choose such kind of scroll container having the focused element. I mean, the focused element will never be in the `list` for an ancestor scroll container.

The test was added to address a review comment in https://chromium-review.googlesource.com/c/chromium/src/+/5255777/14..16/third_party/blink/renderer/core/dom/element.cc#b6383 .  The review comment is;

> If there are nested snap containers it looks like this will only update the innermost one, is that right? Do we not need to update snap containers higher up?

From the perspective of users, the behavior what prefer-focused-nested-containers.html checks is reasonable, but the spec needs to clarify it.

@theres-waldo suggests to change the 4-1 bullet point to

> If list contains a box which is focused or has a focused descendant, remove all other boxes from list.

@DevMila @skobes-chromium @fantasai

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13673 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 17 March 2026 23:09:24 UTC