Skip to content

Commit 5ebd920

Browse files
committed
[comp-scroll-anim] Made wording more general.
1 parent e422068 commit 5ebd920

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

composited-scrolling-and-animation/Explainer.md

+13-14
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,20 @@ both for user agents and developers of large sites composed of disparate, 3rd
2121
party components not under the author's control. The result is a lot of janky
2222
pages.
2323

24-
Why can't we update CSS properties from another thread? Updating CSS properties
25-
could effect a style recalc or a layout and those operations must happen on the
26-
main thread. That said, there are certain 'layout-free' properties that can be
27-
modified without these side effects. These properties include transform,
28-
opacity, background color, background position, etc. Updating the scroll offset
29-
is also layout-free. Clearly identifying these layout-free properties and
30-
allowing them to be animated from a separate scheduling domain would provide a
31-
simple and powerful way to achieve smooth animations.
24+
Updating CSS properties could effect a style recalc or a layout and those
25+
operations happen on the main thread in most user agents making them poor
26+
candidates for asynchronous update. That said, there are certain properties that
27+
can be modified asynchronously by all user agents today. These properties include
28+
transform, opacity, and scroll offset. Clearly identifying these 'accelerated'
29+
properties and allowing them to be animated from a separate scheduling domain
30+
would provide a simple and powerful way to achieve smooth animations.
3231

3332
Indeed, all major browsers have had the ability to asynchronously update
34-
layout-free properties for years. Some examples include WebAnimations, CSS
35-
animations, and transitions involving layout-free properties as well as
33+
accelerated properties for years. Some examples include WebAnimations, CSS
34+
animations, and transitions involving accelerated properties as well as
3635
compositor driven scrolling. A few new approaches are in the works such as
3736
position:sticky and snap points, but it's unfortunate to have to wait for specs
38-
and consistent browser implementations to get these new "acclerated" effects.
37+
and consistent browser implementations to realize these effects.
3938

4039
## Goal
4140

@@ -47,7 +46,7 @@ Address at least [this](https://github.com/w3c/css-houdini-drafts/blob/master/co
4746
- Introduce CompositorWorker whose global scope exposes requestAnimationFrame
4847
which runs at the rate of threaded scrolling and animation.
4948
- Allow DOM elements to be wrapped in a CompositorProxy which may be sent to a
50-
CompositorWorker and which exposes a limited set of layout-free properties
49+
CompositorWorker and which exposes a limited set of accelerated properties
5150
and input events.
5251

5352
## A tiny, but expressive kernel
@@ -174,12 +173,12 @@ onmessage = function(e) {
174173
### Are we marrying ourselves to implementation details?
175174

176175
In particular, two worries are
177-
1. The subset of layout-free properties we expose to a CompositorWorker won't be valid in the future.
176+
1. The subset of accelerated properties we expose to a CompositorWorker won't be valid in the future.
178177
2. We expose browser internals in such a way that it constrains future development.
179178

180179
To the first point, virtually all user agents support accelerated opacity and transform animations, as well as threaded scrolling. Since the web relies on the performance characteristics of these properties, it's very unlikely that they will become slow. So the real concern is the ability to add new properties. As long as we choose an extensible API shape that permits simple feature detection, adding support for more properties in the future will be possible.
181180

182-
To the second point, we need not mention browser internals to permit asynchronous updates of layout-free properties. The examples above don’t, for example, tie us to the idea of a composited layer or a layer tree, concepts that may not be meaningful in all browser implementations. The animated elements might, say, be redrawn by the GPU each frame or processed in software. But this doesn’t matter. These implementation details are orthogonal to the CompositorWorker concept.
181+
To the second point, we need not mention browser internals to permit asynchronous updates of accelerated properties. The examples above don’t, for example, tie us to the idea of a composited layer or a layer tree, concepts that may not be meaningful in all browser implementations. The animated elements might, say, be redrawn by the GPU each frame or processed in software. But this doesn’t matter. These implementation details are orthogonal to the CompositorWorker concept.
183182

184183
### What happens when script runs long?
185184

0 commit comments

Comments
 (0)