Bug 964646 part 6 - Add OMTA tests for timing functions on keyframes; r=dbaron

This patch converts the tests in test_animations.html under the heading,
"css3-animations:  3.1. Timing functions for keyframes" to an equivalent version
for testing animations that run on the compositor thread.
Bug 964646 part 7 - Handle NaN values when comparing matrices; r=dbaron

The test harness code for normalizing transform inputs to a standard form for
comparison fails to detect the case where the input is a string such as

 { tx: "20px" }

instead of:

 { tx: 20 }

When we go to compare matrix components we fail if:

  Math.abs(a.comp - b.comp) > tolerance

But if a.comp or b.comp is a string, we'll get NaN on the LHS and
"NaN > tolerance" will return false so we'll skip the failure handling and
continue onto the next component. That means if we have input { tx: "30px" } and
we get "20" as the x-translation component we'll pass the test.

This patch fixes this condition to check for isNaN.

We *could* also just drop a few .map(parseFloat) calls into
convertObjectTo3dMatrix and convertArrayTo3dMatrix to ensure "20px" becomes 20
but there may be situations where that masks bugs (since "20px" and "20em" turn
into the same thing) so for now this minimal fix should be enough.
Bug 964646 part 8 - Add OMTA tests for animation-name; r=dbaron

This patch adds a version of the tests in test_animations.html under the
heading, "css3-animations:  3.2. The 'animation-name' Property" that tests the
same features when animations are running on the compositor thread.
Bug 964646 part 9 - Add OMTA tests for animation-iteration-count; r=dbaron

This patch adds a version of tests in test_animations.html under the heading,
"css3-animation: 3.5 The 'animation-iteration-count' Property" for animations
that run on the compositor thread.

These tests surface an issue where in some cases precision errors lead to
discrepencies between the OMTA style and computed style. This is fixed in
a subsequent patch in this series.
Bug 964646 part 10 - Fix floating point precision issues when comparing matrices; r=dbaron

This patch addresses and issue where the OMTA style and computed style were not
comparing equal in one particular case.

In this case AddTransformTranslate in nsStyleAnimation would give us
a translate-y value of 94.331673 in both cases (i.e. when calculating the
animated value on the compositor thread or when fetching computed style).

For the OMTA case, however, after we apply additional layer transformations and
then reverse them (so we can query the CSS value) we'd end up with 94.331642,
a difference of 0.000031. The reversing procedure is only used for testing so
the actual error introduced here by the additional layer transformations is
probably less.

Unfortunately, when we pass 94.331642 this along to MatrixToCSSValue we get back
matrix(1, 0, 0, 1, 94.3316) since it only outputs 6 digits of precision.

On the other hand, on the computed style end we'd pass 94.331673 to
MatrixToCSSValue which gives us matrix(1, 0, 0, 1, 94.3317), so the error swells
from 0.000031 to 0.0001.

Then when we subtract 94.3316 from 94.3317 in Javascript we get
0.00010000000000331966 due to floating-point precision issues which compares
greater than the default tolerance of 0.0001.

This patch simply adjusts the default tolerance to 0.00011 to accommodate
these floating-point differences.
Bug 964646 part 11 - Add OMTA tests for animation-direction; r=dbaron

This patch adds a version of tests in test_animations.html under the heading,
"css3-animation: 3.6 The 'animation-direction' Property, for animations
that run on the compositor thread.
Bug 964646 part 12 - Add OMTA tests for animation-play-state; r=dbaron

This patch adds a version of tests in test_animations.html under the heading,
"css3-animation: 3.7 The 'animation-play-state' Property", for animations
that run on the compositor thread.
Bug 964646 part 13 - Add OMTA tests for animation-delay; r=dbaron

This patch adds a version of tests in test_animations.html under the heading,
"css3-animation: 3.8 The 'animation-delay' Property", for animations
that run on the compositor thread.
Bug 964646 part 14 - Add OMTA tests for multi-property animations; r=dbaron

This patch adds a version of tests in test_animations.html for keyframe
animations with multiple properties where some properties are present in only
some keyframes. The version here, however, tests animations that run on the
compositor thread.
Bug 964646 part 15 - Add OMTA tests for sampling animations with same timestamp; r=dbaron

This patch adds a version of tests in test_animations.html for bug 651456 which
covers multiple samples with the same timestamp. The version here, however,
tests animations that run on the compositor thread.
Bug 964646 part 16 - Add OMTA tests for !important rules and animations; r=dbaron

This patch adds tests for the handling of author !important rules and animations
based on similar tests in test_animations.html but for animations that run on
the compositor thread.

Due to bug 847287, these tests don't pass and are partly disabled. Subsequent
patches add todo_is tests for this.
Bug 964646 part 17 - Add RunningOn.TodoMainThread for marking animations that are known to run on the compositor when they should not; r=dbaron

This patch also ensures that when we have an animation running on the compositor
when it should not that we still compare the values produced on the compositor
and on the main thread so that the visual result is correct even if the
performance characteristics are not.
Bug 964646 part 18 - Add omta_todo_is for marking OMTA animations that are known to fail; r=dbaron

The implementation here current expects BOTH the following to fail:

- The comparison between the OMTA value and the expected value
- The comparison between the OMTA value and the computed value

This generally tends to be the case since the computed value and expected value
normally match unless we have a bug that affects all CSS animations. If we need
to mark tests where the computed value is also wrong we'll need to modify the
behavior here at that time.

This patch also applies this new function to the author !important test that was
previously commented-out because it currently fails.
Bug 964646 part 19 - Add OMTA tests for restyling interaction; r=dbaron

This patch adds tests for the interaction of animation and restyling (Bug
686656) based on those in test_animations.html but for animations that run on
the compositor thread.
Bug 964646 part 20 - Add OMTA tests for cascading between keyframe rules; r=dbaron

This patch adds tests for the cascanding of keyframes rules based on those in
test_animations.html but for animations that run on the compositor thread.
Bug 964646 part 21 - Add OMTA tests for animation list lengths and dynamic style rule changes; r=dbaron

This patch adds tests for triggering animations based on the length of the
animation-name property as well as tests for dynamic changes to style rules.
These tests are based on tests in test_animations.html but for directed at
animations that run on the compositor thread.