CSS scroll-margin should come into play when focusing an element. The css-scroll-snap-1  specification says:
Similarly the 'scroll-margin' property can be used on any box to adjust its visual area for the purpose of scroll-into-view operations.
Focusing triggers this kind of operation.
Created attachment 449647 [details]
Committed r289810 (247271@main): <https://commits.webkit.org/247271@main>
All reviewed patches have been landed. Closing bug and clearing flags on attachment 449647 [details].