Commit 6b36d41
committed
[css-transforms-2] Fix the check for product == 1.0 to include the case when product is -1
This occurs in the following code:
```
if (product == 1.0)
quaternionDst = quaternionA
return
theta = acos(dot)
w = sin(t * theta) * 1 / sqrt(1 - product * product)
```
If `product` is -1.0 we'll end up doing division by zero when we
calculate `w`.
WebKit works around this by inverting the angle (effectively doing the
same thing as taking the absolute value):
https://github.com/WebKit/webkit/blob/425f9748af04b2c7e235cf3ff9396eecc23c0af5/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp#L542-L548
Chromium takes the absolute value like this patch does:
https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/transforms/transformation_matrix.cc?l=762&rcl=cd5181ecb173efdef4163f066c27bd136fca01d51 parent 6100c15 commit 6b36d41
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1009 | 1009 | | |
1010 | 1010 | | |
1011 | 1011 | | |
1012 | | - | |
| 1012 | + | |
1013 | 1013 | | |
1014 | 1014 | | |
1015 | 1015 | | |
| |||
0 commit comments