Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add support for Notification objects with custom data
https://bugs.webkit.org/show_bug.cgi?id=240153 Reviewed by Chris Dumez. This adds support for the data attribute in Notification. This holds an arbitrary structured cloneable object passed through the constructor. The accessor is marked SameObject, which we implement via CachedAttribute. The wire form of the data is serialized and deserialized in NotificationData so that persistent notifications properly support this property. * Modules/notifications/Notification.cpp: (WebCore::createSerializedNotificationData): (WebCore::Notification::create): (WebCore::Notification::createForServiceWorker): (WebCore::Notification::Notification): (WebCore::Notification::dataForBindings): * Modules/notifications/Notification.h: * Modules/notifications/Notification.idl: * Modules/notifications/NotificationData.cpp: (WebCore::NotificationData::isolatedCopy const): (WebCore::NotificationData::isolatedCopy): * Modules/notifications/NotificationData.h: (WebCore::NotificationData::encode const): (WebCore::NotificationData::decode): * Modules/notifications/NotificationDataCocoa.mm: (WebCore::NotificationData::fromDictionary): (WebCore::NotificationData::dictionaryRepresentation const): * Modules/notifications/NotificationOptions.idl: * workers/service/ServiceWorkerRegistration.cpp: (WebCore::ServiceWorkerRegistration::showNotification): LayoutTests/imported/w3c: * web-platform-tests/notifications/idlharness.https.any-expected.txt: * web-platform-tests/notifications/idlharness.https.any.serviceworker-expected.txt: * web-platform-tests/wasm/serialization/module/serialization-via-notifications-api.any-expected.txt: LayoutTests: * http/tests/notifications/notification-expected.txt: * http/tests/notifications/notification.html: * http/tests/workers/service/getnotifications-expected.txt: * http/tests/workers/service/getnotifications-stop-expected.txt: * http/tests/workers/service/getnotifications-stop.html: * http/tests/workers/service/getnotifications.html: * http/tests/workers/service/openwindow-from-notification-click.html: * http/tests/workers/service/resources/shownotification-openwindow-worker.js: (async tryShow): (async getNotes): * http/tests/workers/service/resources/shownotification-worker.js: (async event): (async tryShow): (async tryShowInvalidData.try.data): (async tryShowInvalidData): (async getNotes): * http/tests/workers/service/shownotification-allowed-document-expected.txt: * http/tests/workers/service/shownotification-allowed-document.html: * http/tests/workers/service/shownotification-allowed.html: * http/tests/workers/service/shownotification-invalid-data-expected.txt: Added. * http/tests/workers/service/shownotification-invalid-data.html: Canonical link: https://commits.webkit.org/250368@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@293921 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
28 changed files
with
308 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.