In the section "Selecting between multiple aligned snap areas;
4-1. If list contains the focused box, remove all other boxes from list.
And in the 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 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
In the section "Selecting between multiple aligned snap areas;
And in the overview;
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 is supposed to choose such kind of scroll container having the focused element. I mean, the focused element will never be in the
listfor 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;
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
@Devmila @skobes-chromium @fantasai