w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.44k stars 657 forks source link

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

Open johannesodland opened 1 year ago

johannesodland commented 1 year ago

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.
johannesodland commented 1 year ago

I hope its ok to cc you here @smfr