RESOLVED INVALID226965
window.scrollBy misses checking the type of options param
https://bugs.webkit.org/show_bug.cgi?id=226965
Summary window.scrollBy misses checking the type of options param
zyscoder@gmail.com
Reported 2021-06-14 04:42:04 PDT
Steps to reproduce: (1) Open a tab and navigate to any URL; (2) Open Devtools and run the following code in the Console: ``` window.scrollBy('\u{1a}'); ``` Actual results: This code would be evaluated successfully without any exceptions thrown. Expected results: As https://drafts.csswg.org/cssom-view/#dom-window-scrollby says, the param should be of ScrollToOptions type. Thus a TypeError exception should be thrown for this code. In my test, both Chrome and Firefox would throw exceptions: Chrome: `TypeError: Failed to execute 'scrollBy' on 'Window': cannot convert to dictionary.` Firefox: `Window.scrollBy: Value can't be converted to a dictionary.`
Attachments
Chris Dumez
Comment 1 2021-06-15 08:44:38 PDT
window.scrollBy('\u{1a}'); gives me a TypeError on Safari 15. This is likely already fixed.
Chris Dumez
Comment 2 2021-06-15 08:46:51 PDT
(In reply to Chris Dumez from comment #1) > window.scrollBy('\u{1a}'); gives me a TypeError on Safari 15. This is likely > already fixed. I recommend trying Safari Technology Preview or Safari 15 beta.
Note You need to log in before you can comment on or make changes to this bug.