Skip to content

Commit

Permalink
Merge pull request #18333 from Snuffleupagus/l10n-destroy-rm-requestA…
Browse files Browse the repository at this point in the history
…nimationFrame

Remove the `requestAnimationFrame` work-around in `L10n.prototype.destroy` (PR 18313 follow-up)
Snuffleupagus authored Jun 25, 2024
2 parents 11cb3a8 + f676ce5 commit 7f58618
Showing 4 changed files with 8 additions and 18 deletions.
11 changes: 6 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
"@babel/preset-env": "^7.24.7",
"@babel/runtime": "^7.24.7",
"@fluent/bundle": "^0.18.0",
"@fluent/dom": "^0.9.0",
"@fluent/dom": "^0.10.0",
"@jazzer.js/core": "^2.1.0",
"@metalsmith/layouts": "^2.7.0",
"@metalsmith/markdown": "^1.10.0",
6 changes: 1 addition & 5 deletions test/integration/stamp_editor_spec.mjs
Original file line number Diff line number Diff line change
@@ -559,12 +559,8 @@ describe("Stamp Editor", () => {
});

afterAll(async () => {
// Close the pages in reverse order because the second document will have
// focus at the end of the test and the `testingClose` method requires
// (via `requestAnimationFrame` usage in the `this.l10n.destroy()` call)
// that the page it's called on has focus.
await closePages(pages2);
await closePages(pages1);
await closePages(pages2);
});

it("must check that the alt-text button is here when pasting in the second tab", async () => {
7 changes: 0 additions & 7 deletions web/l10n.js
Original file line number Diff line number Diff line change
@@ -87,13 +87,6 @@ class L10n {
}
this.#elements.clear();
this.#l10n.pauseObserving();

// Since `disconnectRoot`/`pauseObserving` can still trigger asynchronous
// operations, without any way to actually cancel them, attempt to
// workaround timing issues when closing the integration-tests.
await new Promise(resolve => {
window.requestAnimationFrame(resolve);
});
}

/** @inheritdoc */

0 comments on commit 7f58618

Please sign in to comment.