You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Should scroll margin be applied to cross-origin iframe? #531
Given this situation: site A embeds a cross-origin-domain iframe B, which in turn embeds a same-origin-domain iframe C with the same domain as A. If a target in C sets up an implicit root intersection observer, the root is then site A, and the observer is same-origin-domain.
So in the given situation, scroll margin should be applied. But when computing the intersection, we'll apply the scroll margin to the cross-origin-domain iframe B. This doesn't seem like the desirable behavior.
In the discussion about adding scroll margin, there's a note about not applying scroll margin to iframes:
Implementation notes:
[...]
Should stop margins at a cross-origin iframe boundary for security
So maybe the spec is just not updated to include this point?
Activity
[-]`scrollMargin`[/-][+]Should scroll margin be applied to cross-origin iframe?[/+]tuankiet65 commentedon Oct 26, 2026
I wrote a WPT test for this scenario: https://wpt.fyi/results/intersection-observer/scroll-margin-propagation.html?label=master&label=experimental&aligned. Firefox/Safari is passing and Chrome isn't.