Skip to content
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

Scroll webview to top if unmatched fragment is #top #164070

Merged
merged 1 commit into from Oct 20, 2022

Conversation

dsanders11
Copy link
Contributor

@dsanders11 dsanders11 commented Oct 19, 2022

In the HTML Standard, section 7.11.9 “Navigating to a fragment” states that when looking for the indicated part of the document, if the fragment doesn’t match any element, but is the special value “top”, then the top of the document is indicated:

If decodedFragment is an ASCII case-insensitive match for the string top, then the indicated part of the document is the top of the document; return.

This PR updates the logic for webviews to follow the spec. Can be tested by putting a link to #top in a Markdown document and previewing the document.

cc @mjbvz

@dsanders11 dsanders11 requested a review from mjbvz Oct 19, 2022
mjbvz
mjbvz approved these changes Oct 20, 2022
@mjbvz mjbvz merged commit f7a080d into microsoft:main Oct 20, 2022
5 checks passed
@mjbvz
Copy link
Contributor

mjbvz commented Oct 20, 2022

Thanks!

@mjbvz mjbvz added this to the October 2022 milestone Oct 20, 2022
@dsanders11 dsanders11 deleted the webview-top-fragment branch Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants