Skip to content

[css-transforms] Spec doesn't actually define perspective(0), and behavior is crazy anyway #886

@tabatkins

Description

@tabatkins

The definition of perspective(n) creates a 4x4 matrix with a component equal to 1/n. At 0 there's a 1/0 in the formula, so clearly this case isn't actually defined.

Edge and WebKit/Blink treat perspective(0) as perspective(inf) (that is, it's an identity transform). This is discontinuous with perspective(small). Firefox rejects perspective(0) at the grammar level.

In transitions, Blink/WebKit currently transition by converting the perspective(0) into an identity matrix and interpolating that way, so you don't see a discontinuity. This will change when impls match the new spec change (agreed in the f2f) that perspective() animates as a perspective() function; at that point it'll blow up to wacky-distortion and then reset to no distortion at all.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions