Summary
Prevent active transform CSS transitions from affecting the temporary transform probe used to normalize percentage translate components.
Rationale
probeTranslateMatrix in src/core/normalizer/rules/translate-percentage.ts temporarily assigns transform and reads getComputedStyle(el).transform. If the element has a non-zero transition for transform, the browser can return an interpolated matrix. This can convert a percentage component to an incorrect pixel value.
Required changes
- In
src/core/normalizer/rules/translate-percentage.ts, temporarily disable the transform transition while probeTranslateMatrix sets and reads the temporary transform.
- Restore the original inline transition value and priority in the existing
finally block.
- Preserve the existing restoration behavior for the inline
transform value and priority.
- Add a regression test in the normalizer test suite. The test must use a non-zero
transform transition and confirm that normalization uses the un-interpolated transform matrix.
Affected area
src/core/normalizer/rules/translate-percentage.ts
test/core/normalizer.test.ts
Backlinks
Summary
Prevent active
transformCSS transitions from affecting the temporary transform probe used to normalize percentagetranslatecomponents.Rationale
probeTranslateMatrixinsrc/core/normalizer/rules/translate-percentage.tstemporarily assignstransformand readsgetComputedStyle(el).transform. If the element has a non-zerotransitionfortransform, the browser can return an interpolated matrix. This can convert a percentage component to an incorrect pixel value.Required changes
src/core/normalizer/rules/translate-percentage.ts, temporarily disable thetransformtransition whileprobeTranslateMatrixsets and reads the temporary transform.finallyblock.transformvalue and priority.transformtransition and confirm that normalization uses the un-interpolated transform matrix.Affected area
src/core/normalizer/rules/translate-percentage.tstest/core/normalizer.test.tsBacklinks