Re: [csswg-drafts] [cssom-view-1] Element.scrollIntoView() does not scroll to a position:fixed element in an iframe (#5492)

Yeah, I think the Firefox behavior is because [this code](https://searchfox.org/mozilla-central/rev/fc5c4461124b8572442c71bc34947bee68b75551/layout/base/PresShell.cpp#3672) doesn't look across document boundaries, and that looks like a bug.

My only concern with scrolling the outer window is whether `<iframe>`s (in particular cross-origin ones) should really do that. Is there any information they can infer information that they couldn't / shouldn't (e.g., via `IntersectionObserver`)?

But we right now are scrolling stuff into view on them when they have a scrollable ancestor, if I'm reading the code correctly, so it seems it wouldn't really make stuff worse.

So assuming the cross-origin info leaks are not a worry, I think safari's behavior makes sense in the unclipped case.

For the clipping case: I don't think we do any intersection shenanigans in Gecko. It's weird to special-case clipping but not other ways of occlusion / hiding content, I think?

If we don't intersect, then we get the Safari behavior, right? I think that may be the simplest one to spec and explain to developers (and I don't think I've seen any compat issue with this).

-- 
GitHub Notification of comment by emilio
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5492#issuecomment-1092349249 using your GitHub account


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

Received on Friday, 8 April 2022 01:25:11 UTC