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

Clarify how scroll to fragment is performed #66

Closed
fred-wang opened this issue Oct 26, 2019 · 2 comments · Fixed by #67
Closed

Clarify how scroll to fragment is performed #66

fred-wang opened this issue Oct 26, 2019 · 2 comments · Fixed by #67

Comments

@fred-wang
Copy link

https://wicg.github.io/ScrollToTextFragment/#navigating-to-text-fragment defers to HTML5 in order to perform the scroll to the fragment.

https://html.spec.whatwg.org/multipage/browsing-the-web.html#scroll-to-the-fragment-identifier assumes that the indicated part of the document is an Element and then defers to CSSOMView.
However, https://wicg.github.io/ScrollToTextFragment/#find-a-target-text returns a Range.

Maybe what is wanted instead is to rely on window.find() but this is not standardized. See whatwg/html#3539

@fred-wang fred-wang changed the title Clarify how the scroll to fragment is performed Clarify how scroll to fragment is performed Oct 26, 2019
@bokand
Copy link
Collaborator

bokand commented Nov 5, 2019

@fred-wang WDYT of the updated indicated part of the document handling in #67?

I think it'd make sense to standardize/clean-up window.find() and if we did that it'd make sense to share some of that functionality with this proposal but I expect that's a much larger undertaking and I don't think we should block ScrollToTextFragment on that work. WDYT?

@fred-wang
Copy link
Author

@fred-wang WDYT of the updated indicated part of the document handling in #67?

OK, I took a look at the new text and the behavior now seems well-defined to me. At least I didn't find any obvious gap that prevents implementing it. Thanks for doing that change!

Maybe one possible addition could be to extend ScrollIntoViewOptions or ScrollOptions with a boolean "highlight" parameter, so that the CSSOM would take care of https://wicg.github.io/ScrollToTextFragment/#indicating-the-text-match

I think it'd make sense to standardize/clean-up window.find() and if we did that it'd make sense to share some of that functionality with this proposal but I expect that's a much larger undertaking and I don't think we should block ScrollToTextFragment on that work. WDYT?

Right, I mentioned window.find because there was already an issue request for that but I'm happy with enhancing scrolIntoView. This is maybe even better since that one already has a spec/testsuite and is already used by HTML5. I guess web developers asking for window.find would find this addition useful to implement a polyfill.

I'll reply on the blink-dev thread.

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 a pull request may close this issue.

2 participants