commit | 7991d9360b7297040045ec712d69fb1b49c58f83 | [log] [tgz] |
---|---|---|
author | Fergal Daly <fergal@chromium.org> | Fri Dec 20 02:28:25 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Dec 20 02:28:25 2019 |
tree | c613ec14f1d0136bd4c6ba64f0d5b4edd9289e1c | |
parent | cec9203f4dfc683757d49094cca8a149caa90d5f [diff] |
Fix JS dialog interaction with bfcache Problem: When a tab navigates away from a page and then back again, if the page goes into bfcache, JS dialogs no longer appear. Cause: In SwapOutOldFrame, before deciding whether the page goes into bfcache we call SuppressFurtherDialogs but if the page is going into bfcache, this prevents all future dialogs from appearing. Fix: Replace IsWaitingForUnloadACK with !is_active() on the renderer side when deciding whether to show a dialog or immediately drop it and reply to the renderer as if the dialog was dismissed. After discussion and digging, altimin@ thinks this is safe. We will stop showing new dialogs as intended. The concern about nested event loops at the point of entry to bfcache is not a worry as the dialog nested event loop does nothing except handle the dialog response IPC, everything else is queued for the outer loop. Dialogs already stop blocking in JS when the user switches tabs (the dialog stays on-screen but the JS call to e.g. window.alert() returns. So no site should be relying on their dialog being dismissed by real user interaction. This adds a will_enter_back_forward_cache_callback_for_testing_ callback to allow more control of the timing of the JS run. The test that uses it fails if I replace !is_active with IsWaitingForUnloadACK. Bug: 1030133 Change-Id: I25ab4518399d82187028bbefb22b5722475d0cb3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1955245 Commit-Queue: Fergal Daly <fergal@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Charlie Reis <creis@chromium.org> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org> Reviewed-by: Alexander Timin <altimin@chromium.org> Cr-Commit-Position: refs/heads/master@{#726656}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .