Closed Bug 1723266 Opened 1 year ago Closed 1 year ago

transform perspective 0 not render correctly

Categories

(Core :: Web Painting, defect)

Firefox 92
defect

Tracking

()

RESOLVED FIXED
93 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox-esr91 --- fixed
firefox90 --- unaffected
firefox91 --- fixed
firefox92 --- fixed
firefox93 --- fixed

People

(Reporter: mix5003, Assigned: mattwoodrow)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files, 2 obsolete files)

Attached image bug_css.png

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0
Firefox for Android

Steps to reproduce:

  1. go to https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/perspective()
  2. click transform: perspective(0);

Actual results:

it not transform correctly

Expected results:

it should render correctly

i try to use mozregression and i think it relate to "Bug 1717161 - Clamp perspective() values to a minimum of 1px. r=emilio"
Differential Revision: https://phabricator.services.mozilla.com/D118250

that change may make some animation error.

please try

  1. go to https://jsfiddle.net/zasf7u1L/
  2. mouse hover on "Test Animation" and compare to other browser or Firefox 90.0.2
Component: Untriaged → Web Painting
Keywords: regression
Product: Firefox → Core
Regressed by: 1717161
Has Regression Range: --- → yes
Assignee: nobody → matt.woodrow

I think the behaviour for perspective(0) is correct, and matches Chrome Canary.

The animation seems pretty broken, and the attached patch fixes it.

This should do the same as D121496, but should be simpler, and the
animated zero value isn't observable to content so should be fine.

That said, it seems fairly unfortunate that there's no way to obtain
the identity behavior by specifying the transform property. That means
that after the clamping of perspective values, there's no way to get
the animation we want along with another transform animation with a
start value, which seems wrong...

I filed https://github.com/w3c/csswg-drafts/issues/6488 to discuss a bit because I think authors not being able to get the identity behavior with other transforms seems really unfortunate.

Set release status flags based on info from the regressing bug 1717161

Attachment #9234191 - Attachment is obsolete: true
Attachment #9234226 - Attachment description: Bug 1723266 - Return a negative length in TransformOperation::Perspective::to_animated_zero. r=mattwoodrow → Bug 1723266 - Return an infinite perspective in TransformOperation::Perspective::to_animated_zero. r=mattwoodrow
Duplicate of this bug: 1722558

(In reply to Ryan VanderMeulen [:RyanVM] from comment #8)

Bug 1717161 was backed out from Fx91.

And Fx92.

Pushed by mwoodrow@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/21e4ad4c8599
Return an infinite perspective in TransformOperation::Perspective::to_animated_zero. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/30095 for changes under testing/web-platform/tests
Upstream PR was closed without merging

Boris, do you have an idea what the right behaviour for squared distance is here?

The spec has been clarified a bit so that no perspective is interpreted as infinity (which is the identity matrix), but I'm not sure if infinity is a useful value for the distance.

Flags: needinfo?(matt.woodrow) → needinfo?(boris.chiou)

(In reply to Matt Woodrow (:mattwoodrow) from comment #16)

Boris, do you have an idea what the right behaviour for squared distance is here?

The spec has been clarified a bit so that no perspective is interpreted as infinity (which is the identity matrix), but I'm not sure if infinity is a useful value for the distance.

So now perspective(none) is identity matrix, and it's "d" is float max. That's fine to use the float max for distance I think. Feel free to update this test case. The other places which use the distance are test_transitions_per_property.html and devtools. test_transitions_per_property.html doesn't use none, and the devtools should use the values we are using to render, so I think using infinity is ok to me.

Flags: needinfo?(boris.chiou)
Pushed by mwoodrow@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7a956cddebbf
Return an infinite perspective in TransformOperation::Perspective::to_animated_zero. r=emilio
Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch
Upstream PR merged by moz-wptsync-bot
Flags: in-testsuite+
Attached image perspective.png

that animation bug now fix.

but i just want to let you known that transform: perspective(0); in Chrome and Firefox still render differently i am not sure who is correct.

Flags: needinfo?(matt.woodrow)

That looks like a rendering bug in Chrome to me, not sure why it has the white bands in it.

Flags: needinfo?(matt.woodrow)
Attachment #9234226 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.