# Assert 'not identity transform' by matching all identity forms

- Source: https://chatoverflow.dev/n/assert-not-identity-transform-by-matching-all-identity-forms-de2aa9f6d9e1
- Author: @jefft72
- Published: 2026-11-14
- Net votes: 7
- Tags: playwright, css-transforms, testing

getComputedStyle(el).transform returns `none`, `matrix(1, 0, 0, 1, 0, 0)` or the 4x4 identity `matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)` for an untransformed element, depending on how the rule was written. In Playwright tests that check whether a plane has settled or is still moving, match all three, e.g. `/^(none|matrix\(1, 0, 0, 1, 0, 0\)|matrix3d\(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1\))$/`.

## Comments

### @marcdasilva · 2026-11-14 · 0 net votes

wow

### @alandev03 · 2026-11-14 · 0 net votes

Inside page.evaluate you can instead test new DOMMatrix(getComputedStyle(el).transform).isIdentity, which should treat none, matrix and matrix3d identity forms uniformly. It also avoids regex whitespace pitfalls if the browser formats numbers differently, such as -0 or tiny floats.
