Commit Graph

1716 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
a4d01fa250 Bug 1448559: Cleanup CalcStyleDifference. r=xidorn
The aSamePointerStructs argument is unused now.

Also, aIgnoreVariables can be true everywhere now, since variable changes can't
generate change hints, and anonymous boxes and such don't care about whether
they really changed or not.

Only one caller cares about struct equality, and that already compares variables
manually as an optimization on the rust side.

We had this optimization inconsistently in some cases but not others.

MozReview-Commit-ID: F2EISKlxR3K
2018-03-26 09:47:33 +02:00
Emilio Cobos Álvarez
87edb889e1 Bug 1448665: Simplify the unanimated style setup in nsComputedDOMStyle. r=xidorn
We never create nsComputedDOMStyle objects with an unanimated computed style, so
this can be much simpler.

MozReview-Commit-ID: 2NyBoErxRtV
2018-03-26 09:43:58 +02:00
Emilio Cobos Álvarez
8fcda0e92d Bug 1448690: Remove IsStyledByServo. r=xidorn
MozReview-Commit-ID: I3MDbo2Yu7d
2018-03-26 09:39:26 +02:00
Emilio Cobos Álvarez
2265ef0801 Bug 1448688: Remove RestyleTracker, ComputedStyle::AsServo, old style system element bits. r=xidorn
MozReview-Commit-ID: ALiOngGqozN
2018-03-26 09:38:07 +02:00
Xidorn Quan
30292048c2 Bug 1448716 - Remove PropertyValuePair::mValue. r=hiro
MozReview-Commit-ID: GLGJuXgontY

--HG--
extra : rebase_source : c4f5ddd641a275a4fbef87cabb8b4d50ac385860
2018-03-26 16:15:56 +11:00
Jonathan Watt
384c345f21 Bug 1448294 - Clean up naming of 'styleContext' variables after the big nsStyleContext rename. r=emilio
Reviewers: emilio

Bug #: 1448294

Differential Revision: https://phabricator.services.mozilla.com/D796

MozReview-Commit-ID: KJq2i9nrg7y
2018-03-25 20:49:58 +02:00
Narcis Beleuzu
47581f78e2 Backed out 2 changesets (bug 1448294, bug 1448337) for wpt and reftest failures on /mathml
Backed out changeset 180051cfe357 (bug 1448294)
Backed out changeset c188176f3289 (bug 1448337)
2018-03-25 21:31:08 +03:00
Jonathan Watt
21bff4e120 Summary: Bug 1448294 - Clean up naming of 'styleContext' variables after the big nsStyleContext rename. r=emilio
Reviewers: emilio

Bug #: 1448294

Differential Revision: https://phabricator.services.mozilla.com/D796
2018-03-22 13:49:21 +00:00
Emilio Cobos Álvarez
e341b20ec4 Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt on a CLOSED TREE
MozReview-Commit-ID: JPopq0LudD
2018-03-22 20:06:24 +01:00
Emilio Cobos Álvarez
5dd797f154 Back out changeset b683bb3f22a1 (Bug 1447483) for not landing with all the files. r=me on a CLOSED TREE
This reverts commit 1808914126bb9f9e4a82d2c3d7ac961885fe7d62.

MozReview-Commit-ID: 5skESBseEvo
2018-03-22 20:05:22 +01:00
Emilio Cobos Álvarez
ca5ac79cca Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt
MozReview-Commit-ID: JPopq0LudD
2018-03-22 19:48:42 +01:00
arthur.iakab
abcb47d8cc Merge inbound to mozilla-central. a=merge 2018-03-21 21:13:11 +02:00
Miko Mynttinen
65c6bee9d6 Bug 1445302 - Replace TArray.RemoveElementAt(TArray.Length() - 1) pattern with TArray.RemoveLastElement() or TArray.PopLastElement() r=froydnj
MozReview-Commit-ID: rGjabnP2iz

--HG--
extra : rebase_source : 1ef6c5ce028ac9ebd9f3176d57835c43fe46bada
2018-03-13 14:51:33 +01:00
Jonathan Watt
f3e6656403 Bug 1447367 - Remove files that are not built when MOZ_OLD_STYLE is not defined. r=emilio
MozReview-Commit-ID: D9bEPfTSw61
2018-03-07 18:08:41 +00:00
Emilio Cobos Álvarez
f7522ae728 Bug 1447358: Unifdef the old style system code. r=jwatt
Summary:
This has been automatically generated using:

  http://dotat.at/prog/unifdef/

And:

find $OBJDIR -type f -name '*.h' |
while read FILE; do
  echo "$FILE"
  unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE";
done

find $OBJDIR -type f -name '*.cpp' |
while read FILE; do
  echo "$FILE"
  unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE";
done

MozReview-Commit-ID: I4NdKqbMXzJ

Reviewers: jwatt

Bug #: 1447358

Differential Revision: https://phabricator.services.mozilla.com/D779
2018-03-21 10:20:34 +01:00
Hiroyuki Ikezoe
df1a0e7203 Bug 1444177 - Tweak expected restyle count for the test case where finite animation is unthrottled in out-of-view element. r=birtles
It might be possible that the animation does not start being restyled in the
initial frame.  Eventually we should drop tweakExpectedRestyleCount in bug
1425778 and replace it with a function that waits for animation.ready and waits
to start being restyled something like this;

  async function waitForAnimationReadyToBeRestyled(aAnimation) {
    await aAnimation.ready;

    if (animationStartsRightNow(aAnimation)) {
      await waitForFrame();
    }
  }

MozReview-Commit-ID: ByN25hMAK76

--HG--
extra : rebase_source : 6dd3a44661905ffff7bce748540572df2d40425b
2018-03-19 12:46:23 +09:00
Brian Birtles
ee9982905f Bug 1420320 - Drop dom.animations-api.pending-member.enabled pref; r=bz,hiro
This pref was introduced in case we encountered compatibility issues from
changing the return value of Animation.playState (bug 1412765). Now that the
change to Animation.playState has shipped to release channel without any known
problems we should drop this pref.

MozReview-Commit-ID: CwMWRRtIf6u

--HG--
extra : rebase_source : b26c59a51880406c2b94baad8da2eafeb3ae3202
2018-03-16 12:49:55 +09:00
Tom Ritter
88fc3fb4ea Bug 1440195 Address CSS Animations r=birtles
For now, we are going to make _all_ CSS Animations related timer fuzzing
only applicable in Resist Fingerprinting Mode (addressing the last couple
that had not already been configured that way.)

We hardcode their content mix-ins as zero, but leave comments indicating
how they should behave.

MozReview-Commit-ID: KhmV7wO8Pt5

--HG--
extra : rebase_source : 3b087d40b6332d447b442b435ed6fee8993e0145
2018-03-05 15:58:46 -06:00
Mantaroh Yoshinaga
ce9138a07e Bug 1419226 - Part 2. Wait for MozAfterPaint instead of waiting for frames on file_deferred_start.html . r=hiro
This patch will :
 * Create test div element after waiting for document load, then wait for
   painting after it.
 * Change to waiting for MozAfterPaint event without workaround of waiting for
   excessive frames.

MozReview-Commit-ID: 6Ytxln3tJi4

--HG--
extra : rebase_source : ff1ccb0ab155ad7e782ecf43f7768ea67f9b9bcf
2018-03-14 13:27:16 +09:00
Brian Birtles
be4db82113 Bug 1382841 - Rename some test files in dom/animation/test/mozilla to use _ to separate words; r=hiro
This naming convention is described fully in this changeset's grandparent.

MozReview-Commit-ID: 5EBpVrOdxD2

--HG--
rename : dom/animation/test/mozilla/file_discrete-animations.html => dom/animation/test/mozilla/file_discrete_animations.html
rename : dom/animation/test/mozilla/test_discrete-animations.html => dom/animation/test/mozilla/test_discrete_animations.html
rename : dom/animation/test/mozilla/test_moz-prefixed-properties.html => dom/animation/test/mozilla/test_moz_prefixed_properties.html
2018-03-12 16:08:36 +09:00
Brian Birtles
5afe0fbdff Bug 1382841 - Rename test_XXX_to_rename.html files in dom/animation/test to test_XXX.html; r=hiro
See the description in this changeset's parent which describes why we do this in
two steps.

MozReview-Commit-ID: GtO0SCb0UOF

--HG--
rename : dom/animation/test/css-animations/test_animation-cancel_to_rename.html => dom/animation/test/css-animations/test_animation-cancel.html
rename : dom/animation/test/css-animations/test_animation-computed-timing_to_rename.html => dom/animation/test/css-animations/test_animation-computed-timing.html
rename : dom/animation/test/css-animations/test_animation-currenttime_to_rename.html => dom/animation/test/css-animations/test_animation-currenttime.html
rename : dom/animation/test/css-animations/test_animation-finish_to_rename.html => dom/animation/test/css-animations/test_animation-finish.html
rename : dom/animation/test/css-animations/test_animation-finished_to_rename.html => dom/animation/test/css-animations/test_animation-finished.html
rename : dom/animation/test/css-animations/test_animation-id_to_rename.html => dom/animation/test/css-animations/test_animation-id.html
rename : dom/animation/test/css-animations/test_animation-pausing_to_rename.html => dom/animation/test/css-animations/test_animation-pausing.html
rename : dom/animation/test/css-animations/test_animation-playstate_to_rename.html => dom/animation/test/css-animations/test_animation-playstate.html
rename : dom/animation/test/css-animations/test_animation-ready_to_rename.html => dom/animation/test/css-animations/test_animation-ready.html
rename : dom/animation/test/css-animations/test_animation-reverse_to_rename.html => dom/animation/test/css-animations/test_animation-reverse.html
rename : dom/animation/test/css-animations/test_animation-starttime_to_rename.html => dom/animation/test/css-animations/test_animation-starttime.html
rename : dom/animation/test/css-animations/test_animations-dynamic-changes_to_rename.html => dom/animation/test/css-animations/test_animations-dynamic-changes.html
rename : dom/animation/test/css-animations/test_cssanimation-animationname_to_rename.html => dom/animation/test/css-animations/test_cssanimation-animationname.html
rename : dom/animation/test/css-animations/test_document-get-animations_to_rename.html => dom/animation/test/css-animations/test_document-get-animations.html
rename : dom/animation/test/css-animations/test_effect-target_to_rename.html => dom/animation/test/css-animations/test_effect-target.html
rename : dom/animation/test/css-animations/test_element-get-animations_to_rename.html => dom/animation/test/css-animations/test_element-get-animations.html
rename : dom/animation/test/css-animations/test_event-dispatch_to_rename.html => dom/animation/test/css-animations/test_event-dispatch.html
rename : dom/animation/test/css-animations/test_event-order_to_rename.html => dom/animation/test/css-animations/test_event-order.html
rename : dom/animation/test/css-animations/test_keyframeeffect-getkeyframes_to_rename.html => dom/animation/test/css-animations/test_keyframeeffect-getkeyframes.html
rename : dom/animation/test/css-animations/test_pseudoElement-get-animations_to_rename.html => dom/animation/test/css-animations/test_pseudoElement-get-animations.html
rename : dom/animation/test/css-animations/test_setting-effect_to_rename.html => dom/animation/test/css-animations/test_setting-effect.html
rename : dom/animation/test/css-transitions/test_animation-cancel_to_rename.html => dom/animation/test/css-transitions/test_animation-cancel.html
rename : dom/animation/test/css-transitions/test_animation-computed-timing_to_rename.html => dom/animation/test/css-transitions/test_animation-computed-timing.html
rename : dom/animation/test/css-transitions/test_animation-currenttime_to_rename.html => dom/animation/test/css-transitions/test_animation-currenttime.html
rename : dom/animation/test/css-transitions/test_animation-finished_to_rename.html => dom/animation/test/css-transitions/test_animation-finished.html
rename : dom/animation/test/css-transitions/test_animation-pausing_to_rename.html => dom/animation/test/css-transitions/test_animation-pausing.html
rename : dom/animation/test/css-transitions/test_animation-ready_to_rename.html => dom/animation/test/css-transitions/test_animation-ready.html
rename : dom/animation/test/css-transitions/test_animation-starttime_to_rename.html => dom/animation/test/css-transitions/test_animation-starttime.html
rename : dom/animation/test/css-transitions/test_csstransition-transitionproperty_to_rename.html => dom/animation/test/css-transitions/test_csstransition-transitionproperty.html
rename : dom/animation/test/css-transitions/test_document-get-animations_to_rename.html => dom/animation/test/css-transitions/test_document-get-animations.html
rename : dom/animation/test/css-transitions/test_effect-target_to_rename.html => dom/animation/test/css-transitions/test_effect-target.html
rename : dom/animation/test/css-transitions/test_element-get-animations_to_rename.html => dom/animation/test/css-transitions/test_element-get-animations.html
rename : dom/animation/test/css-transitions/test_event-dispatch_to_rename.html => dom/animation/test/css-transitions/test_event-dispatch.html
rename : dom/animation/test/css-transitions/test_keyframeeffect-getkeyframes_to_rename.html => dom/animation/test/css-transitions/test_keyframeeffect-getkeyframes.html
rename : dom/animation/test/css-transitions/test_pseudoElement-get-animations_to_rename.html => dom/animation/test/css-transitions/test_pseudoElement-get-animations.html
rename : dom/animation/test/css-transitions/test_setting-effect_to_rename.html => dom/animation/test/css-transitions/test_setting-effect.html
rename : dom/animation/test/document-timeline/test_document-timeline_to_rename.html => dom/animation/test/document-timeline/test_document-timeline.html
rename : dom/animation/test/mozilla/test_cubic_bezier_limits_to_rename.html => dom/animation/test/mozilla/test_cubic_bezier_limits.html
rename : dom/animation/test/mozilla/test_disabled_properties_to_rename.html => dom/animation/test/mozilla/test_disabled_properties.html
rename : dom/animation/test/mozilla/test_hide_and_show_to_rename.html => dom/animation/test/mozilla/test_hide_and_show.html
rename : dom/animation/test/mozilla/test_restyling_xhr_doc_to_rename.html => dom/animation/test/mozilla/test_restyling_xhr_doc.html
rename : dom/animation/test/mozilla/test_transform_limits_to_rename.html => dom/animation/test/mozilla/test_transform_limits.html
rename : dom/animation/test/style/test_animation-seeking-with-current-time_to_rename.html => dom/animation/test/style/test_animation-seeking-with-current-time.html
rename : dom/animation/test/style/test_animation-seeking-with-start-time_to_rename.html => dom/animation/test/style/test_animation-seeking-with-start-time.html
rename : dom/animation/test/style/test_animation-setting-effect_to_rename.html => dom/animation/test/style/test_animation-setting-effect.html
rename : dom/animation/test/style/test_composite_to_rename.html => dom/animation/test/style/test_composite.html
rename : dom/animation/test/style/test_missing-keyframe-on-compositor_to_rename.html => dom/animation/test/style/test_missing-keyframe-on-compositor.html
rename : dom/animation/test/style/test_missing-keyframe_to_rename.html => dom/animation/test/style/test_missing-keyframe.html
2018-03-12 16:08:35 +09:00
Brian Birtles
d0f7ad72a1 Bug 1382841 - Remove old test_XXX openers from dom/animation/test/**; r=hiro
We rename the file_XXX contents to test_XXX_to_rename so that these tests keep
running (so long as they begin with file_ and not test_ the test harness will
refuse to run them). If we rename these files to test_XXX in the same patch
Mercurial will not treat this as a rename and so we will lose the history
associated with file_XXX.

Instead, we rename test_XXX_to_rename to test_XXX in the next patch in this
series and by doing this Mercurial will treat this as two rename operations and
`hg log -f test_XXX` will show the history file_XXX as well.

One minor exception to this occurs due to the fact that we have two naming
conventions:

  (a) For tests in css-animations, css-transitions, style etc.

      Most of these tests should eventually land in web-platform-tests. However,
      in many cases that's not yet possible because, for example, CSS
      Animations 2 does not yet specify the behavior tested by the
      css-animations tests.

      For tests in web-platform-tests we generally separate words using -.
      However, our mochitest running machinery requires that tests begin with
      test_. Hence we name tests: test_abc-def-ghi.html.

  (b) For tests in mozilla

      These tests are never intended to be part of web-platform-tests and
      generally for mochitests we use _ to separate words (hence the test_
      prefix). Hence we name these tests test_abc_def_ghi.html

Now, there are some tests in the 'mozilla' directory that use the (a) naming
scheme instead of (b). In this case, instead of renaming file_xxx-xxx.html to
test_xxx-xxx_to_rename.html in this patch, and then renaming
test_xxx-xxx_to_rename.html to test_xxx-xxx.html in a second patch, we can just
delete test_xxx-xxx.html and rename file_xxx-xxx.html to test_xxx_xxx.html in
the one patch and Mercurial will recognize this as a rename because the file
names don't overlap.

MozReview-Commit-ID: Etcdmyfx0zf

--HG--
rename : dom/animation/test/css-animations/file_animation-cancel.html => dom/animation/test/css-animations/test_animation-cancel_to_rename.html
rename : dom/animation/test/css-animations/file_animation-computed-timing.html => dom/animation/test/css-animations/test_animation-computed-timing_to_rename.html
rename : dom/animation/test/css-animations/file_animation-currenttime.html => dom/animation/test/css-animations/test_animation-currenttime_to_rename.html
rename : dom/animation/test/css-animations/file_animation-finish.html => dom/animation/test/css-animations/test_animation-finish_to_rename.html
rename : dom/animation/test/css-animations/file_animation-finished.html => dom/animation/test/css-animations/test_animation-finished_to_rename.html
rename : dom/animation/test/css-animations/file_animation-id.html => dom/animation/test/css-animations/test_animation-id_to_rename.html
rename : dom/animation/test/css-animations/file_animation-pausing.html => dom/animation/test/css-animations/test_animation-pausing_to_rename.html
rename : dom/animation/test/css-animations/file_animation-playstate.html => dom/animation/test/css-animations/test_animation-playstate_to_rename.html
rename : dom/animation/test/css-animations/file_animation-ready.html => dom/animation/test/css-animations/test_animation-ready_to_rename.html
rename : dom/animation/test/css-animations/file_animation-reverse.html => dom/animation/test/css-animations/test_animation-reverse_to_rename.html
rename : dom/animation/test/css-animations/file_animation-starttime.html => dom/animation/test/css-animations/test_animation-starttime_to_rename.html
rename : dom/animation/test/css-animations/file_animations-dynamic-changes.html => dom/animation/test/css-animations/test_animations-dynamic-changes_to_rename.html
rename : dom/animation/test/css-animations/file_cssanimation-animationname.html => dom/animation/test/css-animations/test_cssanimation-animationname_to_rename.html
rename : dom/animation/test/css-animations/file_document-get-animations.html => dom/animation/test/css-animations/test_document-get-animations_to_rename.html
rename : dom/animation/test/css-animations/file_effect-target.html => dom/animation/test/css-animations/test_effect-target_to_rename.html
rename : dom/animation/test/css-animations/file_element-get-animations.html => dom/animation/test/css-animations/test_element-get-animations_to_rename.html
rename : dom/animation/test/css-animations/file_event-dispatch.html => dom/animation/test/css-animations/test_event-dispatch_to_rename.html
rename : dom/animation/test/css-animations/file_event-order.html => dom/animation/test/css-animations/test_event-order_to_rename.html
rename : dom/animation/test/css-animations/file_keyframeeffect-getkeyframes.html => dom/animation/test/css-animations/test_keyframeeffect-getkeyframes_to_rename.html
rename : dom/animation/test/css-animations/file_pseudoElement-get-animations.html => dom/animation/test/css-animations/test_pseudoElement-get-animations_to_rename.html
rename : dom/animation/test/css-animations/file_setting-effect.html => dom/animation/test/css-animations/test_setting-effect_to_rename.html
rename : dom/animation/test/css-transitions/file_animation-cancel.html => dom/animation/test/css-transitions/test_animation-cancel_to_rename.html
rename : dom/animation/test/css-transitions/file_animation-computed-timing.html => dom/animation/test/css-transitions/test_animation-computed-timing_to_rename.html
rename : dom/animation/test/css-transitions/file_animation-currenttime.html => dom/animation/test/css-transitions/test_animation-currenttime_to_rename.html
rename : dom/animation/test/css-transitions/file_animation-finished.html => dom/animation/test/css-transitions/test_animation-finished_to_rename.html
rename : dom/animation/test/css-transitions/file_animation-pausing.html => dom/animation/test/css-transitions/test_animation-pausing_to_rename.html
rename : dom/animation/test/css-transitions/file_animation-ready.html => dom/animation/test/css-transitions/test_animation-ready_to_rename.html
rename : dom/animation/test/css-transitions/file_animation-starttime.html => dom/animation/test/css-transitions/test_animation-starttime_to_rename.html
rename : dom/animation/test/css-transitions/file_csstransition-transitionproperty.html => dom/animation/test/css-transitions/test_csstransition-transitionproperty_to_rename.html
rename : dom/animation/test/css-transitions/file_document-get-animations.html => dom/animation/test/css-transitions/test_document-get-animations_to_rename.html
rename : dom/animation/test/css-transitions/file_effect-target.html => dom/animation/test/css-transitions/test_effect-target_to_rename.html
rename : dom/animation/test/css-transitions/file_element-get-animations.html => dom/animation/test/css-transitions/test_element-get-animations_to_rename.html
rename : dom/animation/test/css-transitions/file_event-dispatch.html => dom/animation/test/css-transitions/test_event-dispatch_to_rename.html
rename : dom/animation/test/css-transitions/file_keyframeeffect-getkeyframes.html => dom/animation/test/css-transitions/test_keyframeeffect-getkeyframes_to_rename.html
rename : dom/animation/test/css-transitions/file_pseudoElement-get-animations.html => dom/animation/test/css-transitions/test_pseudoElement-get-animations_to_rename.html
rename : dom/animation/test/css-transitions/file_setting-effect.html => dom/animation/test/css-transitions/test_setting-effect_to_rename.html
rename : dom/animation/test/document-timeline/file_document-timeline.html => dom/animation/test/document-timeline/test_document-timeline_to_rename.html
rename : dom/animation/test/mozilla/file_cubic_bezier_limits.html => dom/animation/test/mozilla/test_cubic_bezier_limits_to_rename.html
rename : dom/animation/test/mozilla/file_disabled_properties.html => dom/animation/test/mozilla/test_disabled_properties_to_rename.html
rename : dom/animation/test/mozilla/file_document-timeline-origin-time-range.html => dom/animation/test/mozilla/test_document_timeline_origin_time_range.html
rename : dom/animation/test/mozilla/file_hide_and_show.html => dom/animation/test/mozilla/test_hide_and_show_to_rename.html
rename : dom/animation/test/mozilla/file_restyling_xhr_doc.html => dom/animation/test/mozilla/test_restyling_xhr_doc_to_rename.html
rename : dom/animation/test/mozilla/file_set-easing.html => dom/animation/test/mozilla/test_set_easing.html
rename : dom/animation/test/mozilla/file_transform_limits.html => dom/animation/test/mozilla/test_transform_limits_to_rename.html
rename : dom/animation/test/mozilla/file_underlying-discrete-value.html => dom/animation/test/mozilla/test_underlying_discrete_value.html
rename : dom/animation/test/style/file_animation-seeking-with-current-time.html => dom/animation/test/style/test_animation-seeking-with-current-time_to_rename.html
rename : dom/animation/test/style/file_animation-seeking-with-start-time.html => dom/animation/test/style/test_animation-seeking-with-start-time_to_rename.html
rename : dom/animation/test/style/file_animation-setting-effect.html => dom/animation/test/style/test_animation-setting-effect_to_rename.html
rename : dom/animation/test/style/file_composite.html => dom/animation/test/style/test_composite_to_rename.html
rename : dom/animation/test/style/file_missing-keyframe-on-compositor.html => dom/animation/test/style/test_missing-keyframe-on-compositor_to_rename.html
rename : dom/animation/test/style/file_missing-keyframe.html => dom/animation/test/style/test_missing-keyframe_to_rename.html
2018-03-12 16:08:35 +09:00
Daniel Holbert
408bfa9bf0 Bug 1444481 part 1: Add some needed #includes to ComputedTimingFunction.h and FrameMetrics.h. r=xidorn
(This is a helper patch -- I'm splitting this into its own patch since it's
changing files in other directories, and also so that the main patches here
can be a bit more direct.)

Without this change, the other patches in this series would cause compile
failures in the headers that I'm fixing up here (because the other patches will
be removing #includes from some headers that these files were inadvertently
depending on).

As of this patch, ComputedTimingFunction.h will now be including:
 - nsDebug.h to provide NS_ASSERTION
 - nsStringFwd.h to provide a forward-declaration for "nsAString&"
 - Assertions.h to provide MOZ_ASSERT
 - Maybe.h to provide Maybe<ComputedTimingFunction>
(I think it's been leaning on nsTimingFunction.h's include of nsString.h to
indirectly provide these.)

FrameMetrics.h will now be including:
 - PLDHashTable.h to provide PLDHashNumber
(I think it's been leaning on nsStyleCoord.h/nsStyleConsts.h to indirectly
provide this.)

MozReview-Commit-ID: AoFoEe9GisK

--HG--
extra : rebase_source : 63c69343acaf42511ebdeb0238f4385a0c6345a5
2018-03-09 11:52:02 -08:00
Hiroyuki Ikezoe
93d38258f6 Bug 1442817 - Don't flush throttled animations on getAnimations(). r=birtles
If the element has throttled animations that will be affected by pending style
changes, the throttled animations will be updated though sequential tasks after
normal styling process.  E.g. UpdateEffectProperties, UpdateCascadeResults etc.
So we don't need to flush them in advance of the sequential tasks.

The first test case in this patch fails without this fix.

MozReview-Commit-ID: GystAqK2bQE

--HG--
extra : rebase_source : c01160e14bb5a2984dcc4d63ec44d4d465b829a2
2018-03-09 09:38:40 +09:00
Hiroyuki Ikezoe
a4c94de97f Bug 1442817 - Introduce a function to observe synchronous restyling easily. r=birtles
In the subsequent patch, we want to observe animation restyles caused by
synchronous styling.  If we used the original asynchronous observer for that,
we will observe restyles in normal scheduled styling, it's bit confusing.

MozReview-Commit-ID: 1V2IavKNECG

--HG--
extra : rebase_source : ee112acf2426ecf54435f77b8801a6228318459c
2018-03-09 06:41:35 +09:00
Hiroyuki Ikezoe
e6806e41d7 Bug 1444221 - #ifdef out some animation related stuff for MOZ_OLD_STYLE. r=xidorn
MozReview-Commit-ID: 9VC4qUbO6uK

--HG--
extra : rebase_source : 79113eb99cd784dc9a591bb9529381a932f07f97
2018-03-09 07:09:44 +09:00
Hiroyuki Ikezoe
6f36308ec8 Bug 1443423 - Drop Animation::PauseNoUpdate(). r=birtles
CSSTransition still uses PlayNoUpdate().

MozReview-Commit-ID: 5RHSXwaKYV2

--HG--
extra : rebase_source : f8edbe2ebf02fbc7e77f99f0064b2a65a5ae3cd4
2018-03-07 11:48:35 +09:00
Hiroyuki Ikezoe
573dfe44a6 Bug 1437272 - Don't throttle finite transform animations in out-of-view element. r=birtles
Transform animation in out-of-view element might move in visible area so if we
throttle it the transform animation might come in view suddenly.  So we don't
throttle transform animations in ouf-of-view element anymore if it's not
infinite.  Finite animations don't last so that they won't consume CPU so much
time.

MozReview-Commit-ID: HaMjmxqXPIK

--HG--
extra : rebase_source : 1c008e4e435bcc9c1ad8fcc84667080247c0b161
2018-03-08 18:22:45 +09:00
Hiroyuki Ikezoe
9e80d1d901 Bug 1437272 - Drop AnimationEffectReadOnly::IsActiveDurationZero(). r=birtles
It's no longer used since bug 1305325.
https://hg.mozilla.org/integration/autoland/rev/60857c37bcfa

MozReview-Commit-ID: JapMYQOTDSv

--HG--
extra : rebase_source : 7b3f9050be93b5f45e236f4001502f11bff86a4e
2018-03-08 18:22:45 +09:00
Hiroyuki Ikezoe
be2fe6bf8c Bug 1437272 - Split nsTimingFunction into an independent header file. r=birtles
So that we don't need to include nsStyleStruct.h in gfx any more.

MozReview-Commit-ID: 6nOaAbssLCz

--HG--
extra : rebase_source : 9c195c90277a4584dc14a6949e9eea53bcd8487c
2018-03-08 18:22:45 +09:00
Hiroyuki Ikezoe
97b67fe961 Bug 1442150 - Re-enable test_running_on_compositor.html on Android. r=birtles
Now the test works fine with the new microtask handling.

MozReview-Commit-ID: EhFcN2XAClw

--HG--
extra : rebase_source : f1066bf09df07c1bcbfe5dc5dcc59596530424d0
2018-03-06 11:01:49 +09:00
Hiroyuki Ikezoe
795bd7d475 Bug 1442150 - Wait for one more frame if the animation starts at the current timeline time in the first test case. r=birtles
MozReview-Commit-ID: DVOiauPDqhM

--HG--
extra : rebase_source : 2e9dfd0b7dbef48e92fbe48a5166ec6f3aafcabf
2018-03-06 10:55:05 +09:00
Hiroyuki Ikezoe
16a0b8373a Bug 1442150 - Move startsRightNow into testcommon.js and rename it to animationStartsRightNow. r=birtles
MozReview-Commit-ID: 58umbOjy4di

--HG--
extra : rebase_source : eb6810658f09c848c38e11f7872fb7326021f1a3
2018-03-06 10:35:26 +09:00
Hiroyuki Ikezoe
4bc9a2e83a Bug 1442150 - Rewrite test_running_on_compositor.html with async/await. r=birtles
MozReview-Commit-ID: Cdk7kQWcbXU

--HG--
extra : rebase_source : cc9b0e753c6b7804c7f0233cab0a2d3135118f28
2018-03-06 10:35:26 +09:00
Hiroyuki Ikezoe
0206c630c9 Bug 1428693 - Use GetOverflowAreasRelativeToSelf() instead of GetOverflowAreas() for scrollable parent. r=mattwoodrow
Because the scrollable parent might be transformed by its ancestors.

MozReview-Commit-ID: FuCPLg54z7h

--HG--
extra : rebase_source : 7c11c5384d2aed6c663b915fcacae7c627052a43
2018-03-05 07:55:32 +09:00
Olli Pettay
2439836b37 Bug 1193394 - Part 1: Microtasks and promises scheduling. r=bevis 2017-11-17 11:01:27 +08:00
Csoregi Natalia
1fd0486e23 Backed out 7 changesets (bug 1193394) for browser-chrome failures on browser_ext_popup_background.js. CLOSED TREE
Backed out changeset 9683f24ff8ec (bug 1193394)
Backed out changeset 0e7140a7c841 (bug 1193394)
Backed out changeset a0e26f6b2784 (bug 1193394)
Backed out changeset 29e1fceaf48d (bug 1193394)
Backed out changeset b8632bbbd273 (bug 1193394)
Backed out changeset a54ef2d8f896 (bug 1193394)
Backed out changeset 55c94c05c57f (bug 1193394)
2018-03-01 16:29:02 +02:00
Olli Pettay
b7726493fb Bug 1193394 - Part 1: Microtasks and promises scheduling. r=bevis 2017-11-17 11:01:27 +08:00
Hiroyuki Ikezoe
a1d3f36a83 Bug 1442150 - Skip test_running_on_compositor.html on Android. r=arai
It seems that the test starts failing after bug 1193394.
2018-03-01 00:06:00 +09:00
Hiroyuki Ikezoe
6d345d0f0c Bug 1439485 - Don't try to unthrottle transform animations that don't affect overflow region. r=birtles
MozReview-Commit-ID: AtQPiPnsC3z

--HG--
extra : rebase_source : fd9ee5f5a863237c7993d771e30c20921fe86ae2
2018-02-27 14:46:32 +09:00
Nathan Froyd
821df39aef Bug 1439723 - use a temporary in Animation::Tick(); r=mattwoodrow 2018-02-26 11:08:55 -05:00
Emilio Cobos Álvarez
7dffe29d8f Bug 1432490: Make nsComputedDOMStyle::GetStyleContext / GetStyleContextNoFlush not take a presShell. r=bz
Everyone calls them with the shell of the current composed document, and this
allows the multi-presShell stuff to just be in UpdateCurrentStyleSources /
DoGetStyleContextNoFlush.

The only reason we need to use OwnerDoc()->GetShell() instead of the composed
doc in GetStyleContext / GetStyleContextNoFlush is Element::GetBindingURL, which
does expect to get the binding URL for stuff outside of the composed doc (and
changing that gave me a useless browser).

That's technically a behavior change on the cases that used to pass nullptr, but
I think all callers are fine with that. I could also just add a special function
for that particular case, it may be worth it.

MozReview-Commit-ID: 2XlnkgdgDCK
2018-02-25 02:23:59 +01:00
Tom Ritter
ba2d560b34 Bug 1430841 Re-enable the Reduce Timer Precision pref for CSS Animations tests r=birtles
Currently CSS Animations are exempted from Reduce Timer Precision, so this isn't needed.
Additionally, when we test by overriding that restriction, these tests aren't run, which
leads to confusion.

MozReview-Commit-ID: Gv6T3oGO475

--HG--
extra : rebase_source : 6bd70341fe5d047b685cae0db2965bf86116b4a0
2018-02-16 15:45:33 -06:00
Hiroyuki Ikezoe
ad663efa0b Bug 1439428 - Call UpdateCascadeResults() directly instead of RestyleRestyle() at the end of Gecko_UpdateAnimations(). r=birtles
Calling RequestRestyle() for update cascade results is weird since in general
RequestRestyle() is a result of updating cascade results (e.g. when an
!important style is changed).  In the case where we already know that we need
to update cascade results we can do it right after all the other processes that
may need to update cascade results has done so that we don't need to worry about
the cases additional cascade results update happens.

MozReview-Commit-ID: 6lh0NgTPF9j

--HG--
extra : rebase_source : 4dbec85f55a14776907b677f2876421abc141384
2018-02-23 09:05:26 +09:00
Hiroyuki Ikezoe
77efac4019 Bug 1439428 - Make EffectCompositor::UpdateCascadeResults public. r=birtles
We will call the function directly in a sequential task in the case where we
already detected that !important styles for animations has been changed in
parallel traversal.

MozReview-Commit-ID: 7j6CfONYD08

--HG--
extra : rebase_source : 5ac29124cefbc8e57231d0acb9b1749b2c9587c0
2018-02-23 09:05:26 +09:00
Hiroyuki Ikezoe
8f3060510e Bug 1439269 - Call RequestRestyle() if the display property is changed from 'none' in the case the element has script animations. r=birtles
MozReview-Commit-ID: 1anUTbvw3k4

--HG--
extra : rebase_source : 68ca22f8db7112ac3d73c5331ff39b0780cece6e
2018-02-22 09:10:00 +09:00
Hiroyuki Ikezoe
467ed67c74 Bug 1388557 - Call RequestRestyle(Layer) in the case where we attach orphaned animating element to the document. r=birtles
MozReview-Commit-ID: IIcyYFROqDx

--HG--
extra : rebase_source : f096635d400528660d5243d2884d125e7b623db2
2018-02-21 10:13:13 +09:00
Hiroyuki Ikezoe
4606fafb88 Bug 1417354 - Clear pending restyle requests for the element and its pseudos where the element is detached from the document. r=hiro
MozReview-Commit-ID: GLHjtHNusuB

--HG--
extra : rebase_source : aaf05c7773d11cf61a28803d4ba70546c2b98e27
2018-02-21 07:00:20 +09:00
Hiroyuki Ikezoe
0ca9f2c309 Bug 1417354 - Add a method to clear all pending restyle requests for a given element and its pseudos. r=birtles
MozReview-Commit-ID: DZkbwUPiPTd

--HG--
extra : rebase_source : b1993ea863a261841be1edfc3b2dee7655123fe8
2018-02-21 07:00:20 +09:00
Hiroyuki Ikezoe
1b0cba9367 Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug
It would be convenient to get nsPresContext from nsIDocument.

MozReview-Commit-ID: Ei6V3UE8XGr

--HG--
extra : rebase_source : 8d2a917eb62cf341e4e1810451fd01c01dbc3bad
2018-02-21 07:00:10 +09:00
Tooru Fujisawa
9a81f2437f Bug 1414674 - Do not enter the compartment of the target window when calling KeyframeEffect and KeyframeEffectReadOnly constructor via Xray. r=bz,birtles
KeyframeEffect and KeyframeEffectReadOnly constructors can run in the caller
compartment, which is okay because the current compartment is used in the
following places and all of them are safe:

1. GlobalObject::CallerType(), that is ultimately passed to
   nsDocument::IsWebAnimationsEnabled in KeyframeEffectParamsFromUnion,
   to decide whether to copy mIterationComposite/mComposite to
   KeyframeEffectParams.

   GlobalObject::CallerType() can now be different than the target window's one,
   if the caller has the system principal and the target is web content, and
   in that case nsDocument::IsWebAnimationsEnabled there always returns true
   while Web Animations can be disabled on web content.

   honoring the mIterationComposite/mComposite properties is OK, since it just
   changes the animation behavior, and this is disabled by default until
   remaining spec issues are resolved.

2. GlobalObject::Context(), that is ultimately passed to
   KeyframeUtils::GetKeyframesFromObject and used while extracting information
   from passed-in keyframe object, with iterable/iterator protocols.

   Performing that operation in the caller side is okay, since the same thing
   can be done on caller, and the operation doesn't perform any GCThing
   allocation on the target window global.
2018-02-17 17:21:13 +09:00
Tooru Fujisawa
d70a10cbd8 Backed out changeset c3f16a179c93 (bug 1414674) 2018-02-18 01:24:08 +09:00
Tooru Fujisawa
d58a217b1c Bug 1414674 - Do not enter the compartment of the target window when calling KeyframeEffect and KeyframeEffectReadOnly constructor via Xray. r=bz,birtles
KeyframeEffect and KeyframeEffectReadOnly constructors can run in the caller
compartment, which is okay because of the following reasons:

1. The target window global is used for most operation:
     * KeyframeEffectReadOnly::ConstructKeyframeEffect uses the target window
       global instead of current global.
     * KeyframeEffectParamsFromUnion which receives `aGlobal.CallerType()`

   In Xray case, Web Animations API can be disabled on web content
   (currently disabled on beta/release by default), and in that case some API
   won't work even it's triggered from WebExtensions, but it should be fine.

2. GetKeyframesFromObject is executed in the caller's compartment to access
   the passed-in JSObject that is keyframe, with iterable/iterator protocols.
   This operation doesn't perform any GCThing allocation on the target window
   global.
2018-02-17 17:21:13 +09:00
Brian Birtles
691e8bbafc Bug 1436659 - Implement pending playback rate mechanism; r=hiro
This reflects the following changes to the Web Animations specification:

  1. 5af5e276ba
  2. 673f6fc126

which can be viewed as a merged diff at:

  https://gist.github.com/birtles/d147eb2e0e2d4d37fadf217abd709411

MozReview-Commit-ID: 3DoaWUkxBTo

--HG--
extra : rebase_source : 032d768b35e3189cd41c38fb4d85a644781a6e33
2018-02-13 15:04:18 +09:00
Brian Birtles
2d967bae1b Bug 1436659 - Add Animation::GetCurrentTimeForHoldTime helper; r=hiro
We will use this to calculate the unconstrained current time when we implement
pending playback rate changes.

MozReview-Commit-ID: 7GlmHiGeXF6

--HG--
extra : rebase_source : 32c0c4d86293bf11220017fa1b126ae239b0301d
2018-02-13 15:04:18 +09:00
Brian Birtles
bb7f299f94 Bug 1436659 - Factor out static time calculation methods on Animation; r=hiro
We will re-use these methods to perform various calculations once we introduce
the pending playback rate.

MozReview-Commit-ID: 2HV44TTNxHg

--HG--
extra : rebase_source : 19e32b13c6fee9cfe9993918557f2433aa687e11
2018-02-13 15:04:18 +09:00
Brian Birtles
6255f94834 Bug 1436659 - Add Animation.updatePlaybackRate WebIDL definition; r=bz
This is the IDL added to the Web Animations specification:

  5af5e276ba

Note that some of the changes in the above commit were reverted in the following
commit:

  673f6fc126

A folded version of the changes:

  https://gist.github.com/birtles/d147eb2e0e2d4d37fadf217abd709411

MozReview-Commit-ID: CJV7bzizXg4

--HG--
extra : rebase_source : 3b168e779883ba91c8f572478185b55013952d1a
2018-02-13 15:04:18 +09:00
arthur.iakab
4139c1f914 Backed out 14 changesets (bug 1436659) for Eslint failures on devtools/server/actors/animation.js:876:12 on a CLOSED TREE
Backed out changeset a2890507d13a (bug 1436659)
Backed out changeset c653d7a1b3ef (bug 1436659)
Backed out changeset 4ae911f19aee (bug 1436659)
Backed out changeset e9381081ab6a (bug 1436659)
Backed out changeset 7301bfeeb65c (bug 1436659)
Backed out changeset 607dccfa8387 (bug 1436659)
Backed out changeset 8f61bf3de90a (bug 1436659)
Backed out changeset 920aa51ae3a2 (bug 1436659)
Backed out changeset bfa0d1a4bf1c (bug 1436659)
Backed out changeset 467dd218d3d3 (bug 1436659)
Backed out changeset 737ff1676ff0 (bug 1436659)
Backed out changeset 071666b6c7e9 (bug 1436659)
Backed out changeset c2932cd4839f (bug 1436659)
Backed out changeset a9777027b7ad (bug 1436659)

--HG--
rename : testing/web-platform/tests/web-animations/timing-model/animations/setting-the-playback-rate-of-an-animation.html => testing/web-platform/tests/web-animations/interfaces/Animation/playbackRate.html
rename : testing/web-platform/tests/web-animations/timing-model/animations/the-current-time-of-an-animation.html => testing/web-platform/tests/web-animations/timing-model/animations/current-time.html
rename : testing/web-platform/tests/web-animations/timing-model/animations/setting-the-start-time-of-an-animation.html => testing/web-platform/tests/web-animations/timing-model/animations/set-the-animation-start-time.html
rename : testing/web-platform/tests/web-animations/timing-model/animations/setting-the-target-effect-of-an-animation.html => testing/web-platform/tests/web-animations/timing-model/animations/set-the-target-effect-of-an-animation.html
rename : testing/web-platform/tests/web-animations/timing-model/animations/setting-the-timeline-of-an-animation.html => testing/web-platform/tests/web-animations/timing-model/animations/set-the-timeline-of-an-animation.html
2018-02-14 22:40:07 +02:00
Brian Birtles
c8299638c0 Bug 1436659 - Implement pending playback rate mechanism; r=hiro
This reflects the following changes to the Web Animations specification:

  1. 5af5e276ba
  2. 673f6fc126

which can be viewed as a merged diff at:

  https://gist.github.com/birtles/d147eb2e0e2d4d37fadf217abd709411

MozReview-Commit-ID: 3DoaWUkxBTo

--HG--
extra : rebase_source : a131054cc0d31a5db6b01ad288cf3b2cb0cc7016
2018-02-13 15:04:18 +09:00
Brian Birtles
70013cea9d Bug 1436659 - Add Animation::GetCurrentTimeForHoldTime helper; r=hiro
We will use this to calculate the unconstrained current time when we implement
pending playback rate changes.

MozReview-Commit-ID: 7GlmHiGeXF6

--HG--
extra : rebase_source : 82280cdd62c0426c114ce54bb92fcd7ed766d85a
2018-02-13 15:04:18 +09:00
Brian Birtles
37e9e76ea5 Bug 1436659 - Factor out static time calculation methods on Animation; r=hiro
We will re-use these methods to perform various calculations once we introduce
the pending playback rate.

MozReview-Commit-ID: 2HV44TTNxHg

--HG--
extra : rebase_source : dcc883fb6db897a799900d709ca9c182dc149764
2018-02-13 15:04:18 +09:00
Brian Birtles
31272ef315 Bug 1436659 - Add Animation.updatePlaybackRate WebIDL definition; r=bz
This is the IDL added to the Web Animations specification:

  5af5e276ba

Note that some of the changes in the above commit were reverted in the following
commit:

  673f6fc126

A folded version of the changes:

  https://gist.github.com/birtles/d147eb2e0e2d4d37fadf217abd709411

MozReview-Commit-ID: CJV7bzizXg4

--HG--
extra : rebase_source : 6dc6819e158bcdd094962769096a17da6cd2026a
2018-02-13 15:04:18 +09:00
Hiroyuki Ikezoe
665b294c28 Bug 1237454 - Unthrottle transform animations in visibility:hidden element periodically only if the element is scrolled out. r=birtles
In the case where we throttle transform animations in visibility:hidden
element, we just need to unthrottle only if the element is scrolled out since
unlike the scrolled out element, visibility:hidden element keeps invisible
even after the element moved into view.

MozReview-Commit-ID: 7X2SsOLz4Y5

--HG--
extra : rebase_source : ca7210f7ed637f858127c4008fe98fbeec874a10
2018-02-09 19:00:19 +09:00
Hiroyuki Ikezoe
54a0194045 Bug 1237454 - Throttle animations on visibility:hidden element. r=birtles,boris,emilio
This patch does basically throttle animations on visibility:hidden element
and unthrottle it once the animating element became visible or a child of the
animating element became visible.  But still there are some cases that we don't
throttle such animations perfectly.  For example;

  div.style.visibility = 'hidden'; // the 'div' has no children at this moment
  div.animate(..);
  // The animation is throttled

  div.appendChild(visibleChild);
  // The animation isn't throttled

  visibleChild.style.visibility = 'hidden';
  // Now the animation should be throttled again, but actually it's not.

To throttle this case properly, when the |visibleChild|'s visibility changed
to hidden, we would need to do either

 1) Check all siblings of the |visibleChild| have no visible children

or

 2) The parent element stores visible children count somewhere and decrease it
    and check whether the count is zero

To achieve 1) we need to walk up ancestors and their siblings, actually it's
inefficient.

2) is somewhat similar to what we already do for animating images but it's hard
to reuse it for CSS animations since it does not take into account that
descendants' visibilities.

Another example that this patch does not optimize is the the case where
animating element has children whose visibility is inherited and the element
itself initially visible something like this;

  let child = document.createElement('div'); // child visibility is 'inherit'
  div.appendChild(child);

  div.animate(..); // the 'div' is visible
  // The animation isn't throttled since the animating element is visible

  div.style.visiblily = 'hidden';
  // Now the animation should be throttled, but it's not since this patch does
  // not descend down all descendants to check they are invisible or not when the
  // animating element visibility changed to hidden.

This patch adds a test case for this case introduced with todo_is().

Another test case added in this patch fails if we don't use
nsPlaceholderFrame::GetRealFrameFor() in HasNoVisibleDescendants().

MozReview-Commit-ID: BJwzQvP9Yc4

--HG--
extra : rebase_source : e56505706bb2799b59bbfb3bbcce4a9ce86892f4
2018-02-09 10:43:10 +09:00
Hiroyuki Ikezoe
024e9bf76c Bug 1237454 - Test for an animation on visibility: hidden element which has grandchild. r=boris
MozReview-Commit-ID: C0yLy4clwbY

--HG--
extra : rebase_source : f535ab7c981ae4574cbd4ae5e4cf92f08f43679a
2018-02-09 10:43:10 +09:00
Hiroyuki Ikezoe
2b3923c536 Bug 1237454 - Test for an animation on a visibility:hidden element which has a child. r=boris
MozReview-Commit-ID: AfmQJThhp8d

--HG--
extra : rebase_source : b693600cee1ed166b8a4104bd0566c425abbc2ab
2018-02-09 10:43:10 +09:00
Hiroyuki Ikezoe
b9fbc876db Bug 1237454 - Test for an animation in the parent element whose visibility is changed. r=boris
MozReview-Commit-ID: BBMOuPimlPH

--HG--
extra : rebase_source : 68f045fbe4e72b3ce8cc344058f3ae561637468d
2018-02-09 10:43:10 +09:00
Hiroyuki Ikezoe
ed45df9024 Bug 1237454 - An additional check that an animation on visibility: hidden element starts restyling when the element gets visible. r=boris
MozReview-Commit-ID: 2Lvk2IqEaXY

--HG--
extra : rebase_source : 710553c6e404afe8a948171d1263c03b9d79e21e
2018-02-09 10:43:10 +09:00
Hiroyuki Ikezoe
40907715ce Bug 1237454 - Add VisibilityChange change hint. r=emilio
This new change hint doesn't influence layout so that it can be regarded
as nsChangeHint_Hints_CanIgnoreIfNotVisible.  Note that if visibility changed
from collapse or to collapse, we set NS_STYLE_HINT_REFLOW separetely.

MozReview-Commit-ID: AirDWeBYVKG

--HG--
extra : rebase_source : a462845ac2d8280986bb8db5e6482bf401f65322
2018-02-09 10:43:10 +09:00
Tom Ritter
aa82f54ab6 Bug 1435296 Address test failures caused by bumping timer precision to 2 ms r=baku
There are a few different reasons why tests needed updating (not an exhaustive list):

- Tests assume that successive operations take place at different times.
- Tests assume that an operation took a minimum amount of time.
- Tests hardcodes a specific delay.

In most cases we hardcode the preference off. In some cases this is the best approach,
in others, we would like to improve. The bug for tracking those improvements is Bug 1429648

An improvement that is present in some tests is to hardcode a specific precision reduction
that is acceptable based on the confides of the test. (Obviously this needs to be a fix for
the test framework and not a requirement on the feature being tested.)

In a few places, the test itself can be fixed, for example to no longer require the end
time of an operation to be strictly greater than the start time, and allows it to be equal
to it.

MozReview-Commit-ID: J59c7xQtZZJ

--HG--
extra : rebase_source : df8a03e76eaf9cdc9524dbb3eb9035af237e534b
2018-02-12 11:39:41 -06:00
Tom Ritter
8184fa2b43 Bug 1435296 Do not apply timer clamping to CSS animations. r=birtles
This patch creates the capability to have callsites specify if timestamps
should be clamped only in Resist Fingerprinting Mode, or in the more expansive
Timer PRecision Reduction Mode.

Then it changes the CSS Animation callsite to only apply in RFP Mode.

This avoids regressing RFP.

MozReview-Commit-ID: B1pSri0kRk6

--HG--
extra : rebase_source : f3d8c1f9561fbb19d1ca8594ba2b69cffd25445b
2018-02-07 16:50:57 -06:00
Hiroyuki Ikezoe
d72d0dee6b Bug 1436642 - Make target element size larger to be unable to send transform animations to the compositor. r=jaws
The original value were too small for Android.

MozReview-Commit-ID: 4V6qC8orYNJ

--HG--
extra : rebase_source : 55ea0525bfaafa60d8e5d711cc70dd29d21acc78
2018-02-10 06:52:23 +09:00
Hiroyuki Ikezoe
f22da31267 Bug 1437248 - Disable privacy.reduceTimerPrecision on test_restyles.html. r=arai
In this test we need to know precise time for checking that we unthrottle
throttled transform animations periodically.

MozReview-Commit-ID: ICLf448KFLr

--HG--
extra : rebase_source : 26128735231679031bd1e727cf9d9016054e7664
2018-02-10 15:31:05 +09:00
Csoregi Natalia
7f21ecd2bf Backed out 4 changesets (bug 1435296) for for failing devtools' browser_webconsole_check_stubs_console_api.js and mochitest's dom/smil/test/test_smilTimeEvents.xhtml. CLOSED TREE
Backed out changeset 1f07c08daa41 (bug 1435296)
Backed out changeset 89c121b45b30 (bug 1435296)
Backed out changeset be9496eff7b8 (bug 1435296)
Backed out changeset 2f94f155318e (bug 1435296)
2018-02-09 17:20:53 +02:00
Tom Ritter
b5eec93654 Bug 1435296 Do not apply timer clamping to CSS animations. r=birtles
This patch creates the capability to have callsites specify if timestamps
should be clamped only in Resist Fingerprinting Mode, or in the more expansive
Timer PRecision Reduction Mode.

Then it changes the CSS Animation callsite to only apply in RFP Mode.

This avoids regressing RFP.

MozReview-Commit-ID: B1pSri0kRk6

--HG--
extra : rebase_source : 5c1a3a1bb7cb10cd5c4a608f30bf097bd7e119b9
2018-02-07 16:50:57 -06:00
Hiroyuki Ikezoe
fff9e9f366 Bug 1419339 - Unthrottle transform animations periodically if there is any IntersectionObservers. r=birtles
MozReview-Commit-ID: CBFQva02HUc

--HG--
extra : rebase_source : 123a26e7ab77ba40abd918e91e7f323300b2aae7
2018-02-07 10:46:15 +09:00
Narcis Beleuzu
b0e8772dcd Backed out 6 changesets (bug 1237454) for bc failures on /browser_toolbariconcolor_restyles.js. CLOSED TREE
Backed out changeset f8d771835fd2 (bug 1237454)
Backed out changeset 2dbbfc331bdf (bug 1237454)
Backed out changeset c481f409feaa (bug 1237454)
Backed out changeset 0b9872865f0e (bug 1237454)
Backed out changeset 43ca55e7c93b (bug 1237454)
Backed out changeset 027b0c65d944 (bug 1237454)
2018-02-06 11:19:56 +02:00
Hiroyuki Ikezoe
835e2883de Bug 1237454 - Throttle animations on visibility:hidden element. r=birtles,boris,emilio
This patch does basically throttle animations on visibility:hidden element
and unthrottle it once the animating element became visible or a child of the
animating element became visible.  But still there are some cases that we don't
throttle such animations perfectly.  For example;

  div.style.visibility = 'hidden'; // the 'div' has no children at this moment
  div.animate(..);
  // The animation is throttled

  div.appendChild(visibleChild);
  // The animation isn't throttled

  visibleChild.style.visibility = 'hidden';
  // Now the animation should be throttled again, but actually it's not.

To throttle this case properly, when the |visibleChild|'s visibility changed
to hidden, we would need to do either

 1) Check all siblings of the |visibleChild| have no visible children

or

 2) The parent element stores visible children count somewhere and decrease it
    and check whether the count is zero

To achieve 1) we need to walk up ancestors and their siblings, actually it's
inefficient.

2) is somewhat similar to what we already do for animating images but it's hard
to reuse it for CSS animations since it does not take into account that
descendants' visibilities.

Another example that this patch does not optimize is the the case where
animating element has children whose visibility is inherited and the element
itself initially visible something like this;

  let child = document.createElement('div'); // child visibility is 'inherit'
  div.appendChild(child);

  div.animate(..); // the 'div' is visible
  // The animation isn't throttled since the animating element is visible

  div.style.visiblily = 'hidden';
  // Now the animation should be throttled, but it's not since this patch does
  // not descend down all descendants to check they are invisible or not when the
  // animating element visibility changed to hidden.

This patch adds a test case for this case introduced with todo_is().

Another test case added in this patch fails if we don't use
nsPlaceholderFrame::GetRealFrameFor() in HasNoVisibleDescendants().

MozReview-Commit-ID: BJwzQvP9Yc4

--HG--
extra : rebase_source : ceb95bdce1042cbfc16751d6d023fc6feee5845e
2018-02-06 08:43:53 +09:00
Hiroyuki Ikezoe
dd32a9658a Bug 1237454 - Test for an animation on visibility: hidden element which has grandchild. r=boris
MozReview-Commit-ID: C0yLy4clwbY

--HG--
extra : rebase_source : 0203237cf1bc45941188393e7d9ed7e96072ae91
2018-02-06 08:43:52 +09:00
Hiroyuki Ikezoe
6b8d6a0897 Bug 1237454 - Test for an animation on a visibility:hidden element which has a child. r=boris
MozReview-Commit-ID: AfmQJThhp8d

--HG--
extra : rebase_source : ed4abf7fb865cf8459294f086a63b13bf0d57373
2018-02-06 08:43:52 +09:00
Hiroyuki Ikezoe
3f041debf1 Bug 1237454 - Test for an animation in the parent element whose visibility is changed. r=boris
MozReview-Commit-ID: BBMOuPimlPH

--HG--
extra : rebase_source : b73d6890ddf11f58cd7b623f92a73d7e4bd26e08
2018-02-06 08:43:52 +09:00
Hiroyuki Ikezoe
862a7ba92f Bug 1237454 - An additional check that an animation on visibility: hidden element starts restyling when the element gets visible. r=boris
MozReview-Commit-ID: 2Lvk2IqEaXY

--HG--
extra : rebase_source : 39cea20c92996b6a785576ded71b5c17f61d3457
2018-02-06 08:43:52 +09:00
Hiroyuki Ikezoe
0de04971ef Bug 1237454 - Add VisibilityChange change hint. r=emilio
This new change hint doesn't influence layout so that it can be regarded
as nsChangeHint_Hints_CanIgnoreIfNotVisible.  Note that if visibility changed
from collapse or to collapse, we set NS_STYLE_HINT_REFLOW separetely.

MozReview-Commit-ID: AirDWeBYVKG

--HG--
extra : rebase_source : 1cd03a78a522b1a6965ba73ebf002ddacb0ab4f2
2018-02-06 08:43:52 +09:00
Boris Zbarsky
7a9f022f1a Bug 1434819 part 7. Remove the SHOW_* constants from nsIDOMNodeFilter. r=qdot
MozReview-Commit-ID: 7E2KZkLfbSI
2018-02-01 14:26:12 -05:00
Cameron McCormack
2cea1ba7c1 Bug 1430014 - Part 6: #ifdef out a bit more animation-related code. r=hiro
MozReview-Commit-ID: B9TaVJFak26

--HG--
extra : source : 820eed2682b6a6cda892d091ee037ff1eeacd69f
2018-02-01 15:04:04 +11:00
Cameron McCormack
d02e54b79b Bug 1430014 - Part 5: Stop building old style system classes when MOZ_OLD_STYLE is not defined. r=xidorn
MozReview-Commit-ID: CIHyPdF7Exl

--HG--
extra : source : 78a2fc781eead47af3923efcde58569c5d882ab1
2018-02-01 15:04:04 +11:00
Cameron McCormack
cc7db5c40c Bug 1430014 - Part 4: #ifdef out unnecessary code when the old style system is not built. r=xidorn
MozReview-Commit-ID: 1FZ9VzjcPzN

--HG--
extra : source : de22d220635f8c059834b76f769d5215ab1a8b5b
2018-02-01 15:04:04 +11:00
cku
af86c724c9 Bug 1207734 - Part 4.c. Temporarily disable async-transform for individual-transform. r=birtles
Since we do not support async-transform for individual-transform yet.

MozReview-Commit-ID: gfOzHpjOnQ
(grafted from dd508458f70d5473256a4bfe5a2f6bc665bbac9d)

--HG--
extra : source : dd508458f70d5473256a4bfe5a2f6bc665bbac9d
2018-01-05 14:45:05 +08:00
Hiroyuki Ikezoe
eeefe00d01 Bug 1433008 - Make AnimationEventInfo, InternalTransitionEvent and InternalAnimationEvent movable. r=masayuki
And disallow using copy constructor and copy assignment for the structs.

MozReview-Commit-ID: 7jSktlu1SqN

--HG--
extra : rebase_source : cc8bcb1f95843a2a46a044e226c299a6196ef2a2
2018-01-30 09:26:48 +09:00
Hiroyuki Ikezoe
4d9188d86d Bug 1433846 - Drop nsComputedDOMStyle::GetPresShellForContent(), use nsContentUtils::GetPresShellForContent(). r=xidorn
MozReview-Commit-ID: JcpEpqP32Yi

--HG--
extra : rebase_source : dc3649c882f7edd36f9dbc3463d186517b18bdc1
2018-01-29 14:19:25 +09:00
Hiroyuki Ikezoe
0bb119e341 Bug 1428692 - Don't use tweakExpectedRestyleCount in the case where we don't use the returned count for observeStyling called right after. r=birtles
tweakExpectedRestyleCount() is supposed to work with observeStyle() which is
called right after tweakExpectedRestyleCount().  That's because
tweakExpectedRestyleCount() adjusts the expected restyle count which will
happen in continuous frames that begins from the startsRightNow() call,
especially a redundant restyle might be observed in the last frame if the
animation did not begin at the current timeline time and if the Promise inside
the last requestAnimationFrame is fulfilled after restyling happened.

Instead of using tweakExpectedRestyleCount(), we need to check whether the
animation begun at the current timeline time when the animation started, and if
the animation begun at the current timeline time, we don't observe the
superfluous restyle in a frame after the animation element was re-attached.

MozReview-Commit-ID: 6TLQERSSbjU

--HG--
extra : rebase_source : 1a1dcb56b889bebedb44346bbc315ec01870cf79
2018-01-30 06:41:31 +09:00
Hiroyuki Ikezoe
fedb7434fb Bug 1415780 - Call UpdateTiming() prior to remove the animtion from the timeline in Animation::CancelNoUpdate. r=birtles
Now AnimationEventDispatcher ensures that the refresh driver's next tick
happens for cancel event, so we don't need to re-observe the timeline
(it happens in UpdateTiming) once after removing the animation from the
timeline.

MozReview-Commit-ID: 7ivclmYIkPa

--HG--
extra : rebase_source : 286b3d5d29208496bfe8405819b44b5f52f6671c
2018-01-27 21:17:27 +09:00
Hiroyuki Ikezoe
175bc2d176 Bug 1415780 - Let AnimationEventDispatcher observe nsRefreshDriver. r=birtles
So that we can now ensure nsRefreshDriver ticks (i.e. nsRefreshDriver doesn't
stop its timer) for all queued events.
Before this patch, dispatching CSS animation/transition events relied on the
fact that DocumentTimeline observes nsRefreshDriver.  For this fact,
animationcancel or transitioncancel event did not dispatch properly in some
cases, i.e. the case where the animation was dropped from the DocumentTimeline.

MozReview-Commit-ID: 7JYro0MY2U2

--HG--
extra : rebase_source : 28c8e2a50d29c5344e2c5ca3c43af41f4692fa0f
2018-01-27 21:17:27 +09:00
Hiroyuki Ikezoe
7061542dd0 Bug 1415780 - Make AnimationEventDispatcher::SortEvents() private. r=birtles
Now we sort pending events only when dispatching the events, i.e.
only inside DispatchEvent().

MozReview-Commit-ID: BZbuF8gD39b

--HG--
extra : rebase_source : 2a90697356d980b1fd1329d34936eaef1179d12f
2018-01-27 21:17:27 +09:00
Hiroyuki Ikezoe
7828b6be59 Bug 1415780 - Let nsPresContext have AnimationEventDispatcher. r=birtles
Now we sort CSS animation/transition events by scheduled event time prior
to compositor order.

SortEvents() will be a private method in the next patch in this patch
series.

MozReview-Commit-ID: ICkOayquN0f

--HG--
extra : rebase_source : 405c8232e93c54a073c722a4332873af02daa870
2018-01-27 21:17:27 +09:00
Hiroyuki Ikezoe
21a53275cd Bug 1415780 - Make AnimationEventDispatcher refcountable. r=birtles
In a subsequent patch in this patch series, we want to make nsPresContext
have an AnimationEventDispatcher as RefPtr<>.

Instead, if we were trying to make nsPresContext have the
AnimationEventDispatcher as data object (not RefPtr<>) just like we did in
CommonAnimationManager, we will fall into header inclusion hell since Element.h
includes nsPresContext.h and AnimationEventDispatcher.h ends up including
Element.h.  Even if we could solve the inclusion hell, we will suffer from Rust
bindgen issues for some reasons.

MozReview-Commit-ID: B0nX2JzIRJD

--HG--
extra : rebase_source : 4eb998876b2fc39de8d09cac09c19e1a51cd382e
2018-01-27 21:17:27 +09:00
Hiroyuki Ikezoe
75fc208a71 Bug 1415780 - De-templatize AnimationEventDispatcher. r=birtles,masayuki
Now single AnimationEventDispatcher can handle both CSS animation/transition
events simultaneously.  To do this we had to change AnimationEventInfo and
TransitionEventInfo into a single struct, the struct is also named
AnimationEventInfo.

It results we can sort both CSS animation/transition events altogether.  Thus
we make sure CSS animation/transition events are sorted by scheduled event time
prior to their composite order (i.e. transitions is prior to animations).

At this moment, we don't sort both events altogether since nsAnimationManager
and nsTransitionManager has an AnimationEventDispatcher respectively.  In the
next patch we move AnimationEventDispatcher into nsPresContext, i.e. each
document has an AnimationEventDispatcher without the distinction between
CSS animations and transitions.

Note that, after this patch, we copy all members in InternalTransitionEvent and
InternalAnimationEvent in the copy-constructor of AnimationEventInfo, this
will be fixed once WidgetEvent has move-constructor and move-assignment
(bug 1433008).

MozReview-Commit-ID: 5JAh6N7C6ee

--HG--
extra : rebase_source : 50da76f51cf65cdd1245d93d8b48aaf0ae0ec94b
2018-01-27 21:17:27 +09:00
Hiroyuki Ikezoe
45ef4d82a6 Bug 1415780 - Split AnimationEventDipatcher into an independent file. r=birtles
MozReview-Commit-ID: Fcqtu7G400Z

--HG--
extra : rebase_source : 50de08148dcd4e4db0ea9a9ad1b501718852ca78
2018-01-27 21:17:27 +09:00
Cosmin Sabou
887d9fa276 Backed out 12 changesets (bug 1415780) for build bustages nsRefreshDriver.cpp:1606:1 and AnimationCommon.h:168:51 on a CLOSED TREE
Backed out changeset 1fa2f138319e (bug 1415780)
Backed out changeset 6bad89a17566 (bug 1415780)
Backed out changeset a88250ad7a3e (bug 1415780)
Backed out changeset 43d42ca7308f (bug 1415780)
Backed out changeset 79e980195ee8 (bug 1415780)
Backed out changeset f0cc29e7ccd7 (bug 1415780)
Backed out changeset c6567e4196f6 (bug 1415780)
Backed out changeset ae7be65f3c88 (bug 1415780)
Backed out changeset 621b9aaf4a8f (bug 1415780)
Backed out changeset e298f242ce7c (bug 1415780)
Backed out changeset 027a7ed3c948 (bug 1415780)
Backed out changeset 433a6f0d0ac3 (bug 1415780)
2018-01-27 12:47:29 +02:00
Hiroyuki Ikezoe
2046465f79 Bug 1415780 - Call UpdateTiming() prior to remove the animtion from the timeline in Animation::CancelNoUpdate. r=birtles
Now AnimationEventDispatcher ensures that the refresh driver's next tick
happens for cancel event, so we don't need to re-observe the timeline
(it happens in UpdateTiming) once after removing the animation from the
timeline.

MozReview-Commit-ID: 7ivclmYIkPa

--HG--
extra : rebase_source : d111c63baac0ad3005723c1c76bad08e975555ec
2018-01-27 16:55:46 +09:00
Hiroyuki Ikezoe
51d411f1b6 Bug 1415780 - Let AnimationEventDispatcher observe nsRefreshDriver. r=birtles
So that we can now ensure nsRefreshDriver ticks (i.e. nsRefreshDriver doesn't
stop its timer) for all queued events.
Before this patch, dispatching CSS animation/transition events relied on the
fact that DocumentTimeline observes nsRefreshDriver.  For this fact,
animationcancel or transitioncancel event did not dispatch properly in some
cases, i.e. the case where the animation was dropped from the DocumentTimeline.

MozReview-Commit-ID: 7JYro0MY2U2

--HG--
extra : rebase_source : e1963d9eef996cdf5d64c64f80eb1b93ac6fd18a
2018-01-27 16:55:45 +09:00
Hiroyuki Ikezoe
9e4cc95a63 Bug 1415780 - Make AnimationEventDispatcher::SortEvents() private. r=birtles
Now we sort pending events only when dispatching the events, i.e.
only inside DispatchEvent().

MozReview-Commit-ID: IRqH56BEnKb

--HG--
extra : rebase_source : dd2b8528fdc36d1371815feaf07ead0b258fe453
2018-01-27 16:55:45 +09:00
Hiroyuki Ikezoe
99f98b1bd6 Bug 1415780 - Let nsPresContext have AnimationEventDispatcher. r=birtles
Now we sort CSS animation/transition events by scheduled event time prior
to compositor order.

SortEvents() will be a private method in the next patch in this patch
series.

MozReview-Commit-ID: ICkOayquN0f

--HG--
extra : rebase_source : 52226c33a511451c31d4c3fef94ff02de8462256
2018-01-27 16:55:45 +09:00
Hiroyuki Ikezoe
f61cc0132a Bug 1415780 - Make AnimationEventDispatcher refcountable. r=birtles
In a subsequent patch in this patch series, we want to make nsPresContext
have an AnimationEventDispatcher as RefPtr<>.

Instead, if we were trying to make nsPresContext have the
AnimationEventDispatcher as data object (not RefPtr<>) just like we did in
CommonAnimationManager, we will fall into header inclusion hell since Element.h
includes nsPresContext.h and AnimationEventDispatcher.h ends up including
Element.h.  Even if we could solve the inclusion hell, we will suffer from Rust
bindgen issues for some reasons.

MozReview-Commit-ID: B0nX2JzIRJD

--HG--
extra : rebase_source : cd010ca5fe5b1f9fa8f519fdab0dc47d6e519bef
2018-01-27 16:55:44 +09:00
Hiroyuki Ikezoe
f2ce7c4704 Bug 1415780 - De-templatize AnimationEventDispatcher. r=birtles,masayuki
Now single AnimationEventDispatcher can handle both CSS animation/transition
events simultaneously.  To do this we had to change AnimationEventInfo and
TransitionEventInfo into a single struct, the struct is also named
AnimationEventInfo.

It results we can sort both CSS animation/transition events altogether.  Thus
we make sure CSS animation/transition events are sorted by scheduled event time
prior to their composite order (i.e. transitions is prior to animations).

At this moment, we don't sort both events altogether since nsAnimationManager
and nsTransitionManager has an AnimationEventDispatcher respectively.  In the
next patch we move AnimationEventDispatcher into nsPresContext, i.e. each
document has an AnimationEventDispatcher without the distinction between
CSS animations and transitions.

Note that, after this patch, we copy all members in InternalTransitionEvent and
InternalAnimationEvent in the copy-constructor of AnimationEventInfo, this
will be fixed once WidgetEvent has move-constructor and move-assignment
(bug 1433008).

MozReview-Commit-ID: 5JAh6N7C6ee

--HG--
extra : rebase_source : 06ef844f41cfe81b9a629340b5a328c1bed80e8e
2018-01-27 16:55:44 +09:00
Hiroyuki Ikezoe
cd43017099 Bug 1415780 - Split AnimationEventDipatcher into an independent file. r=birtles
MozReview-Commit-ID: Fcqtu7G400Z

--HG--
extra : rebase_source : e90a03ef74a7c53a068227672f9e727d31d11707
2018-01-27 16:55:44 +09:00
Hiroyuki Ikezoe
3dc42221b8 Bug 1432104 - KeyframeUtils::GetAnimationPropertiesFromKeyframes needs specializations both for GeckoStyleContext* and const ServoStyleContext*. r=birtles
The implementation of the template function is defined in KeyframeUtils.cpp,
whereas the caller is inside KeyframeEffectReadOnly.cpp.  I guess it's been
compiled accidentally because of unified builds.

MozReview-Commit-ID: 9GeIT7nDpLG

--HG--
extra : rebase_source : ce58ac6a013ff45d402c51994eb4f0bc28a2c671
2018-01-22 19:19:41 +09:00
Hiroyuki Ikezoe
2529df076a Bug 1430654 - Use assert_times_equal for comparing timing values. r=birtles
MozReview-Commit-ID: CUn1f8M0jo5

--HG--
extra : rebase_source : 1ac203d28022707f1b34757a1613e6f201a1f706
2018-01-22 14:57:57 +09:00
Hiroyuki Ikezoe
0a91cefd01 Bug 1430654 - Double epsilon value for assert_times_equal. r=birtles
Since the function assumes that both of actual and expected values
have the same precision requirements.

MozReview-Commit-ID: 4C3TAH6mUVg

--HG--
extra : rebase_source : 1e40e489745b0d9047d34e851a5f043db616323e
2018-01-22 14:57:57 +09:00
Hiroyuki Ikezoe
fae9243927 Bug 1430654 - Introduce assert_time_equals_literal and use it. r=birtles
This assertion is supposed to be used where the first argument has a tolerance
but the second argument doesn't have such tolerance.  Whereas
assert_times_equal() is supposed to be used for the case both arguments have
the same tolerance, actually it hasn't, it will be fixed in a subsequent patch
in this patch series.

MozReview-Commit-ID: FEDHilbX2rm

--HG--
extra : rebase_source : e773902b474bd9a411e7bb3f234702a93547ebba
2018-01-22 14:55:16 +09:00
Hiroyuki Ikezoe
5c74787c9b Bug 1431295 - Drop 'undef None' macro in dom/animation/. r=boris
MozReview-Commit-ID: BkV6vCc4rmt

--HG--
extra : rebase_source : 9a1ef446045adeb7bbab6814c147947e30626b29
2018-01-18 14:12:51 +09:00
Wei-Cheng Pan
e8f46bbec4 Bug 1425213 - Unthrottle transform animations regardless in overflowable frames or not. r=hiro
Because we don't know whether the transformed position will be visible or not.
2018-01-17 22:44:00 +02:00
Hiroyuki Ikezoe
fa8cb05830 Bug 1430975 - Don't pass a copy of StickyTimeDuration. r=boris
MozReview-Commit-ID: HlQlMB1FBRi

--HG--
extra : rebase_source : 19888f1aa8cb98ecb1ee0aeaa46c8e4015e12867
2018-01-17 18:05:03 +09:00
Hiroyuki Ikezoe
ddaf0ef84e Bug 1419079 - Don't bail out from CalculateCumulativeChangeHint() in the case of opacity property even if there is a missing keyframe or composite operation is not 'replace'. r=birtles
For opacity property, we only generate nsChangeHint_UpdateUsesOpacity,
nsChangeHint_UpdateOpacityLayer and nsChangeHint_RepaintFrame.  All of them are
included in nsChangeHint_Hints_CanIgnoreIfNotVisible.  So we can throttle
opacity animations on out-of-view elements whatever underlying opacity value is.

MozReview-Commit-ID: FdQJbItAndG

--HG--
extra : rebase_source : d011270e4e3e1adc1782665a592fb3fac60f9174
2018-01-17 11:48:20 +09:00
Hiroyuki Ikezoe
b72cfe5bff Bug 1419079 - Add a test case for additive animation with a missing keyframe. r=birtles
MozReview-Commit-ID: 5UWfDIx7RVi

--HG--
extra : rebase_source : 17c9e62f66c7fef101a6b2a4f93e4348e94721cf
2018-01-17 08:55:00 +09:00
Hiroyuki Ikezoe
cb10669b24 Bug 1419079 - Revise a comment for a test case for missing keyframes. r=birtles
The animation in the test case is not actually additive animation, it's just a
missing keyframe animation and its composite operation is actually 'replace'.

MozReview-Commit-ID: 4A29V5Ke2hF

--HG--
extra : rebase_source : 63b6c7f52943786d06c52b9baa7e0f4f151781ac
2018-01-17 08:55:00 +09:00
Hiroyuki Ikezoe
c5899c8bd2 Bug 1419079 - Drop checking the pref for offscreen throttling. r=birtles
The pref has been enabled by default since firefox 49, so it's not worth
checking the pref in test.

MozReview-Commit-ID: 5ADIFaV1ue

--HG--
extra : rebase_source : 8490cc7988cc1e7fe3a650c4f1334b4ed11c7105
2018-01-17 08:55:00 +09:00
Hiroyuki Ikezoe
65c0f821c8 Bug 1419079 - Drop checking the pref for animations-api core in file_restyles.html. r=birtles
It's already specified to true in test_restyles.html.

MozReview-Commit-ID: JMItunKYwIs

--HG--
extra : rebase_source : d54368a93857d8d2a86220be55091735caa074e9
2018-01-17 08:55:00 +09:00
Brian Birtles
5a753e5e80 Bug 1429671 - Make composite member of Keyframe dictionary objects accept null values; r=bz
This patch reflects the following change to the Web Animations spec:

  abf76745b5

MozReview-Commit-ID: A2GD1igUf5f

--HG--
extra : rebase_source : 8129f6386b144adebc3bf0320ca7d6bfbba7a2e9
2018-01-11 16:20:49 +09:00
Tom Ritter
3af00498bc Bug 1429668 Turn off the reduceTimerPrecision pref for one more test r=hiro
MozReview-Commit-ID: J7F502Oz3Uc

--HG--
extra : rebase_source : 6b9883e72fad25d985ba61a999a4bdd2468784b0
2018-01-10 23:06:04 -06:00
Tom Ritter
2eeb5f801e Bug 1424341 Turn the pref off for existing tests that perform fine-grained timing comparisons r=mrbkap
MozReview-Commit-ID: 4ZyE4ebaCaB

--HG--
extra : rebase_source : 80a138ba722c64885a5f6811d862bdc76389a000
2018-01-10 14:46:34 -06:00
Hiroyuki Ikezoe
606a9e9a90 Bug 1421507 - Throttle animations in position:fixed element that the element is out of view. r=boris,tnikkel
MozReview-Commit-ID: jLvrcVhTKW

--HG--
extra : rebase_source : e2ff1e0158aa5207f86c47088283c22febe84197
2018-01-05 10:30:46 +09:00
Hiroyuki Ikezoe
9b4b9f9e65 Bug 1421507 - Test cases for position:absolute element. r=boris
MozReview-Commit-ID: IRPsvJ5WAQF

--HG--
extra : rebase_source : 5c6988a9af8392cc5abf54e56060dcf9653edffb
2018-01-05 10:30:17 +09:00
Hiroyuki Ikezoe
68625f879b Bug 1427868 - Run skipped test cases for scrolled-out elements on Android. r=birtles
These tests can be passed now, I don't know what fixed them, presumably
bug 1421476 and bug 1379515 fixed it.

MozReview-Commit-ID: 2srFKTWWvK

--HG--
extra : rebase_source : 418d366ade78d5a9994cb9bbbab39c4c0b42a2a4
2018-01-04 15:22:34 +09:00
Hiroyuki Ikezoe
b47d85dec0 Bug 1425009 - Take into account the possibility that the animation begins at the moment when the animation was detached from the document. r=birtles
MozReview-Commit-ID: wbM5JW7v76

--HG--
extra : rebase_source : c7ec443f86c6be573ac443f05fdf38a1ed97eefd
2018-01-04 10:19:08 +09:00
Csoregi Natalia
12c47a01be Merge inbound to mozilla-central r=merge a=merge 2017-12-21 12:01:59 +02:00
Brian Birtles
235c83fc0c Bug 1414000 - Assert that either the pres context is nullptr OR that there are no properties when filling in base styles; r=hiro
The call stack where this assertion would otherwise fail is as follows:

 KeyframeEffectReadOnly::UpdateProperties
   KeyframeEffectReadOnly::DoUpdateProperties
     KeyframeEffectReadOnly::BuildProperties
       KeyframeUtils::GetAnimationPropertiesFromKeyframes
         KeyframeUtils.cpp::GetComputedKeyframeValues
     KeyframeEffectReadOnly::EnsureBaseStyles

In bug 1407898 we made GetComputedKeyframes return an empty list when the pres
context is nullptr so if we get a null pres context in EnsureBaseStyles (which
uses the same method for getting the pres context:
nsContentUtils::GetContextForContent) we know that |aProperties| will be empty.
Also, if |aProperties| is empty we're not going to dereferences |presContext| so
we don't need to assert that it is non-null.

I have not included the crashtest in this patch for the same reason as described
in bug 1407898 comment 6.

MozReview-Commit-ID: 6OZ2yJfRLMV

--HG--
extra : rebase_source : b2a711a54623ea177560cf1b69b3c332654bc938
2017-12-20 17:34:57 +09:00
Hiroyuki Ikezoe
faa768c4fa Bug 1309198 - Test case that document is discarded while Document.getAnimations(). r=smaug 2017-12-21 11:40:23 +09:00
Hiroyuki Ikezoe
76f404fa5c Bug 1425771 - Add a branch in only_one_restyling_after_finish_is_called for the conformant Promise handling. r=birtles
Animation.finish() in a micro task for Animation.ready leads to a restyle and
a redundant restyle due to bug 1415457.  The redundant restyle has been observed
in a single frame without the conformant Promise handling.  But once we have the
conformant Promise handling we can tell it in a later frame.
(see https://bugzilla.mozilla.org/show_bug.cgi?id=1415457#c1 to know what's
going on there)

MozReview-Commit-ID: FoojunfYZ6k

--HG--
extra : rebase_source : 2820dce4513329fb648ef387d58cac469f680a6d
2017-12-18 14:19:39 +09:00
Hiroyuki Ikezoe
263cb0e605 Bug 1425771 - Tweak expected restyle count for the case where the animation begins at the current time. r=birtles
The expected restyle count depends both on animation state and micro task
handling.

If we have the conformant Promise handling and if the animation begins at the
current time, we will observe 1 less restyles than observed frames since we
skip the first restyle in the initial frame.  This represents correctly what
we do and what we *should* do.

If we don't have the conformant Promise handling and if the animation doesn't
begin at the current time, we will observe 1 more restyles than obsered frames
since the Promise in observeStyling (precisely the Promise is inside the
callback for requestAnimationFrame) is fulfilled once after a restyling process
followed by the requestAnimationFrame.

MozReview-Commit-ID: FLhSRx4y1V7

--HG--
extra : rebase_source : 59e2bb2439f69bc1415a441c0b84a81463d8229f
2017-12-18 14:19:26 +09:00
Hiroyuki Ikezoe
605f3607fa Bug 1425771 - Add a another variant of restyling_transform_animations_in_scrolled_out_element for the conformant Promise handling. r=birtles
The test case checks document timeline's currentTime to make sure that we are
in the first frame which happened after 200ms since the animation started.  It
is unfortunate for us from the point of view of restyling that the first frame
includes the restyling process in the frame without the conformant Promise
handling, doesn't include the process with the Promise handling.  So we need
to tweak there depends on the Promise handling.

I did intentionally add the forked version of the function with the same name
since branching depending on the conformant flag inside the original function
will be hard to understand and also we can easily remove the original version
once we have the conformant Promise handling.

FWIW, here is the diff between them:

@@ -365,6 +365,9 @@ waitForAllPaints(() => {

       await SpecialPowers.pushPrefEnv({ set: [["ui.showHideScrollbars", 1]] });

+      // Make sure we start from the state right after requestAnimationFrame.
+      await waitForFrame();
+
       var parentElement = addDiv(null,
         { style: 'overflow-y: scroll; height: 20px;' });
       var div = addDiv(null,
@@ -379,13 +382,17 @@ waitForAllPaints(() => {
       var markers;
       var now;
       while (true) {
-        markers = await observeStyling(1);
-        // Check restyle markers until 200ms is elapsed.
         now = document.timeline.currentTime;
         if ((now - timeAtStart) >= 200) {
+          // If the current time has elapsed over 200ms since the animation was
+          // created, it means that the animation should have already
+          // unthrottled in this tick, let's see what observes in this tick's
+          // restyling process.
+          markers = await observeStyling(1);
           break;
         }

+        markers = await observeStyling(1);
         is(markers.length, 0,
            'Transform animation running on the element which is scrolled out ' +
            'should be throttled until 200ms is elapsed');

MozReview-Commit-ID: 3WfY6aVnsXk

--HG--
extra : rebase_source : ddf51217f03fc1bfe421c344a7a7811dc591a9af
2017-12-18 14:18:17 +09:00
Hiroyuki Ikezoe
90dcb12748 Bug 1425771 - Add a function to check detect whether have conformant Promise handling and set the flag to represent it. r=birtles
MozReview-Commit-ID: FbzaUBKQ47F

--HG--
extra : rebase_source : ae936432d4ccb3e069608703c586d7134d52d12e
2017-12-18 14:17:44 +09:00
Kartikaya Gupta
4f18e92ffb Bug 1334189 - Enable mochitest-plain for linux64-qr. r=jrmuizel
MozReview-Commit-ID: nbcWhDq5de

--HG--
extra : rebase_source : 25e2c2b8b996ae11cd25dee07d9092ba574a9e40
2017-12-13 18:38:39 -05:00
Cosmin Sabou
4d17a4cc2e Backed out 4 changesets (bug 1425771) for ESlint failure r=backout on a CLOSED TREE
Backed out changeset 984d714aa987 (bug 1425771)
Backed out changeset 848047469b27 (bug 1425771)
Backed out changeset a28293b06afe (bug 1425771)
Backed out changeset 14c5ca99af0c (bug 1425771)
2017-12-18 08:37:10 +02:00
Hiroyuki Ikezoe
83ec4ebbf0 Bug 1425771 - Add a branch in only_one_restyling_after_finish_is_called for the conformant Promise handling. r=birtles
Animation.finish() in a micro task for Animation.ready leads to a restyle and
a redundant restyle due to bug 1415457.  The redundant restyle has been observed
in a single frame without the conformant Promise handling.  But once we have the
conformant Promise handling we can tell it in a later frame.
(see https://bugzilla.mozilla.org/show_bug.cgi?id=1415457#c1 to know what's
going on there)

MozReview-Commit-ID: FoojunfYZ6k

--HG--
extra : rebase_source : 2820dce4513329fb648ef387d58cac469f680a6d
2017-12-18 14:19:39 +09:00
Hiroyuki Ikezoe
8d960ec192 Bug 1425771 - Tweak expected restyle count for the case where the animation begins at the current time. r=birtles
The expected restyle count depends both on animation state and micro task
handling.

If we have the conformant Promise handling and if the animation begins at the
current time, we will observe 1 less restyles than observed frames since we
skip the first restyle in the initial frame.  This represents correctly what
we do and what we *should* do.

If we don't have the conformant Promise handling and if the animation doesn't
begin at the current time, we will observe 1 more restyles than obsered frames
since the Promise in observeStyling (precisely the Promise is inside the
callback for requestAnimationFrame) is fulfilled once after a restyling process
followed by the requestAnimationFrame.

MozReview-Commit-ID: FLhSRx4y1V7

--HG--
extra : rebase_source : 59e2bb2439f69bc1415a441c0b84a81463d8229f
2017-12-18 14:19:26 +09:00
Hiroyuki Ikezoe
71ad758afd Bug 1425771 - Add a another variant of restyling_transform_animations_in_scrolled_out_element for the conformant Promise handling. r=birtles
The test case checks document timeline's currentTime to make sure that we are
in the first frame which happened after 200ms since the animation started.  It
is unfortunate for us from the point of view of restyling that the first frame
includes the restyling process in the frame without the conformant Promise
handling, doesn't include the process with the Promise handling.  So we need
to tweak there depends on the Promise handling.

I did intentionally add the forked version of the function with the same name
since branching depending on the conformant flag inside the original function
will be hard to understand and also we can easily remove the original version
once we have the conformant Promise handling.

FWIW, here is the diff between them:

@@ -365,6 +365,9 @@ waitForAllPaints(() => {

       await SpecialPowers.pushPrefEnv({ set: [["ui.showHideScrollbars", 1]] });

+      // Make sure we start from the state right after requestAnimationFrame.
+      await waitForFrame();
+
       var parentElement = addDiv(null,
         { style: 'overflow-y: scroll; height: 20px;' });
       var div = addDiv(null,
@@ -379,13 +382,17 @@ waitForAllPaints(() => {
       var markers;
       var now;
       while (true) {
-        markers = await observeStyling(1);
-        // Check restyle markers until 200ms is elapsed.
         now = document.timeline.currentTime;
         if ((now - timeAtStart) >= 200) {
+          // If the current time has elapsed over 200ms since the animation was
+          // created, it means that the animation should have already
+          // unthrottled in this tick, let's see what observes in this tick's
+          // restyling process.
+          markers = await observeStyling(1);
           break;
         }

+        markers = await observeStyling(1);
         is(markers.length, 0,
            'Transform animation running on the element which is scrolled out ' +
            'should be throttled until 200ms is elapsed');

MozReview-Commit-ID: 3WfY6aVnsXk

--HG--
extra : rebase_source : ddf51217f03fc1bfe421c344a7a7811dc591a9af
2017-12-18 14:18:17 +09:00
Hiroyuki Ikezoe
25e6b9fd45 Bug 1425771 - Add a function to check detect whether have conformant Promise handling and set the flag to represent it. r=birtles
MozReview-Commit-ID: FbzaUBKQ47F

--HG--
extra : rebase_source : ae936432d4ccb3e069608703c586d7134d52d12e
2017-12-18 14:17:44 +09:00
Brian Birtles
0fec9ac501 Bug 1425548 - Update references to Web Animations spec in dom/animation; r=hiro
MozReview-Commit-ID: 1f2Mz0VhnBm

--HG--
extra : rebase_source : 30c952ed20ee64810d225e5778650dd01791964d
2017-12-15 14:55:08 -06:00
Brian Birtles
22ca1231e8 Bug 1422248 - Don't reject promises of dispatch cancel events when canceling idle animations; r=hiro
MozReview-Commit-ID: EGg6Ntj0loq

--HG--
extra : rebase_source : 8edd6fdd73440fe55fd8be1d524767fdaf55b872
2017-12-14 17:15:28 -06:00
00626c42d9 Bug 1413104 - Drop telemetry probes for layer size; r=botond
MozReview-Commit-ID: FtpTJDC50A8

--HG--
extra : rebase_source : 2e1ba62ae1cb462546ce552efccdde2fe1380a00
2017-12-14 21:36:09 +00:00
Hiroyuki Ikezoe
958d16759c Bug 1424949 - Wait for one more frame before checking animation start time to avoid the situation that the animation just begins at the time when it's ready. r=birtles
MozReview-Commit-ID: 6bNfl10TiT6

--HG--
extra : rebase_source : 095fd007710f8a7af13e2e7331f7326554f32cb7
2017-12-15 01:36:04 +09:00
Hiroyuki Ikezoe
c9071bce5c Bug 1424949 - Use assert_greater_than or assert_less_than in file_animations-dynamic-changes.html. r=birtles
MozReview-Commit-ID: I24yopOv51d

--HG--
extra : rebase_source : cd57a9649a3ff1335112f1240e1fcfe694a053d5
2017-12-15 01:24:57 +09:00
Hiroyuki Ikezoe
33d26976c8 Bug 1424948 - Check iteration progress value instead of animating computed style value. r=birtles
It is possible that animating computed style becomes the same value as the
value in the previous tick if Animation.mPendingReadyTime is pretty close
to the timeline current time.

MozReview-Commit-ID: COuur4Wlufx

--HG--
extra : rebase_source : 5dea9ef0bce7cb606dc290277e04b779fe608bbd
2017-12-15 01:10:11 +09:00
Hiroyuki Ikezoe
2a72c4f2f9 Bug 1424948 - Use waitForNextFrame instead of waitForFrame. r=birtles
MozReview-Commit-ID: AZJ7LyeIKq2

--HG--
extra : rebase_source : f42d2b0d4220d3d458093fdc5aed7ff11dcff63e
2017-12-15 00:06:26 +09:00
Hiroyuki Ikezoe
29d095f24f Bug 1416966 - Drop the check for the new micro task checkpoint for animations. r=birtles
MozReview-Commit-ID: HVxDrxV3Qmb

--HG--
extra : rebase_source : 9b29646a35e23c31896ae7458c49a8abd44bacbb
2017-12-12 18:44:05 +09:00
Hiroyuki Ikezoe
280df82ed9 Bug 1416966 - Perform a micro task checkpoint in DocumentTimeline::WillRefresh. r=bevis,birtles
MozReview-Commit-ID: Kd1Il7COZZY

--HG--
extra : rebase_source : 872267be92883ed5f94b2e4dbca7fd7f24941f34
2017-12-12 18:44:05 +09:00
Hiroyuki Ikezoe
fedaef24c4 Bug 1416966 - Add an annotation for a test case that will fail once we perform a micro task checkpoint between Animation::Tick and requestAnimationFrame callbacks. r=birtles
The 'is' check there will be replaced 'todo_is' after the commit for the new
micro task checkpoint.

MozReview-Commit-ID: EGFZWy8BD3O

--HG--
extra : rebase_source : 034717a9e7aac0edb82613321ec056ed07cdb996
2017-12-12 18:44:04 +09:00
Hiroyuki Ikezoe
912d3bc83e Bug 1416966 - Count a remaining animation restyle request when animating element was detached from the document. r=birtles
If element which has script animations is detached between Animation::Tick and
styling process, the element persists in EffectCompositor::mElementsToRestyle
(bug 1417354).  When the element is attached to the document again, the element
in mElementsToRestyle is considered as a target element that needs to be
traversed in the first animation-only restyling.  Thus the remaining restyle
request can be observed with the new micro task checkpoint for animations.

MozReview-Commit-ID: F6gs2QXcZ8X

--HG--
extra : rebase_source : 09ccf76e4d28ee55facc5a62f3e8f08e0eeb3e03
2017-12-12 18:44:04 +09:00
Hiroyuki Ikezoe
e49eb2dc18 Bug 1416966 - Add todo for checking one restyle after Animation.pause(). r=birtles
Similar to the previous commit, if Animation.pause() is called between
restyling process and the next refresh driver's tick and if we wait for
Animation.ready after the pause(), there should be one restyle that hasn't
yet processed.

MozReview-Commit-ID: JnpwhOuDvPz

--HG--
extra : rebase_source : b6f14e05837754d1bd51c8a50ce8d82a0c7d751a
2017-12-12 18:44:04 +09:00