Bug 152774 - Support the ScrollOptions argument to programmatic scrolling APIs
Summary: Support the ScrollOptions argument to programmatic scrolling APIs
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari 9
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL: https://drafts.csswg.org/cssom-view/
Keywords: InRadar, WebExposed
Depends on: 161610
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-05 22:02 PST by Simon Fraser (smfr)
Modified: 2016-12-02 13:57 PST (History)
16 users (show)

See Also:


Attachments
WIP (22.92 KB, patch)
2016-01-06 09:52 PST, Simon Fraser (smfr)
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-yosemite (745.11 KB, application/zip)
2016-01-06 11:39 PST, Build Bot
no flags Details
Archive of layout-test-results from ews107 for mac-yosemite-wk2 (935.98 KB, application/zip)
2016-01-06 11:43 PST, Build Bot
no flags Details
Archive of layout-test-results from ews117 for mac-yosemite (800.31 KB, application/zip)
2016-01-06 11:49 PST, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2016-01-05 22:02:45 PST
WebKit should support the ScrollOptions dictionary described in https://drafts.csswg.org/cssom-view/#scrolling

This involves new API on Element, processing the ScrollOptions, and triggering smooth scrolling.
Comment 1 Simon Fraser (smfr) 2016-01-06 09:52:06 PST
Created attachment 268373 [details]
WIP
Comment 2 WebKit Commit Bot 2016-01-06 10:43:15 PST
Attachment 268373 [details] did not pass style-queue:


ERROR: Source/WebCore/page/DOMWindow.cpp:41:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebCore/ChangeLog:8:  You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 2 in 17 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Build Bot 2016-01-06 11:39:29 PST
Comment on attachment 268373 [details]
WIP

Attachment 268373 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/658417

New failing tests:
fast/dom/Window/window-scroll-arguments.html
Comment 4 Build Bot 2016-01-06 11:39:34 PST
Created attachment 268381 [details]
Archive of layout-test-results from ews101 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 5 Build Bot 2016-01-06 11:43:03 PST
Comment on attachment 268373 [details]
WIP

Attachment 268373 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/658419

New failing tests:
fast/dom/Window/window-scroll-arguments.html
Comment 6 Build Bot 2016-01-06 11:43:09 PST
Created attachment 268382 [details]
Archive of layout-test-results from ews107 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 7 Build Bot 2016-01-06 11:49:09 PST
Comment on attachment 268373 [details]
WIP

Attachment 268373 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/658428

New failing tests:
fast/dom/Window/window-scroll-arguments.html
Comment 8 Build Bot 2016-01-06 11:49:14 PST
Created attachment 268383 [details]
Archive of layout-test-results from ews117 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews117  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 9 Simon Fraser (smfr) 2016-01-06 21:35:36 PST
WebKit currently supports window.scrollTo() with one argument. We need to make scrollTo(<number>) throw, and require that the single-argument version is getting an Object argument (as FF and Blink do). Not sure how do that in IDL.
Comment 10 Sam Weinig 2016-01-07 12:31:25 PST
(In reply to comment #9)
> WebKit currently supports window.scrollTo() with one argument. We need to
> make scrollTo(<number>) throw, and require that the single-argument version
> is getting an Object argument (as FF and Blink do). Not sure how do that in
> IDL.

Probably something like this:

    void scrollTo(long x, long y);
    void scrollTo(optional Dictionary options);

Though, we may want to change to "unrestricted double" as well.
Comment 11 Simon Fraser (smfr) 2016-01-07 12:57:51 PST
This also shows that there's some combat risk with this change, but since Chrome and FF both agree on the new behavior, it's probably low.
Comment 12 Radar WebKit Bug Importer 2016-01-07 20:42:19 PST
<rdar://problem/24102997>
Comment 13 Simon Fraser (smfr) 2016-12-02 13:57:39 PST
This has been implemented via bindings changes etc.