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

[cssom-view-1] Extend 'scroll into view' steps to Ranges #8254

Merged
merged 1 commit into from
Dec 22, 2022

Conversation

bokand
Copy link
Contributor

@bokand bokand commented Dec 22, 2022

[cssom-view-1] Extend 'scroll into view' steps to Ranges

Generalizes The scroll an element into view algorithm to work also work for a Range as well as an Element. This is trivial as the only use of Element is to call getBoundingClientRect which Range also defines.

Additionally exports this algorithm for use in whatwg/html#8282.

Nit: also fixes erroneous reference to a non-existent box variable where scrolling box was intended.

@bokand bokand requested review from emilio and smfr December 22, 2022 18:27
@bokand
Copy link
Contributor Author

bokand commented Dec 22, 2022

@smfr or @emilio PTAL

@bokand bokand merged commit fb7bdab into w3c:main Dec 22, 2022
@bokand bokand deleted the elementOrRangeScrollIntoView branch December 22, 2022 21:11
bokand added a commit to WICG/scroll-to-text-fragment that referenced this pull request Dec 22, 2022
This removes the monkey patches to CSSOM-View-1's 'scroll an element into view' steps as w3c/csswg-drafts#8254 made the necessary changes. They turned out to be much simpler, simply allowing using a Range in place of an Element since Range also implements `getBoundingClientRect`
jakearchibald pushed a commit to jakearchibald/csswg-drafts that referenced this pull request Jan 16, 2023
Generalizes The scroll an element into view algorithm to work also work for a Range as well as an Element. This is trivial as the only use of Element is to call getBoundingClientRect which Range also defines.

Additionally exports this algorithm for use in whatwg/html#8282.

Nit: also fixes erroneous reference to a non-existent box variable where scrolling box was intended.
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.

2 participants