w3c / w3c/csswg-drafts

[cssom-view] Possible typo in scroll() method

Open
#8,700 1 comment 0 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

Is there a typo in the description of the dom element scroll() method?

  1. If the element is the root element invoke scroll() on window with scrollX on window as first argument and y as second argument, and terminate these steps.

According to this definition x is ignored and replaced with window.scrollX when running scroll() on the root element.
I doubt that that is the intended behavior.

It seems as if this is a copy paste error, as this is the exact same text as for step 8 for setting scrollTop, where this would be the correct behavior.

Should the definition be rewritten to pass both x and y to scroll() on window?

  1. If the element is the root element invoke scroll() on window with x as first argument and y as second argument, and terminate these steps.

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

Open the CSSOM View Element scroll() definition and compare its root-element step 8 with the linked scrollTop step 8. Confirm the intended arguments, then update the specification text so the root-element case passes x and y; the corrected wording should match that behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.