[webkit-changes] [WebKit/WebKit] 72258d: Declarative Web Push: Add "defaultAction" member t...

Brady Eidson noreply at github.com
Mon Sep 25 11:22:47 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 72258dba1b792f0c7f60bb30c81ecc2d8d4b4bfe
      https://github.com/WebKit/WebKit/commit/72258dba1b792f0c7f60bb30c81ecc2d8d4b4bfe
  Author: Brady Eidson <beidson at apple.com>
  Date:   2023-09-25 (Mon, 25 Sep 2023)

  Changed paths:
    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/NotificationOptions.idl
    M Source/WebCore/workers/service/ServiceWorkerRegistration.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm

  Log Message:
  -----------
  Declarative Web Push: Add "defaultAction" member to Notification and NotificationOptions
https://bugs.webkit.org/show_bug.cgi?id=262004
rdar://115938949

Reviewed by Dan Glastonbury.

When a declarative web push message comes in, it is required to have a default action URL.
This is so the user activating the notification can bypass service workers, as service workers are not required.

If the message is mutable, and a `pushnotification` event handler decides to show a different notification,
then that notification also needs a default action URL.

We put that as an option on NotificationOptions, add a Notification accessor for it, and enforce that
new notifications shown during `pushnotification` event handlers have one.

Then we test it.

* 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/NotificationOptions.idl:
* Source/WebCore/workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::showNotification):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:

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




More information about the webkit-changes mailing list