On Tue, Oct 28, 2014 at 1:52 PM, Robert O'Callahan <rob...@ocallahan.org> wrote: > On Wed, Oct 29, 2014 at 9:40 AM, Jonas Sicking <jo...@sicking.cc> wrote: >> >> That said, it's scary that these APIs are described in terms of >> synchronous operations on the scroll position. I.e. it seems to >> pretend that off-main-thread scrolling doesn't exist and then hope >> that implementations are able to still create a good experience on >> implementations that do off-main-thread scrolling. > > > Synchronous-looking scroll operations have been part of the platform for a > long time via the scrollTop and scrollLeft properties. It does no harm to > continue and even extend support for that. There is of course no spec > requirement that we actually re-render synchronously; all we need to do is > update the script's view of page geometry synchronously. The skew between > the page's view of geometry and what we're actually rendering creates > complexity in the browser but it's something we've been dealing with for a > long time. > > The new smooth-scrolling functionality is, of course, async.
Note that I can't find *any* functions in the spec which are descried as asynchronous. I can only find things like, for example, element.scrollBy(), which is defined in terms of reading scrollTop/scrollLeft, adding the value the arguments passed to the function, and then calling element.scroll(). Such an implementation strategy would result in ugly UI which would not satisfy the use cases that were brought up in the other thread. Of course, an implementation can completely ignore the specification text. And instead look at just the WebIDL part of the spec and then do something better. But it still doesn't seem like a great state of affairs. / Jonas _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform