(web compat) window.scrollTo() should not throw an error when called with 0 or 1 arguments

UNCONFIRMED
Unassigned

Status

()

Core
DOM: Core & HTML
--
minor
UNCONFIRMED
4 years ago
4 years ago

People

(Reporter: Philip Rogers, Unassigned)

Tracking

Trunk
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
Over in Chromium we recently looked into window.scrollTo() and found some cross-browser inconsistencies in the edge case of no arguments:
Chromium - window.scrollTo() scrolls to the top of the window
IE - window.scrollTo() scrolls to the top of the window
Safari - window.scrollTo() scrolls to the top of the window
Firefox - window.scrollTo() throws "Exception... Not enough arguments [nsIDOMWindow.scrollTo]."

(similarly for window.scroll and window.scrollBy)

This isn't spec'ed (http://www.w3.org/TR/html5/browsers.html#window) and is incredibly minor, but it would be nice if we all aligned on one behavior. For reference, this was discussed in the comments of https://codereview.chromium.org/59863003. This may be a good first bug for someone :)
This is in fact specced at http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface and the spec as currently written requires the Gecko behavior.  Perhaps the spec needs to change, in which case you should just raise this as a spec issue.
Summary: (web compat) window.scrollTo() should not throw an error → (web compat) window.scrollTo() should not throw an error when called with 0 or 1 arguments
You need to log in before you can comment on or make changes to this bug.