[webkit-changes] [WebKit/WebKit] 7b5785: Implement Observable#forEach

Marais Rossouw noreply at github.com
Fri Oct 25 00:48:16 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7b5785e176c2c2c256da316e0ad378e927a404b9
      https://github.com/WebKit/WebKit/commit/7b5785e176c2c2c256da316e0ad378e927a404b9
  Author: Marais Rossouw <me at marais.co>
  Date:   2024-10-25 (Fri, 25 Oct 2024)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/dom/observable/tentative/observable-forEach.any-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/dom/observable/tentative/observable-forEach.any.worker-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/dom/observable/tentative/observable-forEach.window-expected.txt
    M Source/WebCore/CMakeLists.txt
    M Source/WebCore/DerivedSources-input.xcfilelist
    M Source/WebCore/DerivedSources-output.xcfilelist
    M Source/WebCore/DerivedSources.make
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    A Source/WebCore/dom/InternalObserverForEach.cpp
    A Source/WebCore/dom/InternalObserverForEach.h
    M Source/WebCore/dom/Observable.cpp
    M Source/WebCore/dom/Observable.h
    M Source/WebCore/dom/Observable.idl
    A Source/WebCore/dom/VisitorCallback.h
    A Source/WebCore/dom/VisitorCallback.idl

  Log Message:
  -----------
  Implement Observable#forEach
https://bugs.webkit.org/show_bug.cgi?id=277510

Reviewed by Chris Dumez.

This change introduces the `.forEach` promise-returning operator
for Observables, using the InternalObserver and subscribes immediately.
This is required by the specification https://wicg.github.io/observable/#dom-observable-foreach.

This change also includes a new VisitorCallback IDL which represents a callback
that receives each value of an Subscription, which unlike MapperCallback, does not return a value.

* LayoutTests/imported/w3c/web-platform-tests/dom/observable/tentative/observable-forEach.any-expected.txt: Rebaselined.
* LayoutTests/imported/w3c/web-platform-tests/dom/observable/tentative/observable-forEach.any.worker-expected.txt: Rebaselined.
* LayoutTests/imported/w3c/web-platform-tests/dom/observable/tentative/observable-forEach.window-expected.txt: Rebaselined.
* Source/WebCore/CMakeLists.txt:
* Source/WebCore/DerivedSources-input.xcfilelist:
* Source/WebCore/DerivedSources-output.xcfilelist:
* Source/WebCore/DerivedSources.make:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/InternalObserverForEach.cpp: Added.
(WebCore::createInternalObserverOperatorForEach):
* Source/WebCore/dom/InternalObserverForEach.h: Added.
* Source/WebCore/dom/Observable.cpp:
(WebCore::Observable::forEach):
* Source/WebCore/dom/Observable.h:
* Source/WebCore/dom/Observable.idl:
  Exposes the `Promise<undefiend> forEach(callback, options)`.
* Source/WebCore/dom/VisitorCallback.h: Added.
* Source/WebCore/dom/VisitorCallback.idl: Added.

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list