Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add initial scroll position hook to HTML spec #10759
base: main
Are you sure you want to change the base?
Add initial scroll position hook to HTML spec #10759
Changes from 5 commits
ece2224
b5b44c8
ae81ba7
dd852fe
abee623
2ecc9aa
df3e496
1f28b52
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This always calls itself recursively. That doesn't seem right... it seems like the first time you succeed, you should stop looping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for calling this out. The idea is for user agents to keep scrollers scrolled to their initial scroll position until some user action indicates otherwise. Since style properties can change the initial scroll position, we need to keep re-evaluating the initial scroll position until such a user action has taken place. I think that, in practice, this re-evaluating of the initial scroll position will simply lead to a noop most of the time.
Also, this is pretty much what user agents should already do with properties like align-content. You can see in this demo (which, unfortunately, only works in Safari at the moment) that as messages are loaded, the scroll position needs to be updated to keep the first message scrolled to, which is what
align-content: end
is used for here. As soon as the user scrolls, the scroll container is no longer kept at the initial scroll position.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. So this is fairly different from the "try to scroll to a fragment" case, where we continue until the fragment is loaded; instead, we need to actively continue, possibly forever. Very interesting!
Let's summarize this in a
<p class="note">
after "update the initial scroll position". Something like:Please feel free to improve my wording; that's just my best understanding so far!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I think your note summarizes it quite well, Done.