Bug 1361663 - Part 2: Add tolerance because we use different ways for interpolation on the main/compositor thread. r=birtles

On the main thread, we use Servo backend, and the type of computed::Length is
|app_units::Au| (i.e. i32).
However, on the compositor thread, we use Gecko backend, and the type of
the length in nsCSSValue is |float|, so there might be some difference.
Use "0.5 / 60" because we round the interpolated result to the nearest
integer, and convert it into an app unit value, so the tolerance could be
this value.

MozReview-Commit-ID: EBceiO7keH1

--HG--
extra : rebase_source : aa4e3ac68fed1bcbdb51d93b403a15b0304c144d
This commit is contained in:
Boris Chiou 2017-05-24 17:07:10 +08:00
Родитель 1b7cc40933
Коммит d897bdc993
2 изменённых файлов: 11 добавлений и 2 удалений

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

@ -403,6 +403,15 @@ const ExpectComparisonTo = {
Fail: 2
};
// FIXME: Bug 1340005: We use |RawServoAnimationValue| on the main thread if
// enabling Servo style backend, and still use |StyleAnimationValue| on the
// compositor thread. |RawServoAnimationValue| rounds the interpolated results
// to a nearest |app_units::Au| (i.e. i32), so we might have a tiny difference
// between the results from getOMTAStyle() and getComputedStyle().
// Note: 1 AU ~= 60 CSS pixel unit.
const isServo = SpecialPowers.getBoolPref('layout.css.servo.enabled');
const toleranceForServoBackend = isServo ? 0.5 / 60.0 : 0.0;
(function() {
window.omta_todo_is = function(elem, property, expected, runningOn, desc,
pseudo) {
@ -505,7 +514,7 @@ const ExpectComparisonTo = {
" - got " + computedStr);
return;
}
okOrTodo(compare(computedValue, actualValue, 0),
okOrTodo(compare(computedValue, actualValue, toleranceForServoBackend),
desc + ": OMTA style and computed style should be equal" +
" - OMTA " + actualStr + ", computed " + computedStr);
}

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

@ -38,7 +38,7 @@ to mochitest command.
* test_media_queries_dynamic_xbl.html: xbl support bug 1290276 [2]
* Animation support:
* OMTA
* test_animations_omta.html: bug 1361938, bug 1361663 [*]
* test_animations_omta.html: bug 1361938, bug 1340005 [*]
* SMIL Animation
* test_restyles_in_smil_animation.html [2]
* CSSOM support: