Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 620312427fc063962d3fb0757e91174e2dd32256
      
https://github.com/WebKit/WebKit/commit/620312427fc063962d3fb0757e91174e2dd32256
  Author: Ryan Reno <[email protected]>
  Date:   2025-06-16 (Mon, 16 Jun 2025)

  Changed paths:
    A 
LayoutTests/intersection-observer/observations-queue-a-task-to-notify-expected.txt
    A LayoutTests/intersection-observer/observations-queue-a-task-to-notify.html
    M Source/WebCore/dom/ContentVisibilityDocumentState.cpp
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Document.h
    M Source/WebCore/dom/TaskSource.h
    M Source/WebCore/html/LazyLoadImageObserver.cpp
    M Source/WebCore/page/IntersectionObserver.cpp
    M Source/WebCore/page/IntersectionObserver.h

  Log Message:
  -----------
  IntersectionObserver: Notify observers asynchronously
https://bugs.webkit.org/show_bug.cgi?id=294096
rdar://152684301

Reviewed by Simon Fraser.

IntersectionObservers are being notified synchronously once
we determine which observations are relevant. However, the
spec says we should queue a task to notify them.

Since lazy loading images and CSS Contain's content-visibility
both rely on IntersectionObserver internally, we differentiate between
an observer from JavaScript and internal users by allowing one to specify
a notification delivery preference as being either async (for JS) or
synchronous for other internal users.

This is a spec compliance change, but it also results in
~0.2% overall improvement on Speedometer3.

* 
LayoutTests/intersection-observer/observations-queue-a-task-to-notify-expected.txt:
 Added.
* LayoutTests/intersection-observer/observations-queue-a-task-to-notify.html: 
Added.
        Test that an observation queues a task to notify callbacks by injecting 
a task
        to check that a state change caused by the callback has not yet occured.

* Source/WebCore/dom/ContentVisibilityDocumentState.cpp:
(WebCore::ContentVisibilityDocumentState::intersectionObserver):
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::updateIntersectionObservations):
* Source/WebCore/dom/Document.h:
* Source/WebCore/dom/TaskSource.h:
* Source/WebCore/html/LazyLoadImageObserver.cpp:
(WebCore::LazyLoadImageObserver::intersectionObserver):
* Source/WebCore/page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::create):
(WebCore::IntersectionObserver::IntersectionObserver):
(WebCore::IntersectionObserver::updateObservations):
* Source/WebCore/page/IntersectionObserver.h:
(WebCore::IntersectionObserver::notificationDelivery const):

Canonical link: https://commits.webkit.org/296279@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to