Closed Bug 1428692 Opened 8 years ago Closed 8 years ago

We observed 2 restyles in the first frame right after re-attaching to the document in test_restyles.html after bug 1193394

Categories

(Core :: DOM: Animation, defect, P2)

All
Unspecified
defect

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: bevis, Assigned: hiro)

References

Details

Attachments

(1 file)

We got this new failure in today's try: https://treeherder.mozilla.org/logviewer.html#?job_id=154670351&repo=try&lineNumber=4268 TEST-UNEXPECTED-FAIL | dom/animation/test/mozilla/test_restyles.html | We should observe one restyle in the first frame right after re-attaching to the document - got 2, expected 1
Take this bug to followup.
Assignee: nobody → btseng
Status: NEW → ASSIGNED
Thank you, Bevis. Please feel free pinging me on IRC if you have any question. :)
Assignee: bevistseng → nobody
Status: ASSIGNED → NEW
I will check why the test started failing.
Flags: needinfo?(hikezoe)
As per a try [1], it seems that the failure happens only on stylo. sigh. [1] https://treeherder.mozilla.org/#/jobs?repo=try&revision=d024d36eaf64dcbcdf0039f80ce0267f738c86ec
OK, now I understand what was wrong. I made a mistake to fix bug 1425009, in this commit; https://hg.mozilla.org/mozilla-central/rev/3ede11fe526e We can't use tweakExpectedRestyleCount() for the failure test case. In the case where we have the conformant Promise handling, tweakExpectedRestyleCount() adjusts a given expected restyle count in the last frame we observes. That's because the Promise in the last requestAnimationFrame callback is processed after restyling in the last frame. Whereas, in this failure test, we just want to know the animation has begun at the current timeline time instead (i.e. the animation start time is clamped so that we don't post request restyle at the moment). I try to explain to make what happens clearer. - Tick - Animation::Tick happens - In RequestRestyle() the animation element is appended into mElementsToRestyle *if the animation does not begin at the current timeline time* - resolve animation.ready - the animation element is detached from the document, at this moment mElementsToRestyle may have the animation element if it's the case Some amount of frames later; - Tick - the animation element is attached to the document - in PreTraverse() for the *first* animation restyle we post restyle request for the animation in the case where mElementsToRestyle have the element - in normal traversal we create a sequential task for CascadeResults (bug 1388560) - in PreTraverse() for the *second* animation restyle we post restyle request So if the animation begins at the current timeline time, we got 1 restyles, and if it's not, we got 2 restyles there. A try based on bug 1193394; https://treeherder.mozilla.org/#/jobs?repo=try&revision=8a7044314a3c6e66ceb8694460011b87a7d33177 In this try, test cases for unthrottling transform animation failed intermittently, I think we also need startsRightNow() check there. A try based on current m-c; https://treeherder.mozilla.org/#/jobs?repo=try&revision=68f639513c4bc32efedc4363bb5e39e25c820583
Flags: needinfo?(hikezoe)
I try to explain another way; From the commit what I was wrong <https://hg.mozilla.org/mozilla-central/rev/3ede11fe526e#l1.58>; - is(markers.length, 2, + is(markers.length, expectedRestyleCount, What we should have done here is that + is(markers.length, 2 (- 1 if the animation begun at the current timeline time), That's because if the animation begun at the current timeline time, we don't post the superfluous restyle.
Assignee: nobody → hikezoe
Status: NEW → ASSIGNED
Comment on attachment 8946176 [details] Bug 1428692 - Don't use tweakExpectedRestyleCount in the case where we don't use the returned count for observeStyling called right after. https://reviewboard.mozilla.org/r/216168/#review221998 ::: dom/animation/test/mozilla/file_restyles.html:1005 (Diff revision 1) > div.remove(); > > // It's possible that the animation begins at this moment. If this is the > // case, an additional superfluous restyle request that we will check later > // can't be observed. > - const expectedRestyleCount = tweakExpectedRestyleCount(animation, 1); > + let superfluousRestyle = startsRightNow(animation) ? 0 : 1; (Any reason for let instead of const? This doesn't get re-assigned does it?)
Attachment #8946176 - Flags: review?(bbirtles) → review+
(In reply to Brian Birtles (:birtles, busy 1/29~2/5) from comment #11) > Comment on attachment 8946176 [details] > Bug 1428692 - Don't use tweakExpectedRestyleCount in the case where we don't > use the returned count for observeStyling called right after. > > https://reviewboard.mozilla.org/r/216168/#review221998 > > ::: dom/animation/test/mozilla/file_restyles.html:1005 > (Diff revision 1) > > div.remove(); > > > > // It's possible that the animation begins at this moment. If this is the > > // case, an additional superfluous restyle request that we will check later > > // can't be observed. > > - const expectedRestyleCount = tweakExpectedRestyleCount(animation, 1); > > + let superfluousRestyle = startsRightNow(animation) ? 0 : 1; > > (Any reason for let instead of const? This doesn't get re-assigned does it?) Good catch. :) Indeed, I had modified the value while debugging.
Pushed by hikezoe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c58988f74bd4 Don't use tweakExpectedRestyleCount in the case where we don't use the returned count for observeStyling called right after. r=birtles
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: