Skip to content
This repository has been archived by the owner on Jun 25, 2019. It is now read-only.

Should scroll anchoring apply to window resize / rotate? #11

Open
RByers opened this issue Apr 21, 2017 · 3 comments
Open

Should scroll anchoring apply to window resize / rotate? #11

RByers opened this issue Apr 21, 2017 · 3 comments

Comments

@RByers
Copy link
Member

RByers commented Apr 21, 2017

@dbaron (and I believe others in the CSS WG discussion) mentioned that they would want scroll anchoring to apply in the window resize case.

I was thinking we had some other solution for that in Chrome (eg. doing a hit-test at the start of resize, like our rotation anchor stuff) but trying it on a couple sites on desktop I didn't see it working.

Perhaps scroll anchoring should say explicitly that it also applies in cases like resize and rotate?

@skobes-chromium
Copy link
Collaborator

It's supposed to work on resize but it looks like it might have regressed. I'll look into it this week.

@skobes-chromium
Copy link
Collaborator

For rotate we do have a different solution in RotationViewportAnchor, which uses a hit-test. The requirements are slightly different, for example we try to anchor the center of the viewport while scroll anchoring aims at the top of the viewport.

@ojanvafai
Copy link
Member

I was always picturing that we'd delete RotationViewportAnchor and use the new scroll anchoring logic instead. I think the new logic is strictly better. It's faster since it doesn't need to hit test and it's more accurate because it keeps the thing at the top of the screen anchored instead of the thing in the middle. When you're hit-testing, you're forced to do middle to avoid toolbars.

I filed https://bugs.chromium.org/p/chromium/issues/detail?id=714959 to track changing rotation in Chrome.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants