Commit Graph

3999 Commits

Author SHA1 Message Date
Phil Ringnalda
61966eed95 Merge f-t to m-c 2014-05-31 20:31:07 -07:00
Victor Porof
5643294005 Bug 1007203 - Always add categories when pushing to the pseudostack, r=djvj 2014-05-23 17:12:29 -04:00
Ms2ger
af6c726c7d Merge mozilla-inbound to mozilla-central. 2014-05-30 14:07:35 +02:00
Xidorn Quan
cb1efcb979 Bug 1013160 - Remove padding suppressing mechanism of bullet. r=jfkthame,surkov 2014-05-30 09:00:26 +01:00
Ms2ger
7a49550ced Bug 741295 - Treat 'id' and 'class' as global attributes for all elements; r=bz 2014-05-30 09:36:53 +02:00
Ms2ger
9e3df726f9 Bug 995780 - Remove CSSStyleSheet classinfo; r=bz 2014-05-30 09:36:51 +02:00
Brian Birtles
e8769df41b Bug 1007513 - Make AnimationEvent.elapsedTime report the actual time the animation has been running; r=dholbert
This patch implements the behavior proposed in:

  http://lists.w3.org/Archives/Public/www-style/2014May/0356.html
2014-05-30 09:45:39 +09:00
L. David Baron
2de5593d67 Bug 989802 - Round viewport units to appunits using trunc rather than round so that repeated uses fit within a container. r=roc
viewport-units-rounding-1.html fails without the patch and passes with
the patch.

viewport-units-rounding-2.html fails with an early version of the patch
but not without the patch or with the final version.
2014-05-29 17:43:06 -07:00
Brian Birtles
d48a8e62e9 Bug 1004361 - Dispatch animationstart events as well when skipping entire animation intervals; r=dholbert 2014-05-28 16:51:50 +09:00
Brian Birtles
4af2cc49f7 Bug 1004871 part 11 - Move ElementAnimation members closer together for readability and packing; r=dholbert
Also shuffle the initialization of members in
nsAnimationManager::BuildAnimations to roughly match the order in which they
are declared (with the exception that mPlayState needs to be set before calling
IsPaused() which is used to set mPauseStart).
2014-05-28 16:51:50 +09:00
Brian Birtles
5a990f0766 Bug 1004871 part 10 - Stop passing a fill mode of "both" to GetComputedTimingAt for throttled samples; r=dholbert
This was only needed when we were inspecting the returned time fraction but now
that we inspect the phase it's not necessary to force the fill mode to "both".
2014-05-28 16:51:50 +09:00
Brian Birtles
510ffce362 Bug 1004871 part 9 - Move ElementAnimations::GetPositionInIteration to ElementAnimation::GetComputedTimingAt; r=dholbert
This patch simply moves the code from ElementAnimations to ElementAnimation so
that it can later be used in transitions code and so we can later move
EnsureStyleRuleFor to ElementAnimation.
2014-05-28 16:51:50 +09:00
Brian Birtles
88b33826c4 Bug 1004871 part 8 - Simplify ElementAnimations::GetEventsAt; r=dholbert
This patch shuffles the code in ElementAnimations::GetEventsAt to make it easier
to follow.

It also removes a check for whether or not the animation is paused.
Previously we would not dispatch events if the animation was paused and in its
active phase (but we would if the animation had finished). There doesn't seem to
be any reason for this. If the animation was paused between the last sample and
the current sample and the boundary of an iteration also occurred in that time
then I expect we should dispatch that event. Removing this check for the pause
state does not cause any tests fail.

Separating out the event logic here makes it clear that we do not dispatch start
events in the situation where one sample falls before the active interval and
one sample falls after it (filed as bug 1004361). This patch adds a comment to
this effect.
2014-05-28 16:51:49 +09:00
Brian Birtles
68e07b4a10 Bug 1004871 part 7 - Remove event queueing from GetPositionInIteration and do it in GetEventsAt; r=dholbert
This patch simply shifts the event-related code from GetPositionInIteration to
GetEventsAt. Although there are simplifications that could be done to
GetEventsAt, they are deferred to a subsequent patch so as not to obscure the
translation of code from one function to another.

As a result of moving event-related handling from GetPositionInIteration it no
longer needs to support different main-thread vs compositor modes.
2014-05-28 16:51:49 +09:00
Brian Birtles
f9a1779d4d Bug 1004871 part 6 - Make GetPositionInIteration return a ComputedTiming object; r=dholbert
This patch makes ElementAnimations::GetPositionInIteration return
a ComputedTiming object instead of just a time portion (time fraction).

Since the ComputedTiming object includes phase information, we can fix those
parts of EnsureStyleRule and GetEventsAt that were temporarily using the time
portion to guess if the animation might have finished or not.
2014-05-28 16:51:49 +09:00
Brian Birtles
5de24213a8 Bug 1004871 part 5 - Add ComputedTiming data structure; r=dholbert
This patch adds a ComputedTiming struct for storing the results of calculating
the timing properties of an animation at a given sample time.
2014-05-28 16:51:49 +09:00
Brian Birtles
5823fef61b Bug 1004871 part 4 - Move FillsForwards/FillsBackwards to AnimationTiming; r=dholbert
This patch moves the FillsForwards/FillsBackwards methods previously defined on
ElementAnimations to the structure contain the fill mode: AnimationTiming. It
also changes GetPositionInIteration to use these methods.
2014-05-28 16:51:49 +09:00
Brian Birtles
ae4fac1710 Bug 1004871 part 3 - Replace parameters to GetPositionInIteration with an AnimationTiming object; r=dholbert
This patch makes use of the AnimationTiming struct introduced in the previous
patch to simplify calls to ElementAnimations::GetPositionInIteration.
2014-05-28 16:51:49 +09:00
Brian Birtles
f22f27e127 Bug 1004871 part 2 - Add AnimationTiming struct, to encapsulate animation timing parameters; r=dholbert
Introduces a struct to store timing parameters for passing to
GetPositionInIteration. In future this struct is expected to be expanded to
include other timing parameters as well (based roughly on Web Animations'
"Timing" interface, hence the name AnimationTiming).
2014-05-28 16:51:49 +09:00
Brian Birtles
2fe00ba5c9 Bug 1004871 part 1 - Factor event queuing out of EnsureStyleRuleFor; r=dholbert
This patch moves event queuing out of EnsureStyleRuleFor into a separate method.
This is a preparatory step towards making GetPositionInIteration into a more
generic method for calculating the current time fraction.

In order to achieve this, GetPositionInIteration needs to be able to calculate
the correct time portion for times outside the range [0, 1] even when it is not
passed a ElementAnimation object. Specifically, it needs the fill mode of the
animation to be passed in.

(Rather than using FillForwards/FillBackwards this patch just compares the
NS_STYLE_ANIMATION_FILL_MODE_* values directly but FillForwards/FillBackwards
are restored in a subsequent patch when they are added to the struct used to
lump the timing parameters together.)

There are a number of places where positionInIteration is used to determine if
the current sample occurs in the active phase or after. This is sub-optimal but
is fixed in a subsequent patch in this series.

The actual work of removing event queuing from GetPositionInIteration is
deferred to a subsequent patch in order to keep the changes as small as
possible. This patch simply makes separate calls to GetPositionInIteration for
interpolating and for event queuing.
2014-05-28 16:51:48 +09:00
Neil Rashbrook
9cfd58c16f Bug 869836 - Part 9a: Use AssignLiteral(MOZ_UTF16(...)) instead of Assign(NS_LITERAL_STRING(...)). r=ehsan
Relading with correct bug number so DONTBUILD.

--HG--
extra : amend_source : 6e05de7729c27761564124212b7d4cbe3318e482
2014-05-26 21:54:10 +03:00
Birunthan Mohanathas
f3421c776b Backout 8b8bbe7aa1cc due to wrong bug number 2014-05-27 14:42:13 +03:00
Birunthan Mohanathas
562904c002 Bug 869836 - Part 12: Use Assign('c') instead of AssignLiteral("c"). r=ehsan
--HG--
extra : rebase_source : a6b15019cee452973dd8bf3112c15e14175855a9
2014-05-26 21:55:08 +03:00
Neil Rashbrook
12b4869c02 Bug 995730 - Part 9a: Use AssignLiteral(MOZ_UTF16(...)) instead of Assign(NS_LITERAL_STRING(...)). r=ehsan
--HG--
extra : rebase_source : d2d3d611c06a2a7ec930fb11576d7c8335c0a6e2
2014-05-26 21:54:10 +03:00
Jonathan Watt
2783feef5b No bug - Add a comment to nsStyleSet::SizeOfIncludingThis noting that it does _not_ count the size of the sheets in mSheets, only the size of the mSheets buffer. 2014-05-24 21:37:12 +01:00
Jonathan Watt
46e7eec626 Bug 1013936, part 2 - Only load the html.css UA style sheet on-demand for SVG documents. r=bz CLOSED TREE 2014-05-24 20:29:11 +01:00
Jonathan Watt
1e31906fbd Bug 1008455 - Avoid loading the xul.css UA style sheet when possible. r=bz CLOSED TREE
--HG--
rename : toolkit/content/xul.css => toolkit/content/minimal-xul.css
2014-05-24 19:51:06 +01:00
Jonathan Watt
7ae551e9b7 Bug 1015147 - Use the style sheet cache to store the user-agent style sheets svg.css and mathml.css so that we don't create new instances for each new document. r=bz 2014-05-24 19:46:38 +01:00
Birunthan Mohanathas
6f68094e30 Bug 869836 - Part 9: Use AssignLiteral instead of Assign(NS_LITERAL_STRING(...)). r=ehsan 2014-05-22 06:48:52 +03:00
Birunthan Mohanathas
76ca8ec617 Bug 869836 - Part 7: Use AppendLiteral instead of Append where possible. r=ehsan 2014-05-22 06:48:51 +03:00
Birunthan Mohanathas
411a8639b4 Bug 869836 - Part 3: Use Append('c') instead of AppendLiteral("c"). r=ehsan 2014-05-22 06:48:51 +03:00
Birunthan Mohanathas
62570a8716 Bug 869836 - Part 2: Use AppendLiteral instead of Append(NS_LITERAL_STRING(...)). r=ehsan 2014-05-22 06:48:50 +03:00
John Schoenick
4b5e0520b0 Bug 870021 - Part 5.3 - nsImageFrame should take orientation into account when getting natural size from content. r=roc 2014-05-30 13:03:07 -07:00
Trevor Saunders
4abce4092c bug 1004746 - part 1 - Remove a bunch of usage of nsAutoPtr's copy ctor r=froydnj 2014-05-07 18:05:37 -04:00
Brian Birtles
e74ab14953 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.
2014-05-19 14:42:49 +09:00
Brian Birtles
daaf99415e 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.
2014-05-19 14:42:49 +09:00
Brian Birtles
1a81e30f49 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.
2014-05-19 14:42:49 +09:00
Brian Birtles
2c15d45f05 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.
2014-05-19 14:42:49 +09:00
Brian Birtles
c4033d836e 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.
2014-05-19 14:42:49 +09:00
Brian Birtles
7f3d73ea15 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.
2014-05-19 14:42:49 +09:00
Brian Birtles
8612ecc789 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.
2014-05-19 14:42:48 +09:00
Brian Birtles
90ccbe5eed 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.
2014-05-19 14:42:48 +09:00
Brian Birtles
97b59f7e2e 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.
2014-05-19 14:42:48 +09:00
Brian Birtles
7a70f8148f 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.
2014-05-19 14:42:48 +09:00
Brian Birtles
729a071655 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.
2014-05-19 14:42:48 +09:00
Brian Birtles
8e12e6c3e9 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.
2014-05-19 14:42:48 +09:00
Brian Birtles
5100f066e9 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.
2014-05-19 14:42:48 +09:00
Brian Birtles
cf4114df58 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.
2014-05-19 14:42:48 +09:00
Brian Birtles
3e009094af 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.
2014-05-19 14:42:48 +09:00
Brian Birtles
af1e278076 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.
2014-05-19 14:42:47 +09:00