w3c / w3c/csswg-drafts

[cssom-view] Clarify scrollTop/scrollLeft behavior for ongoing smooth scrolls.

Open
#5,679 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cssom-view-1
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

https://github.com/w3c/csswg-drafts/blob/16331cc5307a9f929117ed4b81a1d62207870505/cssom-view-1/Overview.bs#L371

About that line specifically:

Abort any ongoing smooth scroll for box.

Makes sense when setting a 2D position through scrollTo & scrollIntoView, but not as much when setting scrollLeft/Top properties, which most people (and browsers today) would assume to be independent properties.

Specifically, should these two blocks of code behave differently when smooth-scrolling is on than if it isn't:

    element.scrollLeft = x;
    element.scrollTop = y;
    element.scrollTop = y;
    element.scrollLeft = x;

It sounds reasonable that both of these should end up [smooth] scrolling to (x,y), but some interpretations of the spec could lead a browser to implement something that would smooth scroll to (0,y) or (x,0) respectively (assuming origin at (0,0)).

Reference mozilla bug where there are questions on the spec: https://bugzilla.mozilla.org/show_bug.cgi?id=1671283

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with cssom-view-1/Overview.bs at the linked line around “Abort any ongoing smooth scroll for box,” then compare the two scrollTop/scrollLeft assignment sequences described in the issue. Review Mozilla bug 1671283 for the implementation questions; done means the specification clearly defines whether each sequence preserves the other coordinate during smooth scrolling.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.