[cssom-view] scrollIntoView for text nodes/selections
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- PR merge metrics
- PR metrics pending
Description
https://drafts.csswg.org/cssom-view/#dom-element-scrollintoview defines what happens when you call this method on an element. There are non-element things one can want to scroll into view - text nodes, cursor locations, selection ranges, etc. I was surprised today to find that the 'solution' for these things is to insert a br element in the appropriate spot, call scrollIntoView() on that, then remove it.
Apparently IE9 correctly scrolled selection ranges into view when the method was called:
document.selection.createRange().scrollIntoView();
Could we specify and implement this useful behavior?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the CSSOM View scrollIntoView definition at the linked specification section and review the existing discussion and examples in this issue. Determine how text nodes, cursor locations, and selection ranges should be specified, including the existing IE9 behavior. Done means the proposed behavior is clearly defined in the specification and an implementation path is agreed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100