[webkit-changes] [WebKit/WebKit] c33fee: WebKit needs to pass along NotificationOptions.sil...

Brady Eidson noreply at github.com
Thu Apr 20 11:38:46 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c33fee9a59070e49240bca8644be011d5af78c35
      https://github.com/WebKit/WebKit/commit/c33fee9a59070e49240bca8644be011d5af78c35
  Author: Brady Eidson <beidson at apple.com>
  Date:   2023-04-20 (Thu, 20 Apr 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/notifications/idlharness.https.any-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/notifications/idlharness.https.any.serviceworker-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/notifications/idlharness.https.any.worker-expected.txt
    M Source/WebCore/Modules/notifications/Notification.cpp
    M Source/WebCore/Modules/notifications/Notification.h
    M Source/WebCore/Modules/notifications/Notification.idl
    M Source/WebCore/Modules/notifications/NotificationData.cpp
    M Source/WebCore/Modules/notifications/NotificationData.h
    M Source/WebCore/Modules/notifications/NotificationDataCocoa.mm
    M Source/WebCore/Modules/notifications/NotificationOptions.idl
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/UIProcess/API/Cocoa/_WKNotificationData.h
    M Source/WebKit/UIProcess/API/Cocoa/_WKNotificationData.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/PushAPI.mm

  Log Message:
  -----------
  WebKit needs to pass along NotificationOptions.silent to API clients
https://bugs.webkit.org/show_bug.cgi?id=254562
rdar://107424158

Reviewed by Megan Gardner.

WebKit doesn't display notifications itself. API clients do that.
WebKit simply passes along all of the information about the proposed notification to the client.

If a client wants to support notifications having sound, it also needs to know when a particular
notification should be silent.

JavaScript can specify in its NotificationOptions dictionary whether or not it prefers a
notification be silent.

This patch pays attention to the silent flag and passes along to the API client whether it:
- Was set to true
- Was set to false
- Was not set at all

* Source/WebCore/Modules/notifications/Notification.cpp:
(WebCore::Notification::create):
(WebCore::Notification::Notification):
(WebCore::Notification::data const):
* Source/WebCore/Modules/notifications/Notification.h:
* Source/WebCore/Modules/notifications/Notification.idl:

* Source/WebCore/Modules/notifications/NotificationData.cpp:
(WebCore::NotificationData::isolatedCopy const):
(WebCore::NotificationData::isolatedCopy):
* Source/WebCore/Modules/notifications/NotificationData.h:

* Source/WebCore/Modules/notifications/NotificationDataCocoa.mm:
(WebCore::nsValueToOptionalBool):
(WebCore::NotificationData::fromDictionary):
(WebCore::NotificationData::dictionaryRepresentation const):

* Source/WebCore/Modules/notifications/NotificationOptions.idl:

* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

* Source/WebKit/UIProcess/API/Cocoa/_WKNotificationData.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKNotificationData.mm:
(-[_WKNotificationData initWithCoreData:dataStore:]):

* Tools/TestWebKitAPI/Tests/WebKitCocoa/PushAPI.mm:

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




More information about the webkit-changes mailing list