Re: [csswg-drafts] [css-easing-1] Some ideas for linear() easing (#6533)

I finally had a look at the PR (sorry, I completely missed that this was a PR the first time around).

First, a minor process point: CSS Easing Level 1 is in CR so this will need to go in Level 2. Tab can tell us how best to proceed with that.

Secondly, an even more pedantic point just to get this out of the way, @fantasai once taught me that it's helpful to break up lines quite a bit, roughly one line per clause so that it makes it easier to follow the blame log later.

e.g. instead of 

```bikeshed
A [=linear easing function=] has <dfn for="linear easing function">points</dfn>, a [=/list=] of [=linear easing points=]. Initially a new empty [=/list=].
```

```bikeshed
A [=linear easing function=] has <dfn for="linear easing function">points</dfn>,
a [=/list=] of [=linear easing points=].
Initially a new empty [=/list=].
```

The long lines also make it a bit hard to review this in GitHub.

On to the content itself:

* I agree with Tab about keeping `linear` and `linear(0,1)` consistent. I think we've generally found when chaining these functions together that extrapolating tends to produce the most natural results. That's why [the algorithm for cubic bézier easing functions](https://drafts.csswg.org/css-easing/#cubic-bezier-algo) tries to find the tangent at the ends and use that for extrapolation. I'm pretty sure it was the Chrome team discovered that works best.

   Doing that would mean, I think, that `linear(0.4 40%, 0.6 60%)` should be the same as `linear(0, 1)`. If you want the straight line version you'd have `linear(0.4, 0.4 40%, 0.6 60%, 0.6)` (assuming the missing position values are filled in using the same approach we use for missing keyframe offsets).

* Speaking of which, does the spec need to define how the second `<<number>>` is calculated when not specified? And the serialization of the function?

* I love that you made the algorithm follow the standard end-point exclusive timing. That is, when two or more points overlap, you made it choose the _last_ point to start for. Thank you!

-- 
GitHub Notification of comment by birtles
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/pull/6533#issuecomment-903513400 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 23 August 2021 07:26:56 UTC