[Webkit-unassigned] [Bug 196729] IntersectionObserver delivers incorrect records and fires at the wrong time

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 9 04:00:31 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=196729

--- Comment #1 from Elliott Sprehn <esprehn at chromium.org> ---
Note that the first two issues we can workaround by ignoring zero sized rects, but the second has no workaround because the IO reports zero sized rects and then never reports the correct values. 

This impacts airbnb.com where our IntersectionObservers are unreliable on Safari because they report zero sized rects even when the element is non-zero in size.

It seems to reliably reproduce on about:blank, and unreliably on other sites (I think because there's racing issues). One way I can reproduce it multiple times:

1. Load about:blank
2. Execute this in the console:

var i = 0; setInterval(() => { document.body.style.fontSize = i++ % 32 + 1 });

3. Paste this into the console:

o = new IntersectionObserver((records) => {
  console.log(records.map(r => r.boundingClientRect.height));
})
d = document.createElement('div')
o.observe(d)
setTimeout(() => {
  let x = document.createElement('div')
  x.textContent = 'Hello World'
  d.appendChild(x);
});
document.body.append(d)

It prints [0] for me every time I paste that snippet while the setInterval is running.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190409/43ab3c6f/attachment-0001.html>


More information about the webkit-unassigned mailing list