RESOLVED FIXED Bug 197891
[IntersectionObserver] Regression: No initial observation when nothing else triggers rendering
https://bugs.webkit.org/show_bug.cgi?id=197891
Summary [IntersectionObserver] Regression: No initial observation when nothing else t...
Ali Juma
Reported 2019-05-14 12:57:06 PDT
Created attachment 369885 [details] Test case After the rAF timing changes in bug 177484 (which are great news overall, bringing IntersectionObserver timing in-line with the spec and other browsers), an initial observation isn't fired after a call to IntersectionObserver::observe, until something else triggers rendering. It should be enough to add a call to Document::scheduleRenderingUpdate at the end of IntersectionObserver::observe (this would correspond to "Schedule an iteration of the event loop" in https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-observe).
Attachments
Test case (489 bytes, text/html)
2019-05-14 12:57 PDT, Ali Juma
no flags
Patch (4.14 KB, patch)
2019-05-15 13:03 PDT, Ali Juma
no flags
Simon Fraser (smfr)
Comment 1 2019-05-14 13:05:49 PDT
Did we not have tests that detected this, or did we skip them?
Ali Juma
Comment 2 2019-05-14 13:25:31 PDT
(In reply to Simon Fraser (smfr) from comment #1) > Did we not have tests that detected this, or did we skip them? Most of our tests (or at least, most of the WPTs) use rAF to wait for observations (which triggers a rendering update), or seem to call |observe| early enough that a rendering update will be scheduled for the initial layout of the page. Speaking of skipped tests, the rAF changes seem to have fixed all of the flakiness we were seeing on the Mac Debug bots, so I'll go ahead and update those expectations.
Ali Juma
Comment 3 2019-05-15 13:03:14 PDT
It turns out that at least one of the reasons that no existing test caught this is that the speculative tiling timer and the tile size change timer trigger flushes (and rendering updates) even after the page is loaded and nothing is changing. So calls to IntersectionObserver::observe that happen within ~1 second of page load will work properly even though IntersectionObserver isn’t itself scheduling a rendering update.
Ali Juma
Comment 4 2019-05-15 13:03:25 PDT
WebKit Commit Bot
Comment 5 2019-05-16 06:55:02 PDT
Comment on attachment 369985 [details] Patch Clearing flags on attachment: 369985 Committed r245396: <https://trac.webkit.org/changeset/245396>
WebKit Commit Bot
Comment 6 2019-05-16 06:55:03 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 7 2019-05-16 06:56:28 PDT
Note You need to log in before you can comment on or make changes to this bug.