[webkit-reviews] review granted: [Bug 188670] [IntersectionObserver] Fire an initial dummy notification : [Attachment 347389] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 17 14:21:34 PDT 2018


Simon Fraser (smfr) <simon.fraser at apple.com> has granted Ali Juma
<ajuma at chromium.org>'s request for review:
Bug 188670: [IntersectionObserver] Fire an initial dummy notification
https://bugs.webkit.org/show_bug.cgi?id=188670

Attachment 347389: Patch

https://bugs.webkit.org/attachment.cgi?id=347389&action=review




--- Comment #5 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 347389
  --> https://bugs.webkit.org/attachment.cgi?id=347389
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=347389&action=review

> Source/WebCore/dom/Document.cpp:7433
> +    for (auto observer : m_intersectionObservers) {

m_intersectionObservers is a HashSet, so order is not guaranteed. Does the API
require that observers fire in registration order? Even if not, I think we
should make order predictable, so maybe a ListHashSet, or just a Vector if we
think the cost of checking for duplicates is low.  Do we know how many
observers common pages have?

> Source/WebCore/dom/Document.h:1777
> +    HashSet<RefPtr<IntersectionObserver>> m_intersectionObservers;
> +    Vector<WeakPtr<IntersectionObserver>>
m_intersectionObserversWithPendingNotifications;

Much better.


More information about the webkit-reviews mailing list