Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gecko Bug 1545309] Make test function independent from others in eventloop.html. #16884

Merged
merged 2 commits into from May 16, 2019

Conversation

moz-wptsync-bot
Copy link
Collaborator

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

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1545309
gecko-commit: 57b5cbfc0d7a0857e896d0a41c366fc7a4d77da0
gecko-integration-branch: central
gecko-reviewers: dholbert

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

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1545309
gecko-commit: 57b5cbfc0d7a0857e896d0a41c366fc7a4d77da0
gecko-integration-branch: central
gecko-reviewers: dholbert
In test0(), we use the callback of `requestAnimationFrame` to know in which
eventloop (i.e. `Tick()`) we are. However, we may not trigger the callback
of `requestAnimationFrame` if we are not visible. This is an optimization
in Bug 1145439.

Detail:
We use `Document::ShouldThrottleFrameRequests()` to check if we should throttle
the frame requests in the current `Tick()`. This function returns true if we
didn't get painted during the last paint, so we are not visible, so throttle
the frame requests. Note that because we have to paint this document at least
once to unthrottle it, we will drop one `requestAnimationFrame` frame when a
document that previously wasn't visible scrolls into view.

Therefore, we should make sure we got the first paint before running test0().
Using onload is not perfect, but we don't have other better choose for now.

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

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1545309
gecko-commit: 2c165cc039113c935d13a630528173f2e34cdfe2
gecko-integration-branch: central
gecko-reviewers: dholbert
Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already reviewed downstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants