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

> My only concern with scrolling the outer window is whether <iframe>s (in particular cross-origin ones) should really do that.

Yeah, sorry, I should have mentioned: this is only for same-origin cases. We block bubbling scrolls across origins and I'm not suggesting we stop doing that.

> 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?

I think the only downside is you get some weird behaviors in some cases. E.g:

https://mparch-bokan.glitch.me/bug/sIV-clipping.html

In Gecko, if you first `ScrollIntoView - end` (so that the target overflows far to the top/left), then scroll the main window back and click `ScrollIntoView - nearest`, nothing happens because Gecko thinks the target element is already in view. Similarly, `ScrollIntoView - center` also doesn't quite center the visible scroller.

WebKit seems to do the same thing as Gecko in the `nearest` case but just scrolls to clearly the wrong place in the `center` case which I don't understand.

IMHO the Blink behavior is more intuitive here.

> 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).

Yeah, (I hope) these are fairly obscure edge cases so I don't feel strongly; having the implementations agree is more important than the ideal behavior in these cases. I wouldn't be opposed to changing Blink's behavior to match Gecko/WebKit if it's web compatible (hopefully since the behavior is in Gecko/WebKit it should be) but it does seem like there's some differences even between Gecko/Webkit. 

> The real patch happened to be a little bit more subtle, but I attached it to https://bugzilla.mozilla.org/show_bug.cgi?id=1763743. If we agree on that behavior I'm happy to land that.

Nice, thanks. I have a similar patch for Blink with a WPT based on my test case in the first message which I should be able to land in the next day or two.

-- 
GitHub Notification of comment by bokand
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5492#issuecomment-1093026085 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 15:49:37 UTC