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

Update: Chrome 102 shipped the change to bubble scrollIntoView from position: fixed elements to parent frames. However, I ran into some web-compat issues in [1334265](https://crbug.com/1334265) which, curiously, doesn't affect WebKit. I think I narrowed the reason down to: WebKit doesn't bubble a scrollIntoView across origins whereas Blink and Gecko do, see this reduced repro: https://reproduce.glitch.me/iframe-fixed-scrollintoview.html.

IIUC, WebKit sets ShouldAllowCrossOriginScrolling::No [here](https://github.com/WebKit/WebKit/blob/71524a1f562d04de5c96c88613d7540cf9d04579/Source/WebCore/dom/Element.cpp#L1024) (and [here](https://github.com/WebKit/WebKit/blob/71524a1f562d04de5c96c88613d7540cf9d04579/Source/WebCore/page/FrameView.cpp#L2461) from focus() calls) so the [scrollRectToVisible doesn't cross origins](https://github.com/WebKit/WebKit/blob/71524a1f562d04de5c96c88613d7540cf9d04579/Source/WebCore/rendering/RenderLayer.cpp#L2600).

@smfr - Can you confirm?

Preventing a scroll from crossing origin boundaries seems like a good idea to me. Given that WebKit already ships this behavior it'd hopefully be web compatible. What do you all think of aligning Gecko/Blink to also avoid scrolls crossing origin boundaries in these cases?

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


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

Received on Thursday, 9 June 2022 17:11:53 UTC