commit | f9b9495ccdbf5d13b7c19d922a184e4139fb4ea8 | [log] [tgz] |
---|---|---|
author | Stefan Zager <szager@chromium.org> | Thu Apr 18 16:27:41 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Apr 18 16:27:41 2019 |
tree | 2fb2a346194fde1eae9c5e364bf05987538cbf4f | |
parent | 88804fc0f693e4c52f19686699ada0bee21b9120 [diff] |
[IntersectionObserver] Handle hidden OOPIF's correctly When an OOPIF is hidden, by scrolling it outside the parent document's viewport, or by setting display:none or visibility:hidden, then the iframe process stops running lifecycle updates, and IntersectionObserver notifications are not generated. That means that an IntersectionObserver running in the iframe process will not get a "not intersecting" notification until lifecycle updates resume. With this change, IntersectionObservers are forced to run when an OOPIF is hidden, so that the "not intersecting" notifications will be generated without waiting for a lifecycle update. Adding LocalFrame::WasShown and LocalFrame::WasHidden revealed another latent bug -- LocalFrameView::visibility_observer_ was not turned off in LocalFrameView::Dispose. As a result, it continued generating notifications and sending IPC's to the browser, even after the LocalFrameView was disposed. This is a problem with OOPIF's, because all iframe's are initially created as a LocalFrameView and later converted to a RemoteFrameView. The initial, temporary LFV would start up its visibility_observer_, which would continue pumping out notifications that were redundant -- and sometimes conflicting -- with IPC's sent from the RemoteFrameView. This bug only became apparent when writing the test included in this patch, which was flaky until LFV::visibility_observer_ was properly shut down in LFV::Dispose(). BUG=941231 R=dtapuska@chromium.org,kenrb@chromium.org,chrishtr@chromium.org Change-Id: I9c78742930c1829c49998b6f0212d58292fda57f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1568200 Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Commit-Queue: Stefan Zager <szager@chromium.org> Cr-Commit-Position: refs/heads/master@{#652155}
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 .