| Summary: | window.scrollBy misses checking the type of options param | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | zyscoder <zyscoder> |
| Component: | WebKit Misc. | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED INVALID | ||
| Severity: | Normal | CC: | cdumez, sam |
| Priority: | P2 | ||
| Version: | WebKit Local Build | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
window.scrollBy('\u{1a}'); gives me a TypeError on Safari 15. This is likely already fixed.
(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. |
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.`