-
Notifications
You must be signed in to change notification settings - Fork 707
[css-transforms] After #6320 there's no way to get an identity transform for interpolation of perspective #6488
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
Comments
The fact that The "identity" perspective is |
It looks like we already specify (in the Terminology list) that the identity transform function for perspective is Adding |
I guess |
Those absolutely work (per spec), yes, but technically they're not identity since they'll get clamped to the maximum allowed perspective. |
The CSS Working Group just discussed The full IRC log of that discussion<dael> Topic: [css-transforms] After #6320 there's no way to get an identity transform for interpolation of perspective<dael> github: https://github.com//issues/6488 <dael> TabAtkins: Previously we had odd behavior where perspective funt with 0 treated as no perspective. That was null transform. <dael> TabAtkins: A little while back resolved that's weird and silly. perspective of 0 px is your eyes are on he screen and that's different. We clampped to a floor. You can't say 0 anymore <dael> TabAtkins: No we have no way to say no perspective applied. That means infinite. Possibly this can be done with infinity keyword in calc. A bit awk and implies infinite link is stored internally or the max value triggers this <dael> TabAtkins: We probably want an actual preserved value. Proposal is allow perspective to take keyword infinity directly <dael> TabAtkins: That's the no transform, does 0 stuff <dael> astearns: Reasonable to me. Any concerns? <dael> smfr: Do we have that keyword? <dael> florian: How is it different from none <dael> TabAtkins: None is a null transform list. If you need to match 2 lists and want 2nd list to not do anything you cannot write that. You can't put none in the middle of a transform list <dael> TabAtkins: I'm not sure what you mean smfr <dael> smfr: animation iteration takes keyword infinite. Are there other places in CSS where this would be reasonable or is this special <dael> TabAtkins: I think special case b/c any other place where....well...any place where infinity might be meaningful we should have a keyword indicating that behavior rather than fallback to calc constant b/c that is clamped to a numeric value <dael> smfr: What happens when interpolate between infinity and 100 <dael> TabAtkins: Well defined. infinite is identiy matrix. It has to b/c before this perspective 0 was the infinite, it was just the wrong way to write it <florian> q? <dael> astearns: We're over time. I'm guessing we should punt to next week and resolve <dael> smfr: Sounds fine <dael> TabAtkins: Fine |
Simon's question in the call about using An alternative is to avoid the question with |
The CSS Working Group just discussed
The full IRC log of that discussion<fantasai> Topic: identity transforms<fantasai> github: https://github.com//issues/6488 <fantasai> emilio: I wasn't on last week's call <fantasai> emilio: seems fine to add a new value to represent this <fantasai> emilio: ... <smfr> q+ <Rossen_> ack smfr <fantasai> smfr: I'm ok with something like perspective(infinity) <astearns> we ran out of time last week to get to a resolution <fantasai> smfr: I do wonder about the lack of units, wonder if it adds complexity to animations and blending <fantasai> TabAtkins: perspective is normalized to matrix, so shouldn't be a problem <fantasai> TabAtkins: addition with infinity would swamp whatever value the other side was, so don't have to worry in that case either <fantasai> Rossen_: sounds like we're going forward with infinity? <fantasai> astearns: there was also the suggestion of perspective(none) <fantasai> TabAtkins: smfr brought up that animation-iteration-count uses 'infinite' whereas calc() uses 'infinity', so 'none' would dodge the issue <jfkthame> +1 to perspective(none) <fantasai> Rossen_: is everyone ok with none? <fantasai> RESOLVED: Add perspective(none) |
can i ask something? from this document. it said identity transform is |
Just |
I implemented this in Firefox in https://bugzilla.mozilla.org/show_bug.cgi?id=1725207, tests at web-platform-tests/wpt#30141 |
I just double-checked with this test that none of Chromium, Gecko, or WebKit implement |
This adds the ''none'' argument to the ''perspective()'' function, equivalent to infinity. Fixes w3c#6488.
This adds the ''none'' argument to the ''perspective()'' function, equivalent to infinity. Fixes #6488.
This updates the `perspective` property and `perspective()` function to reflect some existing errors (regarding negative values) and some new CSS working group resolutions that have at this point all shipped in Chrome and some of which have shipped in Gecko: * w3c/csswg-drafts#413 resolved that 0 is allowed in both the property and the function, but values of both that are less than 1px are clamped to 1px. * w3c/csswg-drafts#6488 added the `none` value to the perspective() function; it was already a value of the perspective property. It also adds some clarification about what large/small/none values mean.
This updates the `perspective` property and `perspective()` function to reflect some existing errors (regarding negative values) and some new CSS working group resolutions that have at this point all shipped in at least one of Firefox or Chrome (and which I think are all likely to ship in the other soon, and hopefully in Safari as well): * w3c/csswg-drafts#413 resolved that 0 is allowed in both the property and the function, but values of both that are less than 1px are clamped to 1px. * w3c/csswg-drafts#6488 added the `none` value to the perspective() function; it was already a value of the perspective property. It also adds some clarification about what large/small/none values mean.
This is an additional change for #6488, also needed for a followup to w3c/css-houdini-drafts#1051.
This adds support for the none value of the perspective() function of the transform property, and makes corresponding changes to the css-typed-om implementation. The changes to ui/gfx/geometry/ and compositor_transform_operations.cc correspond both to the interpolation changes in this patch and also some that should have been included in https://crrev.com/c/2924023 (to keep the compositor animation behavior matching the blink animation behavior). The added web-platform-tests in css/css-transforms/animation/transform-interpolation-perspective.html css/css-transforms/animation/support/transform-interpolation-reftests.js test for the need for both sets of changes to this code. The spec changes are linked from: w3c/csswg-drafts#6488 w3c/css-houdini-drafts#1051 Fixed: 1253596 Bug: 1205161 Change-Id: I84f4dc509bcfccdac0dde8e42669ac0ac5e2e38c
This updates the `perspective` property and `perspective()` function to reflect some existing errors (regarding negative values) and some new CSS working group resolutions that have at this point all shipped in at least one of Firefox or Chrome (and which I think are all likely to ship in the other soon, and hopefully in Safari as well): * w3c/csswg-drafts#413 resolved that 0 is allowed in both the property and the function, but values of both that are less than 1px are clamped to 1px. * w3c/csswg-drafts#6488 added the `none` value to the perspective() function; it was already a value of the perspective property. It also adds some clarification about what large/small/none values mean.
This adds support for the none value of the perspective() function of the transform property, and makes corresponding changes to the css-typed-om implementation. The changes to ui/gfx/geometry/ and compositor_transform_operations.cc correspond both to the interpolation changes in this patch and also some that should have been included in https://crrev.com/c/2924023 (to keep the compositor animation behavior matching the blink animation behavior). The added web-platform-tests in css/css-transforms/animation/transform-interpolation-perspective.html css/css-transforms/animation/support/transform-interpolation-reftests.js test for the need for both sets of changes to this code. The spec changes are linked from: w3c/csswg-drafts#6488 w3c/css-houdini-drafts#1051 Fixed: 1253596 Bug: 1205161 Change-Id: I84f4dc509bcfccdac0dde8e42669ac0ac5e2e38c
This adds support for the none value of the perspective() function of the transform property, and makes corresponding changes to the css-typed-om implementation. The changes to ui/gfx/geometry/ and compositor_transform_operations.cc correspond both to the interpolation changes in this patch and also some that should have been included in https://crrev.com/c/2924023 (to keep the compositor animation behavior matching the blink animation behavior). The added web-platform-tests in css/css-transforms/animation/transform-interpolation-perspective.html css/css-transforms/animation/support/transform-interpolation-reftests.js test for the need for both sets of changes to this code. The spec changes are linked from: w3c/csswg-drafts#6488 w3c/css-houdini-drafts#1051 Fixed: 1253596 Bug: 1205161 Change-Id: I84f4dc509bcfccdac0dde8e42669ac0ac5e2e38c
This adds support for the none value of the perspective() function of the transform property, and makes corresponding changes to the css-typed-om implementation. The changes to ui/gfx/geometry/ and compositor_transform_operations.cc correspond both to the interpolation changes in this patch and also some that should have been included in https://crrev.com/c/2924023 (to keep the compositor animation behavior matching the blink animation behavior). The added web-platform-tests in css/css-transforms/animation/transform-interpolation-perspective.html css/css-transforms/animation/support/transform-interpolation-reftests.js test for the need for both sets of changes to this code. The spec changes are linked from: w3c/csswg-drafts#6488 w3c/css-houdini-drafts#1051 Fixed: 1253596 Bug: 1205161 Change-Id: I84f4dc509bcfccdac0dde8e42669ac0ac5e2e38c
…9653) This updates the `perspective` property and `perspective()` function to reflect some existing errors (regarding negative values) and some new CSS working group resolutions that have at this point all shipped in at least one of Firefox or Chrome (and which I think are all likely to ship in the other soon, and hopefully in Safari as well): * w3c/csswg-drafts#413 resolved that 0 is allowed in both the property and the function, but values of both that are less than 1px are clamped to 1px. * w3c/csswg-drafts#6488 added the `none` value to the perspective() function; it was already a value of the perspective property. It also adds some clarification about what large/small/none values mean.
This adds support for the none value of the perspective() function of the transform property, and makes corresponding changes to the css-typed-om implementation. The changes to ui/gfx/geometry/ and compositor_transform_operations.cc correspond both to the interpolation changes in this patch and also some that should have been included in https://crrev.com/c/2924023 (to keep the compositor animation behavior matching the blink animation behavior). The added web-platform-tests in css/css-transforms/animation/transform-interpolation-perspective.html css/css-transforms/animation/support/transform-interpolation-reftests.js test for the need for both sets of changes to this code. The spec changes are linked from: w3c/csswg-drafts#6488 w3c/css-houdini-drafts#1051 Fixed: 1253596 Bug: 1205161 Change-Id: I84f4dc509bcfccdac0dde8e42669ac0ac5e2e38c
This adds support for the none value of the perspective() function of the transform property, and makes corresponding changes to the css-typed-om implementation. The changes to ui/gfx/geometry/ and compositor_transform_operations.cc correspond both to the interpolation changes in this patch and also some that should have been included in https://crrev.com/c/2924023 (to keep the compositor animation behavior matching the blink animation behavior). The added web-platform-tests in css/css-transforms/animation/transform-interpolation-perspective.html css/css-transforms/animation/support/transform-interpolation-reftests.js test for the need for both sets of changes to this code. The spec changes are linked from: w3c/csswg-drafts#6488 w3c/css-houdini-drafts#1051 Fixed: 1253596 Bug: 1205161 Change-Id: I84f4dc509bcfccdac0dde8e42669ac0ac5e2e38c
This adds support for the none value of the perspective() function of the transform property, and makes corresponding changes to the css-typed-om implementation. The changes to ui/gfx/geometry/ and compositor_transform_operations.cc correspond both to the interpolation changes in this patch and also some that should have been included in https://crrev.com/c/2924023 (to keep the compositor animation behavior matching the blink animation behavior). The added web-platform-tests in css/css-transforms/animation/transform-interpolation-perspective.html css/css-transforms/animation/support/transform-interpolation-reftests.js test for the need for both sets of changes to this code. The spec changes are linked from: w3c/csswg-drafts#6488 w3c/css-houdini-drafts#1051 Fixed: 1253596 Bug: 1205161 Change-Id: I84f4dc509bcfccdac0dde8e42669ac0ac5e2e38c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3202491 Reviewed-by: danakj <danakj@chromium.org> Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Reviewed-by: Kevin Ellis <kevers@chromium.org> Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#932253}
This adds support for the none value of the perspective() function of the transform property, and makes corresponding changes to the css-typed-om implementation. The changes to ui/gfx/geometry/ and compositor_transform_operations.cc correspond both to the interpolation changes in this patch and also some that should have been included in https://crrev.com/c/2924023 (to keep the compositor animation behavior matching the blink animation behavior). The added web-platform-tests in css/css-transforms/animation/transform-interpolation-perspective.html css/css-transforms/animation/support/transform-interpolation-reftests.js test for the need for both sets of changes to this code. The spec changes are linked from: w3c/csswg-drafts#6488 w3c/css-houdini-drafts#1051 Fixed: 1253596 Bug: 1205161 Change-Id: I84f4dc509bcfccdac0dde8e42669ac0ac5e2e38c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3202491 Reviewed-by: danakj <danakj@chromium.org> Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Reviewed-by: Kevin Ellis <kevers@chromium.org> Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#932253}
This adds support for the none value of the perspective() function of the transform property, and makes corresponding changes to the css-typed-om implementation. The changes to ui/gfx/geometry/ and compositor_transform_operations.cc correspond both to the interpolation changes in this patch and also some that should have been included in https://crrev.com/c/2924023 (to keep the compositor animation behavior matching the blink animation behavior). The added web-platform-tests in css/css-transforms/animation/transform-interpolation-perspective.html css/css-transforms/animation/support/transform-interpolation-reftests.js test for the need for both sets of changes to this code. The spec changes are linked from: w3c/csswg-drafts#6488 w3c/css-houdini-drafts#1051 Fixed: 1253596 Bug: 1205161 Change-Id: I84f4dc509bcfccdac0dde8e42669ac0ac5e2e38c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3202491 Reviewed-by: danakj <danakj@chromium.org> Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Reviewed-by: Kevin Ellis <kevers@chromium.org> Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#932253}
This reverts commit ae6f9bdb7e14b19650ee21cba03418ed35f1a2f5. Reason for revert: crbug.com/1260891 Original change's description: > Add support for perspective(none) transform function. > > This adds support for the none value of the perspective() function of > the transform property, and makes corresponding changes to the > css-typed-om implementation. > > The changes to ui/gfx/geometry/ and compositor_transform_operations.cc > correspond both to the interpolation changes in this patch and also some > that should have been included in https://crrev.com/c/2924023 (to keep > the compositor animation behavior matching the blink animation > behavior). The added web-platform-tests in > css/css-transforms/animation/transform-interpolation-perspective.html > css/css-transforms/animation/support/transform-interpolation-reftests.js > test for the need for both sets of changes to this code. > > The spec changes are linked from: > w3c/csswg-drafts#6488 > w3c/css-houdini-drafts#1051 > > Fixed: 1253596 > Bug: 1205161 > Change-Id: I84f4dc509bcfccdac0dde8e42669ac0ac5e2e38c > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3202491 > Reviewed-by: danakj <danakj@chromium.org> > Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> > Reviewed-by: Kevin Ellis <kevers@chromium.org> > Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> > Commit-Queue: David Baron <dbaron@chromium.org> > Cr-Commit-Position: refs/heads/main@{#932253} Bug: 1205161 Change-Id: Idb9332196c09ee6e4ff57f740419531465ef0148
…orm function., a=testonly Automatic update from web-platform-tests Add support for perspective(none) transform function. This adds support for the none value of the perspective() function of the transform property, and makes corresponding changes to the css-typed-om implementation. The changes to ui/gfx/geometry/ and compositor_transform_operations.cc correspond both to the interpolation changes in this patch and also some that should have been included in https://crrev.com/c/2924023 (to keep the compositor animation behavior matching the blink animation behavior). The added web-platform-tests in css/css-transforms/animation/transform-interpolation-perspective.html css/css-transforms/animation/support/transform-interpolation-reftests.js test for the need for both sets of changes to this code. The spec changes are linked from: w3c/csswg-drafts#6488 w3c/css-houdini-drafts#1051 Fixed: 1253596 Bug: 1205161 Change-Id: I84f4dc509bcfccdac0dde8e42669ac0ac5e2e38c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3202491 Reviewed-by: danakj <danakj@chromium.org> Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Reviewed-by: Kevin Ellis <kevers@chromium.org> Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#932253} -- wpt-commits: 58a3fe3ce41a3eb164966c744baccd4ce459f07c wpt-pr: 31158
…orm function., a=testonly Automatic update from web-platform-tests Add support for perspective(none) transform function. This adds support for the none value of the perspective() function of the transform property, and makes corresponding changes to the css-typed-om implementation. The changes to ui/gfx/geometry/ and compositor_transform_operations.cc correspond both to the interpolation changes in this patch and also some that should have been included in https://crrev.com/c/2924023 (to keep the compositor animation behavior matching the blink animation behavior). The added web-platform-tests in css/css-transforms/animation/transform-interpolation-perspective.html css/css-transforms/animation/support/transform-interpolation-reftests.js test for the need for both sets of changes to this code. The spec changes are linked from: w3c/csswg-drafts#6488 w3c/css-houdini-drafts#1051 Fixed: 1253596 Bug: 1205161 Change-Id: I84f4dc509bcfccdac0dde8e42669ac0ac5e2e38c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3202491 Reviewed-by: danakj <danakj@chromium.org> Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Reviewed-by: Kevin Ellis <kevers@chromium.org> Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#932253} -- wpt-commits: 58a3fe3ce41a3eb164966c744baccd4ce459f07c wpt-pr: 31158
This adds support for the none value of the perspective() function of the transform property, and makes corresponding changes to the css-typed-om implementation. The changes to ui/gfx/geometry/ and compositor_transform_operations.cc correspond both to the interpolation changes in this patch and also some that should have been included in https://crrev.com/c/2924023 (to keep the compositor animation behavior matching the blink animation behavior). The added web-platform-tests in css/css-transforms/animation/transform-interpolation-perspective.html css/css-transforms/animation/support/transform-interpolation-reftests.js test for the need for both sets of changes to this code. The spec changes are linked from: w3c/csswg-drafts#6488 w3c/css-houdini-drafts#1051 Fixed: 1253596 Bug: 1205161 Change-Id: I84f4dc509bcfccdac0dde8e42669ac0ac5e2e38c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3202491 Reviewed-by: danakj <danakj@chromium.org> Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Reviewed-by: Kevin Ellis <kevers@chromium.org> Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#932253}
In #6320 we resolved that we should clamp perspective values to
1px
at least for interpolation. That causes some interesting behavior though.Consider this testcase:
In Chrome, and in old versions of Firefox (and Firefox after this bug is resolved), that causes a smooth animation because
transform: none
uses the identity transform.In release versions of chrome and older versions of Firefox,
.animation { transform: perspective(0) translateZ(0) }
was a no-op in the above test-case, but after #6320perspective(0)
isperspective(1px)
, and that's a fairly drastic behavior change. In fact, there's no way an author can get an identity transform intoperspective()
other than by not specifyingtransform
at all, which seems unfortunate / wrong.cc @dbaron @mattwoodrow
The text was updated successfully, but these errors were encountered: