Bug 1468294 - Double f64::EPSILON for calculation error. r=birtles

It's possible that both this_weight and other_weght have calculation errors
which are approximately equal to f64::EPSILON.

MozReview-Commit-ID: 8OddG9rI3qd

--HG--
extra : rebase_source : 9c22d17dcfb8efea7276864502344dc4981c358a
This commit is contained in:
Hiroyuki Ikezoe 2018-06-13 06:42:14 +09:00
Родитель 1ecfce2746
Коммит 7cd41518c9
3 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -0,0 +1,7 @@
<script>
addEventListener("DOMContentLoaded", () => {
document.documentElement.animate([{ "transform": "matrix(2,1,1,5,2,8)" }],
{ duration: 1000,
easing: "cubic-bezier(1,-15,.6,4)" });
})
</script>

Просмотреть файл

@ -40,3 +40,4 @@ pref(dom.animations-api.core.enabled,true) load 1393605-1.html
load 1400022-1.html
pref(dom.animations-api.core.enabled,true) load 1401809.html
pref(dom.animations-api.core.enabled,true) load 1411318-1.html
load 1468294-1.html

Просмотреть файл

@ -1739,7 +1739,9 @@ impl Animate for Quaternion {
let (this_weight, other_weight) = procedure.weights();
debug_assert!(
(this_weight + other_weight - 1.0f64).abs() <= f64::EPSILON ||
// Doule EPSILON since both this_weight and other_weght have calculation errors
// which are approximately equal to EPSILON.
(this_weight + other_weight - 1.0f64).abs() <= f64::EPSILON * 2.0 ||
other_weight == 1.0f64 || other_weight == 0.0f64,
"animate should only be used for interpolating or accumulating transforms"
);