Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-easing-1] Extrapolation of easing function #4046

Open
kevers-google opened this issue Jun 20, 2019 · 1 comment
Open

[css-easing-1] Extrapolation of easing function #4046

kevers-google opened this issue Jun 20, 2019 · 1 comment

Comments

@kevers-google
Copy link
Contributor

https://www.w3.org/TR/css-easing-1/#cubic-bezier-algo

For input progress < 0:
Point #2 implies that the tangent line though P0 and P2 should be used in the event that P1_x = 0 and P2_x > 0. This should be further constrained on P1_y = 0. It is only a valid tangent line if P1 and P0 are coincident.

If P0, P1 and P2 are all coincident. The tangent line should be through P0 and P3.

For input progress > 1:
Point #2 implies that the tangent line through P1 and P3 should be used in the event that P2_x = 1 and P1_x < 1. This should be further constrained on P2_y = 1. It is only a valid tangent line if P2 and P3 are coincident.

If P1, P2, and P3 are all coincident. The tangent line should be through P0 and P3.

@flackr
Copy link
Contributor

flackr commented Jun 20, 2019

This means that if P1 = (0, 1), we'll use the line (0, 0) through (0, 1) which has infinite slope as the tangent line. Should this result in an output progress of -Infinity or should we have another special case similar to point 3?

aarongable pushed a commit to chromium/chromium that referenced this issue Jun 21, 2019
The start and end gradient calculations handled one or two coincident
control points, but not three. The test for coincidence of P2 and P3
was not quite correct. The case of 3 coincident control points is not
addressed in the spec, and an issue has been filed.

w3c/csswg-drafts#4046

The algorithm as proposed in the spec is also missing a constraint for
detection of coincident control points.

Bug: 827560
Change-Id: I8b216c8ab32881d6e100d338f4601c30e658bfb6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1670150
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Reviewed-by: Ian Vollick <vollick@chromium.org>
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671411}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants