Unreviewed, rolling out r216206.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 May 2017 05:37:54 +0000 (05:37 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 May 2017 05:37:54 +0000 (05:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=171714

Multiple LayoutTests crashing in Document::page() (Requested
by ap on #webkit).

Reverted changeset:

"Remove support for legacy Notifications"
https://bugs.webkit.org/show_bug.cgi?id=171487
http://trac.webkit.org/changeset/216206

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216234 268f45cc-cd09-0410-ab3c-d52691b4dbfc

139 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/fast/history/page-cache-notification-non-suspendable.html
LayoutTests/fast/history/page-cache-notification-suspendable.html
LayoutTests/fast/notifications/notification-after-close-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notification-after-close.html [new file with mode: 0644]
LayoutTests/fast/notifications/notification-permisssion-deletable-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notification-permisssion-deletable.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-cancel-request-permission-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-cancel-request-permission.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-check-permission-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-check-permission.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-click-event-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-click-event-focus-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-click-event-focus.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-click-event.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-constructor-request-permission-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-constructor-request-permission.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-constructor-with-permission-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-constructor-with-permission.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-constructor-without-permission-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-constructor-without-permission.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-display-close-events-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-display-close-events.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-document-close-crash-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-document-close-crash.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-event-stop-propagation-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-event-stop-propagation.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-multi-events-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-multi-events.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-no-icon-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-no-icon.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-permission-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-permission.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-replace-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-replace.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-request-permission-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-request-permission-optional-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-request-permission-optional.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-request-permission.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-rtl-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-rtl.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-sandbox-permission-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-sandbox-permission.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-window-close-crash-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-window-close-crash.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-with-permission-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-with-permission.html [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-without-permission-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-without-permission.html [new file with mode: 0644]
LayoutTests/fast/notifications/request-notification-permission-while-reloading-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/request-notification-permission-while-reloading.html [new file with mode: 0644]
LayoutTests/fast/notifications/resources/notifications-cancel-request-permission.html [new file with mode: 0644]
LayoutTests/fast/notifications/resources/notifications-iframe.html [new file with mode: 0644]
LayoutTests/http/tests/notifications/legacy/double-show-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/notifications/legacy/double-show.html [new file with mode: 0644]
LayoutTests/http/tests/notifications/legacy/events-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/notifications/legacy/events.html [new file with mode: 0644]
LayoutTests/http/tests/notifications/legacy/notification-request-permission-then-navigate-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/notifications/legacy/notification-request-permission-then-navigate.html [new file with mode: 0644]
LayoutTests/http/tests/notifications/legacy/request-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/notifications/legacy/request-no-callback-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/notifications/legacy/request-no-callback.html [new file with mode: 0644]
LayoutTests/http/tests/notifications/legacy/request.html [new file with mode: 0644]
LayoutTests/http/tests/notifications/legacy/resources/notify-opener-done.html [new file with mode: 0644]
LayoutTests/http/tests/notifications/legacy/resources/request-permission-then-navigate.html [new file with mode: 0644]
LayoutTests/http/tests/notifications/legacy/show-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/notifications/legacy/show.html [new file with mode: 0644]
LayoutTests/http/tests/notifications/legacy/window-show-on-click-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/notifications/legacy/window-show-on-click.html [new file with mode: 0644]
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/ios/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/win/TestExpectations
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/WTF/ChangeLog
Source/WTF/wtf/FeatureDefines.h
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/DerivedSources.cpp
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/notifications/DOMWindowNotifications.cpp [new file with mode: 0644]
Source/WebCore/Modules/notifications/DOMWindowNotifications.h [new file with mode: 0644]
Source/WebCore/Modules/notifications/DOMWindowNotifications.idl [new file with mode: 0644]
Source/WebCore/Modules/notifications/Notification.cpp
Source/WebCore/Modules/notifications/Notification.h
Source/WebCore/Modules/notifications/Notification.idl
Source/WebCore/Modules/notifications/NotificationCenter.cpp [new file with mode: 0644]
Source/WebCore/Modules/notifications/NotificationCenter.h [new file with mode: 0644]
Source/WebCore/Modules/notifications/NotificationCenter.idl [new file with mode: 0644]
Source/WebCore/Modules/notifications/NotificationClient.h
Source/WebCore/Modules/notifications/NotificationController.cpp
Source/WebCore/Modules/notifications/NotificationController.h
Source/WebCore/Modules/notifications/WorkerGlobalScopeNotifications.cpp [new file with mode: 0644]
Source/WebCore/Modules/notifications/WorkerGlobalScopeNotifications.h [new file with mode: 0644]
Source/WebCore/Modules/notifications/WorkerGlobalScopeNotifications.idl [new file with mode: 0644]
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/EventTargetFactory.in
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/workers/WorkerThread.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
Source/WebKit/mac/WebCoreSupport/WebNotificationClient.h
Source/WebKit/mac/WebCoreSupport/WebNotificationClient.mm
Source/WebKit/mac/WebView/WebNotification.mm
Source/WebKit/mac/WebView/WebNotificationInternal.h
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
Source/WebKit/win/WebCoreSupport/WebChromeClient.h
Source/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp
Source/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.h
Source/WebKit2/ChangeLog
Source/WebKit2/Configurations/FeatureDefines.xcconfig
Source/WebKit2/Shared/WebProcessCreationParameters.cpp
Source/WebKit2/Shared/WebProcessCreationParameters.h
Source/WebKit2/UIProcess/WebProcessPool.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp
Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.h
Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h
Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebProcess.cpp
Source/cmake/OptionsMac.cmake
Source/cmake/OptionsWin.cmake
Source/cmake/WebKitFeatures.cmake
Source/cmake/tools/vsprops/FeatureDefines.props
Source/cmake/tools/vsprops/FeatureDefinesCairo.props
Tools/ChangeLog
Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp
Tools/Scripts/webkitperl/FeatureList.pm
Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig

index eaefb9c..412ef69 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2017-05-04  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r216206.
+        https://bugs.webkit.org/show_bug.cgi?id=171714
+
+        Multiple LayoutTests crashing in Document::page() (Requested
+        by ap on #webkit).
+
+        Reverted changeset:
+
+        "Remove support for legacy Notifications"
+        https://bugs.webkit.org/show_bug.cgi?id=171487
+        http://trac.webkit.org/changeset/216206
+
 2017-05-04  Don Olmstead  <don.olmstead@am.sony.com>
 
         [Win] Remove redundant macros that are set in the CMake config
index dbe005e..aedcc2d 100644 (file)
@@ -1,3 +1,17 @@
+2017-05-04  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r216206.
+        https://bugs.webkit.org/show_bug.cgi?id=171714
+
+        Multiple LayoutTests crashing in Document::page() (Requested
+        by ap on #webkit).
+
+        Reverted changeset:
+
+        "Remove support for legacy Notifications"
+        https://bugs.webkit.org/show_bug.cgi?id=171487
+        http://trac.webkit.org/changeset/216206
+
 2017-05-04  Chris Dumez  <cdumez@apple.com>
 
         Element.slot should be marked as [Unscopable]
index 5d7f5ca..68c2d53 100644 (file)
@@ -37,7 +37,7 @@ window.addEventListener('load', function() {
     window.sessionStorage.page_cache_notifications_test_started = true;
 
     // This notification is shown and should not be suspendable.
-    notification = new Notification('title', { body: 'body' });
+    notification = webkitNotifications.createNotification('', 'title 2', 'body');
     notification.onerror = function() {
         testFailed("Could not show the notification");
         finishJSTest();
@@ -46,6 +46,7 @@ window.addEventListener('load', function() {
         // Force a back navigation back to this page.
         window.location.href = "resources/page-cache-helper.html";
     };
+    notification.show();
 }, false);
 
 </script>
index 3f8c4e5..e68b968 100644 (file)
@@ -29,24 +29,28 @@ window.addEventListener("pagehide", function(event) {
 }, false);
 
 window.addEventListener('load', function() {
+    // This notification is in idle state and should be suspendable.
+    notification1 = webkitNotifications.createNotification('', 'title 1', 'body');
+
     // This notification is shown and should be suspendable once it is closed.
-    notification = new Notification('title', { body: 'body' });
-    notification.ondisplay = function() {
+    notification2 = webkitNotifications.createNotification('', 'title 2', 'body');
+    notification2.ondisplay = function() {
         // Close the notification.
         setTimeout(function() {
-            notification.close();
+            notification2.cancel();
         }, 0);
     };
-    notification.onerror = function() {
+    notification2.onerror = function() {
         testFailed("Could not display the notification");
         finishJSTest();
     };
-    notification.onclose = function() {
+    notification2.onclose = function() {
         setTimeout(function() {
             // Force a back navigation back to this page.
             window.location.href = "resources/page-cache-helper.html";
         }, 0);
     };
+    notification2.show();
 }, false);
 
 </script>
diff --git a/LayoutTests/fast/notifications/notification-after-close-expected.txt b/LayoutTests/fast/notifications/notification-after-close-expected.txt
new file mode 100644 (file)
index 0000000..69cfc5a
--- /dev/null
@@ -0,0 +1,2 @@
+PASS
+
diff --git a/LayoutTests/fast/notifications/notification-after-close.html b/LayoutTests/fast/notifications/notification-after-close.html
new file mode 100644 (file)
index 0000000..367ef4a
--- /dev/null
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script type="text/javascript">
+        function log(message)
+        {
+            document.getElementById("result").innerHTML += message + "<br>";
+        }
+        
+        function runTests()
+        {
+            if (window.testRunner) {
+                testRunner.dumpAsText();
+                testRunner.waitUntilDone();
+                testRunner.setCanOpenWindows();
+            }
+
+            win = window.open('about:blank');
+            if (win.webkitNotifications === undefined) {
+                log("PASS");
+            } else {
+                notificationCenter=win.webkitNotifications;
+                win.close();
+                try { 
+                    n=notificationCenter.createNotification(''); 
+                } catch (e) {}
+                // Just make sure we don't crash.
+                log("PASS");
+            }
+
+            if (window.testRunner)
+                testRunner.notifyDone();
+        }
+    </script>
+</head>
+<body>
+<div id="result"></div>    
+    
+<script type="text/javascript">
+runTests();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/notification-permisssion-deletable-expected.txt b/LayoutTests/fast/notifications/notification-permisssion-deletable-expected.txt
new file mode 100644 (file)
index 0000000..65befc3
--- /dev/null
@@ -0,0 +1,12 @@
+Tests that Notification.permission is deletable.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Notification.permission is "default"
+PASS delete Notification.permission is true
+PASS Notification.permission is undefined.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/notifications/notification-permisssion-deletable.html b/LayoutTests/fast/notifications/notification-permisssion-deletable.html
new file mode 100644 (file)
index 0000000..02e57f2
--- /dev/null
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<script>
+description("Tests that Notification.permission is deletable.");
+
+shouldBeEqualToString("Notification.permission", "default");
+shouldBeTrue("delete Notification.permission");
+shouldBeUndefined("Notification.permission");
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/notifications-cancel-request-permission-expected.txt b/LayoutTests/fast/notifications/notifications-cancel-request-permission-expected.txt
new file mode 100644 (file)
index 0000000..ab4d054
--- /dev/null
@@ -0,0 +1,5 @@
+DESKTOP NOTIFICATION PERMISSION REQUESTED: file://
+DESKTOP NOTIFICATION PERMISSION REQUEST CANCELLED: file://
+Requesting and cancelling notification permission...
+
+Pass if notification is cancelled
diff --git a/LayoutTests/fast/notifications/notifications-cancel-request-permission.html b/LayoutTests/fast/notifications/notifications-cancel-request-permission.html
new file mode 100644 (file)
index 0000000..1dee427
--- /dev/null
@@ -0,0 +1,44 @@
+<html>
+<head>
+    <script type="text/javascript">
+
+        // Timeout is to ensure that the iframe was removed.
+        setTimeout(isDone,500);
+
+        function log(message)
+        {
+            document.getElementById("result").innerHTML += message + "<br>";
+        }
+        
+        function runTests()
+        {
+            if (window.testRunner) {
+                testRunner.dumpAsText();
+                testRunner.waitUntilDone();
+            }
+
+            if (!window.webkitNotifications) {
+                log("FAIL: No webkitNotifications interface!");
+            }
+            
+            document.getElementById("test").innerHTML="Pass if notification is cancelled";
+        }
+
+        function isDone()
+        {
+            if (window.testRunner) {
+                testRunner.notifyDone();
+            }
+        }
+
+    </script>
+</head>
+<body onload="runTests();">
+    <p>Requesting and cancelling notification permission...</p>
+    
+<div id="result"></div>
+<div id="test">
+<iframe src="resources/notifications-cancel-request-permission.html" width=800 height=800></iframe>
+</div>
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/notifications-check-permission-expected.txt b/LayoutTests/fast/notifications/notifications-check-permission-expected.txt
new file mode 100644 (file)
index 0000000..907db3f
--- /dev/null
@@ -0,0 +1,5 @@
+Checking permission...
+
+PASS: Permission not granted.
+PASS: Permission granted.
+
diff --git a/LayoutTests/fast/notifications/notifications-check-permission.html b/LayoutTests/fast/notifications/notifications-check-permission.html
new file mode 100644 (file)
index 0000000..c893858
--- /dev/null
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script type="text/javascript">
+        function log(message)
+        {
+            document.getElementById("result").innerHTML += message + "<br>";
+        }
+        
+        function runTests()
+        {
+            if (window.testRunner) {
+                testRunner.dumpAsText();
+            }
+
+            if (!window.webkitNotifications) {
+                log("FAIL: No webkitNotifications interface!");
+            }
+            
+            var N = window.webkitNotifications.checkPermission();
+            if (N != 0) {
+                log("PASS: Permission not granted.");
+            } else {
+                log("FAIL: Permission shouldn't be granted.");
+            }
+            
+            if (window.testRunner) {
+                testRunner.grantWebNotificationPermission("file://");
+            }
+            
+            N = window.webkitNotifications.checkPermission();
+            if (N == 0) {
+                log("PASS: Permission granted.");
+            } else {
+                log("FAIL: Permission not granted.");
+            }
+        }
+    </script>
+</head>
+<body>
+<p>Checking permission...</p>
+<div id="result"></div>
+<script type="text/javascript">
+runTests();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/notifications-click-event-expected.txt b/LayoutTests/fast/notifications/notifications-click-event-expected.txt
new file mode 100644 (file)
index 0000000..6b21089
--- /dev/null
@@ -0,0 +1,8 @@
+DESKTOP NOTIFICATION: icon , title New E-mail, text Meet me tonight at 8!
+DESKTOP NOTIFICATION CLOSED: New E-mail
+Showing notifications.
+
+To exercise manually, grant notification permissions and load this page, then click on the notification. You should see a "PASS" message.
+
+PASS: click event fired.
+
diff --git a/LayoutTests/fast/notifications/notifications-click-event-focus-expected.txt b/LayoutTests/fast/notifications/notifications-click-event-focus-expected.txt
new file mode 100644 (file)
index 0000000..35473a6
--- /dev/null
@@ -0,0 +1,9 @@
+DESKTOP NOTIFICATION: icon , title New E-mail, text Meet me tonight at 8!
+DESKTOP NOTIFICATION CLOSED: New E-mail
+Check that window.focus() is not restricted during notification click events.
+
+To exercise manually, disable pop-up blocking, grant notification permissions and load this page, then click on the notification. You should see two "PASS" messages and this window should be focused.
+
+PASS: click event fired.
+PASS: focus event fired.
+
diff --git a/LayoutTests/fast/notifications/notifications-click-event-focus.html b/LayoutTests/fast/notifications/notifications-click-event-focus.html
new file mode 100644 (file)
index 0000000..bb39a0c
--- /dev/null
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script type="text/javascript">
+        function log(message)
+        {
+            document.getElementById("result").innerHTML += message + "<br>";
+        }
+
+        function runTests()
+        {
+            if (window.testRunner) {
+                testRunner.grantWebNotificationPermission("file://");
+                testRunner.dumpAsText();
+                testRunner.waitUntilDone();
+                testRunner.setCanOpenWindows();
+                testRunner.setCloseRemainingWindowsWhenComplete();
+            }
+
+            if (!window.webkitNotifications) {
+                log("FAIL: No webkitNotifications interface!");
+            }
+
+            // Open a new window, so we don't have the focus.
+            var W = window.open("about:blank");
+            W.focus();
+
+            window.onfocus = function() { log("PASS: focus event fired."); }
+
+            var N = window.webkitNotifications.createNotification("", "New E-mail", "Meet me tonight at 8!");
+            N.onclick = function() { log("PASS: click event fired."); window.focus(); N.cancel();  }
+            N.show();
+
+            if (window.testRunner) {
+                testRunner.simulateLegacyWebNotificationClick("New E-mail");
+                testRunner.notifyDone();
+            }
+        }
+    </script>
+</head>
+<body>
+<p>Check that window.focus() is not restricted during notification click events.</p>
+
+<p>To exercise manually, disable pop-up blocking, grant notification permissions and load this page, then click on the notification.  You should see two "PASS" messages and this window should be focused.</p>
+<div id="result"></div>
+
+<script type="text/javascript">
+runTests();
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/notifications-click-event.html b/LayoutTests/fast/notifications/notifications-click-event.html
new file mode 100644 (file)
index 0000000..cd402ec
--- /dev/null
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script type="text/javascript">
+        function log(message)
+        {
+            document.getElementById("result").innerHTML += message + "<br>";
+        }
+        
+        function runTests()
+        {
+            if (window.testRunner) {
+                testRunner.grantWebNotificationPermission("file://");
+                testRunner.dumpAsText();
+                if (testRunner.dumpNotifications)
+                    testRunner.dumpNotifications();
+                testRunner.waitUntilDone();
+            }
+
+            if (!window.webkitNotifications) {
+                log("FAIL: No webkitNotifications interface!");
+            }
+            
+            var N = window.webkitNotifications.createNotification("", "New E-mail", "Meet me tonight at 8!");
+            N.onclick = function() { log("PASS: click event fired."); N.cancel();  }
+            N.show();
+            if (window.testRunner) {
+                testRunner.simulateLegacyWebNotificationClick("New E-mail");
+                testRunner.notifyDone();
+            }
+        }
+    </script>
+</head>
+<body>
+<p>Showing notifications.</p>
+
+<p>To exercise manually, grant notification permissions and load this page, then click on the notification.  You should see a "PASS" message.</p>
+<div id="result"></div>    
+    
+<script type="text/javascript">
+runTests();
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/notifications-constructor-request-permission-expected.txt b/LayoutTests/fast/notifications/notifications-constructor-request-permission-expected.txt
new file mode 100644 (file)
index 0000000..5d76015
--- /dev/null
@@ -0,0 +1,5 @@
+DESKTOP NOTIFICATION PERMISSION REQUESTED: file://
+Requesting notification permission...
+
+PASS: Permission callback invoked.
+
diff --git a/LayoutTests/fast/notifications/notifications-constructor-request-permission.html b/LayoutTests/fast/notifications/notifications-constructor-request-permission.html
new file mode 100644 (file)
index 0000000..65a6bf2
--- /dev/null
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script type="text/javascript">
+        function log(message)
+        {
+            document.getElementById("result").innerHTML += message + "<br>";
+        }
+        
+        function runTests()
+        {
+            if (window.testRunner) {
+                testRunner.dumpAsText();
+            }
+
+            if (!window.Notification) {
+                log("FAIL: No Notification interface!");
+            }
+            
+            var N = window.Notification.requestPermission(
+                function() { log("PASS: Permission callback invoked."); }
+            );
+        }
+    </script>
+</head>
+<body>
+    <p>Requesting notification permission...</p>
+    
+<div id="result"></div>    
+<script type="text/javascript">
+runTests();
+</script>
+
+
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/notifications-constructor-with-permission-expected.txt b/LayoutTests/fast/notifications/notifications-constructor-with-permission-expected.txt
new file mode 100644 (file)
index 0000000..86ad4ca
--- /dev/null
@@ -0,0 +1,5 @@
+DESKTOP NOTIFICATION: icon , title Hello world, text 
+Sending notifications with permission...
+
+PASS: show event fired.
+
diff --git a/LayoutTests/fast/notifications/notifications-constructor-with-permission.html b/LayoutTests/fast/notifications/notifications-constructor-with-permission.html
new file mode 100644 (file)
index 0000000..717d7fe
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script type="text/javascript">
+        function log(message)
+        {
+            document.getElementById("result").innerHTML += message + "<br>";
+        }
+        
+        function runTests()
+        {
+            if (window.testRunner) {
+                testRunner.grantWebNotificationPermission("file://");
+                testRunner.dumpAsText();
+                testRunner.waitUntilDone();
+            }
+
+            if (!window.Notification) {
+                log("FAIL: No Notification constructor!");
+            }
+            
+            var N = new Notification("Hello world");
+            N.onshow = function() { log("PASS: show event fired."); }
+            N.onerror = function() { log("FAIL: error event fired."); }
+            setTimeout(function() { testRunner.notifyDone(); }, 100);
+        }
+    </script>
+</head>
+<body>
+<p>Sending notifications with permission...</p>
+<div id="result"></div>
+
+<script type="text/javascript">
+runTests();
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/notifications-constructor-without-permission-expected.txt b/LayoutTests/fast/notifications/notifications-constructor-without-permission-expected.txt
new file mode 100644 (file)
index 0000000..5441e36
--- /dev/null
@@ -0,0 +1,4 @@
+Sending notifications without permission...
+
+PASS: error event fired.
+
diff --git a/LayoutTests/fast/notifications/notifications-constructor-without-permission.html b/LayoutTests/fast/notifications/notifications-constructor-without-permission.html
new file mode 100644 (file)
index 0000000..cba36f3
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script type="text/javascript">
+        function log(message)
+        {
+            document.getElementById("result").innerHTML += message + "<br>";
+        }
+        
+        function runTests()
+        {
+            if (window.testRunner) {
+                // NO PERMISSION testRunner.grantWebNotificationPermission("file://");
+                testRunner.dumpAsText();
+                testRunner.waitUntilDone();
+            }
+
+            if (!window.Notification) {
+                log("FAIL: No Notification constructor!");
+            }
+            
+            var N = new Notification("Hello world");
+            N.onshow = function() { log("FAIL: show event fired."); }
+            N.onerror = function() { log("PASS: error event fired."); }
+            setTimeout(function() { testRunner.notifyDone(); }, 100);
+        }
+    </script>
+</head>
+<body>
+<p>Sending notifications without permission...</p>
+<div id="result"></div>
+
+<script type="text/javascript">
+runTests();
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/notifications-display-close-events-expected.txt b/LayoutTests/fast/notifications/notifications-display-close-events-expected.txt
new file mode 100644 (file)
index 0000000..b1f5c47
--- /dev/null
@@ -0,0 +1,7 @@
+DESKTOP NOTIFICATION: icon , title New E-mail, text Meet me tonight at 8!
+DESKTOP NOTIFICATION CLOSED: New E-mail
+Sending notifications with permission...
+
+PASS: display event invoked.
+PASS: close event invoked.
+
diff --git a/LayoutTests/fast/notifications/notifications-display-close-events.html b/LayoutTests/fast/notifications/notifications-display-close-events.html
new file mode 100644 (file)
index 0000000..f748a4a
--- /dev/null
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script type="text/javascript">
+        function log(message)
+        {
+            document.getElementById("result").innerHTML += message + "<br>";
+        }
+        
+        function runTests()
+        {
+            if (window.testRunner) {
+                testRunner.grantWebNotificationPermission("file://");
+                testRunner.dumpAsText();
+                if (testRunner.dumpNotifications)
+                    testRunner.dumpNotifications();
+                testRunner.waitUntilDone();
+            }
+
+            if (!window.webkitNotifications) {
+                log("FAIL: No webkitNotifications interface!");
+            }
+            
+            var N = window.webkitNotifications.createNotification("", "New E-mail", "Meet me tonight at 8!");
+            N.ondisplay = function() { log("PASS: display event invoked."); N.cancel(); }
+            N.onclose = function() { log("PASS: close event invoked."); testRunner.notifyDone(); }
+            N.show();
+        }
+    </script>
+</head>
+<body>
+<p>Sending notifications with permission...</p>
+<div id="result"></div>    
+    
+<script type="text/javascript">
+runTests();
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/notifications-document-close-crash-expected.txt b/LayoutTests/fast/notifications/notifications-document-close-crash-expected.txt
new file mode 100644 (file)
index 0000000..2307aa1
--- /dev/null
@@ -0,0 +1,2 @@
+CONSOLE MESSAGE: line 36: Uncaught InvalidStateError (DOM Exception 11): The object is in an invalid state.\r
+PASS\r
diff --git a/LayoutTests/fast/notifications/notifications-document-close-crash.html b/LayoutTests/fast/notifications/notifications-document-close-crash.html
new file mode 100644 (file)
index 0000000..37ac369
--- /dev/null
@@ -0,0 +1,50 @@
+<html>
+    <body>
+        <div id="result"></div>
+        <script>
+            if (window.testRunner)
+            {
+                testRunner.dumpAsText();
+                testRunner.setCanOpenWindows();
+                testRunner.grantWebNotificationPermission("file://");
+                testRunner.waitUntilDone();
+            }
+
+            if (!window.webkitNotifications) {
+                log("FAIL: No webkitNotifications interface!");
+            }
+
+            var target = window.open("about:blank");
+            var notification = target.webkitNotifications;
+            target.location.reload();
+            var timer = setInterval("crash()", 60);
+            setTimeout("finish()", 100);
+
+            function crash()
+            {
+                var a = [];
+                for (var i = 0; i < 0x100; i++)
+                {
+                    try
+                    {
+                        a.push(new WebGLByteArray());
+                    }
+                    catch (e) {}
+                    a.push(Array(i).join("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"));
+                }
+                delete a;
+                notification.requestPermission();
+            }
+
+            function finish()
+            {
+                clearInterval(timer);
+                document.getElementById("result").innerHTML = "PASS";
+                target.close();
+                if (window.testRunner)
+                    testRunner.notifyDone();
+            }
+        </script>
+    </body>
+</html>
+
diff --git a/LayoutTests/fast/notifications/notifications-event-stop-propagation-expected.txt b/LayoutTests/fast/notifications/notifications-event-stop-propagation-expected.txt
new file mode 100644 (file)
index 0000000..d27de89
--- /dev/null
@@ -0,0 +1,6 @@
+DESKTOP NOTIFICATION: icon http://localhost/my_icon.png, title New E-mail, text Meet me tonight at 8!
+DESKTOP NOTIFICATION CLOSED: New E-mail
+Sending notifications with permission...
+
+PASS: addEventListener(display) capture callback invoked
+
diff --git a/LayoutTests/fast/notifications/notifications-event-stop-propagation.html b/LayoutTests/fast/notifications/notifications-event-stop-propagation.html
new file mode 100644 (file)
index 0000000..2d8d043
--- /dev/null
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script type="text/javascript">
+        function log(message)
+        {
+            document.getElementById("result").innerHTML += message + "<br>";
+        }
+        
+        function runTests()
+        {
+            if (window.testRunner) {
+                testRunner.grantWebNotificationPermission("file://");
+                testRunner.dumpAsText();
+            }
+
+            if (!window.webkitNotifications) {
+                log("FAIL: No webkitNotifications interface!");
+            }
+            
+            var N = window.webkitNotifications.createNotification("http://localhost/my_icon.png", "New E-mail", "Meet me tonight at 8!");
+            N.addEventListener("display", function(e) { log("PASS: addEventListener(display) non-capture callback invoked"); });
+            N.ondisplay =                 function(e) { log("PASS: ondisplay attribute event callback invoked."); }
+            N.addEventListener("display", function(e) { log("PASS: addEventListener(display) capture callback invoked"); e.stopPropagation(); }, true );
+            N.show();
+            N.cancel();
+        }
+    </script>
+</head>
+<body>
+<p>Sending notifications with permission...</p>
+<div id="result"></div>    
+    
+<script type="text/javascript">
+runTests();
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/notifications-multi-events-expected.txt b/LayoutTests/fast/notifications/notifications-multi-events-expected.txt
new file mode 100644 (file)
index 0000000..522d585
--- /dev/null
@@ -0,0 +1,10 @@
+DESKTOP NOTIFICATION: icon http://localhost/my_icon.png, title New E-mail, text Meet me tonight at 8!
+DESKTOP NOTIFICATION CLOSED: New E-mail
+Sending notifications with permission...
+
+PASS: addEventListener(close) capture callback #1 invoked
+PASS: addEventListener(close) capture callback #2 invoked
+PASS: addEventListener(close) callback #1 invoked
+PASS: onclose attribute event callback invoked.
+PASS: addEventListener(close) callback #3 invoked
+
diff --git a/LayoutTests/fast/notifications/notifications-multi-events.html b/LayoutTests/fast/notifications/notifications-multi-events.html
new file mode 100644 (file)
index 0000000..7244828
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script type="text/javascript">
+        function log(message)
+        {
+            document.getElementById("result").innerHTML += message + "<br>";
+        }
+        
+        function runTests()
+        {
+            if (window.testRunner) {
+                testRunner.grantWebNotificationPermission("file://");
+                testRunner.dumpAsText();
+            }
+
+            if (!window.webkitNotifications) {
+                log("FAIL: No webkitNotifications interface!");
+            }
+            
+            var N = window.webkitNotifications.createNotification("http://localhost/my_icon.png", "New E-mail", "Meet me tonight at 8!");
+            N.addEventListener("close", function() { log("PASS: addEventListener(close) callback #1 invoked"); });
+            N.onclose =                 function() { log("PASS: onclose attribute event callback invoked."); }
+            N.addEventListener("close", function() { log("PASS: addEventListener(close) capture callback #1 invoked"); }, true );
+            N.addEventListener("close", function() { log("PASS: addEventListener(close) capture callback #2 invoked"); }, true );
+            N.addEventListener("close", function() { log("PASS: addEventListener(close) callback #3 invoked"); });
+            N.show();
+            N.cancel();
+        }
+    </script>
+</head>
+<body>
+<p>Sending notifications with permission...</p>
+<div id="result"></div>    
+    
+<script type="text/javascript">
+runTests();
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/notifications-no-icon-expected.txt b/LayoutTests/fast/notifications/notifications-no-icon-expected.txt
new file mode 100644 (file)
index 0000000..1cf78e4
--- /dev/null
@@ -0,0 +1,4 @@
+DESKTOP NOTIFICATION: icon , title New E-mail, text Meet me tonight at 8!
+Sending notifications with permission...
+
+
diff --git a/LayoutTests/fast/notifications/notifications-no-icon.html b/LayoutTests/fast/notifications/notifications-no-icon.html
new file mode 100644 (file)
index 0000000..5c722ed
--- /dev/null
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script type="text/javascript">
+        function log(message)
+        {
+            document.getElementById("result").innerHTML += message + "<br>";
+        }
+        
+        function runTests()
+        {
+            if (window.testRunner) {
+                testRunner.grantWebNotificationPermission("file://");
+                testRunner.dumpAsText();
+                if (testRunner.dumpNotifications)
+                    testRunner.dumpNotifications();
+            }
+
+            if (!window.webkitNotifications) {
+                log("FAIL: No webkitNotifications interface!");
+            }
+            
+            var M = window.webkitNotifications.createNotification("", "New E-mail", "Meet me tonight at 8!");
+            M.show();
+        }
+    </script>
+</head>
+<body>
+<p>Sending notifications with permission...</p>
+    
+    
+<script type="text/javascript">
+runTests();
+</script>
+
+<div id="result"></div>
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/notifications-permission-expected.txt b/LayoutTests/fast/notifications/notifications-permission-expected.txt
new file mode 100644 (file)
index 0000000..b5d8fad
--- /dev/null
@@ -0,0 +1,10 @@
+Check for existence of Notification.permission
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+PASS window.Notification is defined.
+PASS window.Notification.permission is defined.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/notifications/notifications-permission.html b/LayoutTests/fast/notifications/notifications-permission.html
new file mode 100644 (file)
index 0000000..0ba0e04
--- /dev/null
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../../resources/js-test-pre.js"></script>
+</head>
+
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script type="text/javascript">
+description("Check for existence of Notification.permission");
+
+shouldBeDefined("window.Notification");
+shouldBeDefined("window.Notification.permission");
+
+var successfullyParsed = true;
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/notifications-replace-expected.txt b/LayoutTests/fast/notifications/notifications-replace-expected.txt
new file mode 100644 (file)
index 0000000..2480ba3
--- /dev/null
@@ -0,0 +1,7 @@
+DESKTOP NOTIFICATION: icon , title New E-mail, text Meet me tonight at 8!
+DESKTOP NOTIFICATION: icon , title Alarm, text It's time to wake up!
+REPLACING NOTIFICATION New E-mail
+DESKTOP NOTIFICATION: icon , title New reply, text Correction, 8:15
+Showing notifications with replace ID...
+
+
diff --git a/LayoutTests/fast/notifications/notifications-replace.html b/LayoutTests/fast/notifications/notifications-replace.html
new file mode 100644 (file)
index 0000000..cc56cf6
--- /dev/null
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script type="text/javascript">
+        function log(message)
+        {
+            document.getElementById("result").innerHTML += message + "<br>";
+        }
+        
+        function runTests()
+        {
+            if (window.testRunner) {
+                testRunner.grantWebNotificationPermission("file://");
+                testRunner.dumpAsText();
+                if (testRunner.dumpNotifications)
+                    testRunner.dumpNotifications();
+            }
+
+            if (!window.webkitNotifications) {
+                log("FAIL: No webkitNotifications interface!");
+            }
+            
+            var M = window.webkitNotifications.createNotification("", "New E-mail", "Meet me tonight at 8!");
+            M.replaceId = "NewMail";
+            M.show();
+            var other = window.webkitNotifications.createNotification("", "Alarm", "It's time to wake up!");
+            other.show();
+            var N = window.webkitNotifications.createNotification("", "New reply", "Correction, 8:15");
+            N.replaceId = "NewMail";
+            N.show();          
+        }
+    </script>
+</head>
+<body>
+<p>Showing notifications with replace ID...</p>
+<div id="result"></div>
+<script type="text/javascript">
+runTests();
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/notifications-request-permission-expected.txt b/LayoutTests/fast/notifications/notifications-request-permission-expected.txt
new file mode 100644 (file)
index 0000000..5d76015
--- /dev/null
@@ -0,0 +1,5 @@
+DESKTOP NOTIFICATION PERMISSION REQUESTED: file://
+Requesting notification permission...
+
+PASS: Permission callback invoked.
+
diff --git a/LayoutTests/fast/notifications/notifications-request-permission-optional-expected.txt b/LayoutTests/fast/notifications/notifications-request-permission-optional-expected.txt
new file mode 100644 (file)
index 0000000..7b46fb4
--- /dev/null
@@ -0,0 +1,6 @@
+PASS window.webkitNotifications is defined.
+PASS window.webkitNotifications.requestPermission() did not throw exception.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/notifications/notifications-request-permission-optional.html b/LayoutTests/fast/notifications/notifications-request-permission-optional.html
new file mode 100644 (file)
index 0000000..fd7c8d8
--- /dev/null
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script type="text/javascript">
+shouldBeDefined("window.webkitNotifications");
+shouldNotThrow("window.webkitNotifications.requestPermission()");
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</head>
+</html>
diff --git a/LayoutTests/fast/notifications/notifications-request-permission.html b/LayoutTests/fast/notifications/notifications-request-permission.html
new file mode 100644 (file)
index 0000000..e94cf05
--- /dev/null
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script type="text/javascript">
+        function log(message)
+        {
+            document.getElementById("result").innerHTML += message + "<br>";
+        }
+        
+        function runTests()
+        {
+            if (window.testRunner) {
+                testRunner.dumpAsText();
+            }
+
+            if (!window.webkitNotifications) {
+                log("FAIL: No webkitNotifications interface!");
+            }
+            
+            var N = window.webkitNotifications.requestPermission(
+                function() { log("PASS: Permission callback invoked."); }
+            );
+        }
+    </script>
+</head>
+<body>
+    <p>Requesting notification permission...</p>
+    
+<div id="result"></div>    
+<script type="text/javascript">
+runTests();
+</script>
+
+
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/notifications-rtl-expected.txt b/LayoutTests/fast/notifications/notifications-rtl-expected.txt
new file mode 100644 (file)
index 0000000..f2b01fc
--- /dev/null
@@ -0,0 +1,4 @@
+DESKTOP NOTIFICATION:(RTL) icon , title New E-mail, text Meet me tonight at 8!
+Showing a notification with direction "rtl"...
+
+
diff --git a/LayoutTests/fast/notifications/notifications-rtl.html b/LayoutTests/fast/notifications/notifications-rtl.html
new file mode 100644 (file)
index 0000000..aa67dd1
--- /dev/null
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script type="text/javascript">
+        function log(message)
+        {
+            document.getElementById("result").innerHTML += message + "<br>";
+        }
+        
+        function runTests()
+        {
+            if (window.testRunner) {
+                testRunner.grantWebNotificationPermission("file://");
+                testRunner.dumpAsText();
+                if (testRunner.dumpNotifications)
+                    testRunner.dumpNotifications();
+            }
+
+            if (!window.webkitNotifications) {
+                log("FAIL: No webkitNotifications interface!");
+            }
+            
+            var M = window.webkitNotifications.createNotification("", "New E-mail", "Meet me tonight at 8!");
+            M.dir = "rtl";
+            M.show();
+        }
+    </script>
+</head>
+<body>
+<p>Showing a notification with direction "rtl"...</p>
+    
+<div id="result"></div>
+   
+<script type="text/javascript">
+runTests();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/notifications-sandbox-permission-expected.txt b/LayoutTests/fast/notifications/notifications-sandbox-permission-expected.txt
new file mode 100644 (file)
index 0000000..d41f56d
--- /dev/null
@@ -0,0 +1,24 @@
+Normal iframe. Should inherit permissions.
+
+
+Sandboxed iframe, with allow-same-origin. Should inherit permissions.
+
+
+Sandboxed iframe, without allow-same-origin. Should not inherit permissions.
+
+
+
+--------
+Frame: '<!--framePath //<!--frame0-->-->'
+--------
+Allowed
+
+--------
+Frame: '<!--framePath //<!--frame1-->-->'
+--------
+Allowed
+
+--------
+Frame: '<!--framePath //<!--frame2-->-->'
+--------
+Denied
diff --git a/LayoutTests/fast/notifications/notifications-sandbox-permission.html b/LayoutTests/fast/notifications/notifications-sandbox-permission.html
new file mode 100644 (file)
index 0000000..f298dff
--- /dev/null
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.dumpChildFramesAsText();
+            testRunner.grantWebNotificationPermission("file://");
+        }
+    </script>
+</head>
+<body>
+    <p>Normal iframe. Should inherit permissions.</p>
+    <iframe src="resources/notifications-iframe.html"></iframe>
+
+    <p>Sandboxed iframe, with allow-same-origin. Should inherit permissions.</p>
+    <iframe sandbox="allow-scripts allow-same-origin"
+            src="resources/notifications-iframe.html"></iframe>
+
+    <p>Sandboxed iframe, without allow-same-origin. Should not inherit permissions.</p>
+    <iframe sandbox="allow-scripts"
+            src="resources/notifications-iframe.html"></iframe>
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/notifications-window-close-crash-expected.txt b/LayoutTests/fast/notifications/notifications-window-close-crash-expected.txt
new file mode 100644 (file)
index 0000000..e37d934
--- /dev/null
@@ -0,0 +1 @@
+This test needs to run manually and cannot run inside DumpRenderTree. Passes if it does not crash on running the test alongwith with a couple of page reloads.
diff --git a/LayoutTests/fast/notifications/notifications-window-close-crash.html b/LayoutTests/fast/notifications/notifications-window-close-crash.html
new file mode 100644 (file)
index 0000000..9447ffe
--- /dev/null
@@ -0,0 +1,23 @@
+<html> \r
+    <head> \r
+        <script> \r
+            function runTest()\r
+            {\r
+                if (window.testRunner)\r
+                    testRunner.dumpAsText();\r
+                else\r
+                {\r
+                    var win = window.open("about:blank");\r
+                    var notification = win.webkitNotifications.createNotification('');\r
+                    notification.show();\r
+                    win.close();\r
+                    notification.cancel();\r
+                }\r
+            }\r
+         </script> \r
+    </head> \r
+    <body onload="runTest()"> \r
+        <p>This test needs to run manually and cannot run inside DumpRenderTree. Passes if it does not crash on running the test alongwith with a couple of page reloads.</p>\r
+    </body> \r
+</html>\r
+\r
diff --git a/LayoutTests/fast/notifications/notifications-with-permission-expected.txt b/LayoutTests/fast/notifications/notifications-with-permission-expected.txt
new file mode 100644 (file)
index 0000000..0a4d8d4
--- /dev/null
@@ -0,0 +1,4 @@
+DESKTOP NOTIFICATION: icon http://0.0.0.0/my_icon.png, title New E-mail, text Meet me tonight at 8!
+Sending notifications with permission...
+
+
diff --git a/LayoutTests/fast/notifications/notifications-with-permission.html b/LayoutTests/fast/notifications/notifications-with-permission.html
new file mode 100644 (file)
index 0000000..737ec58
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script type="text/javascript">
+        function log(message)
+        {
+            document.getElementById("result").innerHTML += message + "<br>";
+        }
+        
+        function runTests()
+        {
+            if (window.testRunner) {
+                testRunner.grantWebNotificationPermission("file://");
+                testRunner.dumpAsText();
+                if (testRunner.dumpNotifications)
+                    testRunner.dumpNotifications();
+                testRunner.waitUntilDone();
+            }
+
+            if (!window.webkitNotifications) {
+                log("FAIL: No webkitNotifications interface!");
+            }
+            
+            var M = window.webkitNotifications.createNotification("http://0.0.0.0/my_icon.png", "New E-mail", "Meet me tonight at 8!");
+            M.ondisplay = function() { testRunner.notifyDone(); }
+            M.show();
+        }
+    </script>
+</head>
+<body>
+<p>Sending notifications with permission...</p>
+    
+    
+<script type="text/javascript">
+runTests();
+</script>
+
+<div id="result"></div>
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/notifications-without-permission-expected.txt b/LayoutTests/fast/notifications/notifications-without-permission-expected.txt
new file mode 100644 (file)
index 0000000..6689695
--- /dev/null
@@ -0,0 +1,4 @@
+Sending notifications without permission...
+
+PASS: Exception thrown.
+
diff --git a/LayoutTests/fast/notifications/notifications-without-permission.html b/LayoutTests/fast/notifications/notifications-without-permission.html
new file mode 100644 (file)
index 0000000..40ae65a
--- /dev/null
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script type="text/javascript">
+        function log(message)
+        {
+            document.getElementById("result").innerHTML += message + "<br>";
+        }
+        
+        function runTests()
+        {
+            if (window.testRunner) {
+                // NO PERMISSION testRunner.grantWebNotificationPermission("file://");
+                testRunner.dumpAsText();
+            }
+
+            if (!window.webkitNotifications) {
+                log("FAIL: No webkitNotifications interface!");
+            }
+            
+            try {
+                var N = window.webkitNotifications.createNotification("http://0.0.0.0/my_icon.png", "New E-mail", "Meet me tonight at 8!");
+                N.show();
+                log("FAIL: Should have thrown security exception.");
+            } catch (e) {
+                log("PASS: Exception thrown.");
+            }
+        }
+    </script>
+</head>
+<body>
+<p>Sending notifications without permission...</p>
+<div id="result"></div>
+
+<script type="text/javascript">
+runTests();
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/request-notification-permission-while-reloading-expected.txt b/LayoutTests/fast/notifications/request-notification-permission-while-reloading-expected.txt
new file mode 100644 (file)
index 0000000..2df3aa3
--- /dev/null
@@ -0,0 +1,3 @@
+This tests that notification permission requests during page reload do not cause a crash.
+
+PASS: Test passed if we saw no crash.
diff --git a/LayoutTests/fast/notifications/request-notification-permission-while-reloading.html b/LayoutTests/fast/notifications/request-notification-permission-while-reloading.html
new file mode 100644 (file)
index 0000000..c93eb63
--- /dev/null
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<body>
+<p>This tests that notification permission requests during page reload do not cause a crash.</p>
+<p id="message">FAIL: Test did not run to completion yet.</p>
+<script>
+
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+
+var tries = location.hash.substring(1) >>> 0;
+if (tries < 10) {
+    location.hash = "#" + (tries + 1);
+    location.reload();
+
+    setTimeout(function() {
+        webkitNotifications.requestPermission();
+    }, 0);
+} else {
+    document.getElementById("message").textContent = "PASS: Test passed if we saw no crash.";
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+</script>
+</body>
diff --git a/LayoutTests/fast/notifications/resources/notifications-cancel-request-permission.html b/LayoutTests/fast/notifications/resources/notifications-cancel-request-permission.html
new file mode 100644 (file)
index 0000000..43897c9
--- /dev/null
@@ -0,0 +1,28 @@
+<html>
+<head>
+    <script type="text/javascript">
+        function log(message)
+        {
+            parent.document.getElementById("result").innerHTML += message + "<br>";
+        }
+        
+        function runTests()
+        {
+            if (window.testRunner) {
+                testRunner.dumpAsText();
+            }
+
+            if (window.testRunner) {
+                testRunner.ignoreLegacyWebNotificationPermissionRequests();
+            }
+
+            window.webkitNotifications.requestPermission(
+                function() { log("FAIL: Permission callback invoked."); }
+            );
+
+        }
+    </script>
+</head>
+<body onload="runTests();">
+</body>
+</html>
diff --git a/LayoutTests/fast/notifications/resources/notifications-iframe.html b/LayoutTests/fast/notifications/resources/notifications-iframe.html
new file mode 100644 (file)
index 0000000..31969c1
--- /dev/null
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Notifications: Iframe test.</title>
+</head>
+<body>
+    <p id="hasPermission"></p>
+    <script>
+        document.getElementById("hasPermission").innerText =
+            !webkitNotifications.checkPermission() ? "Allowed" : "Denied";
+    </script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/notifications/legacy/double-show-expected.txt b/LayoutTests/http/tests/notifications/legacy/double-show-expected.txt
new file mode 100644 (file)
index 0000000..f9d1938
--- /dev/null
@@ -0,0 +1,11 @@
+Sending double-show notification...
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS window.webkitNotifications is defined.
+PASS ondisplay event handler called
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/http/tests/notifications/legacy/double-show.html b/LayoutTests/http/tests/notifications/legacy/double-show.html
new file mode 100644 (file)
index 0000000..fece8eb
--- /dev/null
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<script src="/resources/js-test-pre.js"></script>
+<script src="/resources/notifications-test-pre.js"></script>
+<p id="description"></p>
+<div id="console"></div>
+
+<script type="text/javascript">
+description("Sending double-show notification...");
+
+if (window.testRunner) {
+    testRunner.grantWebNotificationPermission(testURL);
+    testRunner.waitUntilDone();
+}
+
+shouldBeDefined("window.webkitNotifications");
+
+var N = window.webkitNotifications.createNotification("http://0.0.0.0/my_icon.png", "New E-mail", "Meet me tonight at 8!");
+N.ondisplay = function() {
+    testPassed("ondisplay event handler called");
+    testCompleted();
+};
+N.show();
+N.show();
+</script>
diff --git a/LayoutTests/http/tests/notifications/legacy/events-expected.txt b/LayoutTests/http/tests/notifications/legacy/events-expected.txt
new file mode 100644 (file)
index 0000000..ee41921
--- /dev/null
@@ -0,0 +1,14 @@
+This test looks for the dispatch of the event handlers.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Granting permission to http://127.0.0.1:8000
+PASS webkitNotifications.checkPermission() is 0
+PASS ondisplay event handler was called
+PASS onclick event handler was called
+PASS onclose event handler was called
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/http/tests/notifications/legacy/events.html b/LayoutTests/http/tests/notifications/legacy/events.html
new file mode 100644 (file)
index 0000000..150152c
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<script src="/resources/js-test-pre.js"></script>
+<script src="/resources/notifications-test-pre.js"></script>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+if (window.testRunner)
+       testRunner.waitUntilDone();
+
+description("This test looks for the dispatch of the event handlers.");
+
+if (window.testRunner) {
+       debug("Granting permission to " + testURL);
+       testRunner.grantWebNotificationPermission(testURL);
+}
+
+shouldBe("webkitNotifications.checkPermission()", "0");
+
+var n = webkitNotifications.createNotification("", "title", "body");
+n.ondisplay = function() {
+       testPassed("ondisplay event handler was called");
+       testRunner.simulateWebNotificationClick(this);
+};
+n.onclick = function() {
+       testPassed("onclick event handler was called");
+       this.cancel();
+};
+n.onclose = function() {
+       testPassed("onclose event handler was called");
+       testCompleted();
+};
+n.onerror = function() {
+       testFailed("onerror event handler should not be called");
+       testCompleted();
+};
+n.show();
+</script>
diff --git a/LayoutTests/http/tests/notifications/legacy/notification-request-permission-then-navigate-expected.txt b/LayoutTests/http/tests/notifications/legacy/notification-request-permission-then-navigate-expected.txt
new file mode 100644 (file)
index 0000000..1460566
--- /dev/null
@@ -0,0 +1,11 @@
+main frame - has 1 onunload handler(s)
+Tests that we are not crashing when a permission request is answered after navigating
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS This test did not crash
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/http/tests/notifications/legacy/notification-request-permission-then-navigate.html b/LayoutTests/http/tests/notifications/legacy/notification-request-permission-then-navigate.html
new file mode 100644 (file)
index 0000000..8316619
--- /dev/null
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="/resources/js-test-pre.js"></script>
+<script src="/resources/notifications-test-pre.js"></script>
+</head>
+<body onload="runTest()">
+<script>
+description("Tests that we are not crashing when a permission request is answered after navigating");
+jsTestIsAsync = true;
+
+if (window.testRunner)
+  testRunner.setCanOpenWindows();
+
+window.addEventListener('message', function(event)
+{
+  testPassed("This test did not crash");
+  target.close();
+  finishJSTest();
+});
+
+function runTest()
+{
+  target = window.open('resources/request-permission-then-navigate.html');
+}
+
+</script>
+<script src="/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/notifications/legacy/request-expected.txt b/LayoutTests/http/tests/notifications/legacy/request-expected.txt
new file mode 100644 (file)
index 0000000..8120a86
--- /dev/null
@@ -0,0 +1,14 @@
+This test checks that a request for permission is made.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Requesting permission with default permission
+PASS window.webkitNotifications.checkPermission() is 1
+PASS window.webkitNotifications.checkPermission() is 0
+Requesting permission with non-default permission
+PASS window.webkitNotifications.checkPermission() is 2
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/http/tests/notifications/legacy/request-no-callback-expected.txt b/LayoutTests/http/tests/notifications/legacy/request-no-callback-expected.txt
new file mode 100644 (file)
index 0000000..a12ebc4
--- /dev/null
@@ -0,0 +1,15 @@
+This test checks that requesting permission without a callback works. This supports legacy API.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Requesting permission with default permission
+PASS window.webkitNotifications.checkPermission() is 1
+PASS webkitNotifications.requestPermission() did not throw exception.
+Requesting permission with non-default permission
+PASS window.webkitNotifications.checkPermission() is 2
+PASS webkitNotifications.requestPermission() did not throw exception.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/http/tests/notifications/legacy/request-no-callback.html b/LayoutTests/http/tests/notifications/legacy/request-no-callback.html
new file mode 100644 (file)
index 0000000..dae6a89
--- /dev/null
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<script src="/resources/js-test-pre.js"></script>
+<script src="/resources/notifications-test-pre.js"></script>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description("This test checks that requesting permission without a callback works. This supports legacy API.");
+
+function step1() {
+    debug("Requesting permission with default permission");
+    shouldBe("window.webkitNotifications.checkPermission()", "1");
+    shouldNotThrow("webkitNotifications.requestPermission()");
+    setTimeout(step2, 0);
+}
+
+function step2() {
+    testRunner.denyWebNotificationPermission(testURL);
+    debug("Requesting permission with non-default permission");
+    shouldBe("window.webkitNotifications.checkPermission()", "2");
+    shouldNotThrow("webkitNotifications.requestPermission()");
+    testCompleted();
+}
+
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    step1();
+}
+</script>
diff --git a/LayoutTests/http/tests/notifications/legacy/request.html b/LayoutTests/http/tests/notifications/legacy/request.html
new file mode 100644 (file)
index 0000000..bdbf785
--- /dev/null
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<script src="/resources/js-test-pre.js"></script>
+<script src="/resources/notifications-test-pre.js"></script>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description("This test checks that a request for permission is made.");
+
+function step1() {
+    debug("Requesting permission with default permission");
+    shouldBe("window.webkitNotifications.checkPermission()", "1");
+    webkitNotifications.requestPermission(function() {
+        shouldBe("window.webkitNotifications.checkPermission()", "0");
+        setTimeout(step2, 0);
+    });
+}
+
+function step2() {
+    testRunner.denyWebNotificationPermission(testURL);
+    debug("Requesting permission with non-default permission");
+    webkitNotifications.requestPermission(function() {
+        shouldBe("window.webkitNotifications.checkPermission()", "2");
+        testCompleted();
+    });
+}
+
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    step1();
+}
+</script>
diff --git a/LayoutTests/http/tests/notifications/legacy/resources/notify-opener-done.html b/LayoutTests/http/tests/notifications/legacy/resources/notify-opener-done.html
new file mode 100644 (file)
index 0000000..63218dd
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<script>
+opener.postMessage("DONE", '*');
+</script>
diff --git a/LayoutTests/http/tests/notifications/legacy/resources/request-permission-then-navigate.html b/LayoutTests/http/tests/notifications/legacy/resources/request-permission-then-navigate.html
new file mode 100644 (file)
index 0000000..fd56142
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<script>
+function requestPermission()
+{
+  window.webkitNotifications.requestPermission(function() { });
+}
+
+window.onunload = requestPermission;
+window.location = "notify-opener-done.html"
+</script>
diff --git a/LayoutTests/http/tests/notifications/legacy/show-expected.txt b/LayoutTests/http/tests/notifications/legacy/show-expected.txt
new file mode 100644 (file)
index 0000000..d773747
--- /dev/null
@@ -0,0 +1,20 @@
+This test looks for the dispatch of the onshow event handler.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS window.webkitNotifications.checkPermission() is 1
+PASS window.webkitNotifications.createNotification('', 'title 1', 'body'); threw exception SecurityError (DOM Exception 18): The operation is insecure..
+Granting permission to http://127.0.0.1:8000
+PASS window.webkitNotifications.checkPermission() is 0
+PASS ondisplay event handler was called
+PASS this.ondisplay is this.onshow
+Denying permission to http://127.0.0.1:8000
+PASS window.webkitNotifications.checkPermission() is 2
+PASS window.webkitNotifications.createNotification('', 'title 3', 'body'); threw exception SecurityError (DOM Exception 18): The operation is insecure..
+Resetting all permissions
+PASS window.webkitNotifications.checkPermission() is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/http/tests/notifications/legacy/show.html b/LayoutTests/http/tests/notifications/legacy/show.html
new file mode 100644 (file)
index 0000000..a299f8a
--- /dev/null
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<script src="/resources/js-test-pre.js"></script>
+<script src="/resources/notifications-test-pre.js"></script>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+if (window.testRunner)
+       testRunner.waitUntilDone();
+
+description("This test looks for the dispatch of the onshow event handler.");
+
+var n = null;
+function part1() {
+       shouldBe("window.webkitNotifications.checkPermission()", "1");
+       shouldThrow("window.webkitNotifications.createNotification('', 'title 1', 'body');");
+       setTimeout(part2, 0);
+}
+
+function part2() {
+       debug("Granting permission to " + testURL);
+       testRunner.grantWebNotificationPermission(testURL);
+       shouldBe("window.webkitNotifications.checkPermission()", "0");
+
+       n = window.webkitNotifications.createNotification("", "title 2", "body");
+       n.ondisplay = function() {
+               testPassed("ondisplay event handler was called");
+               shouldBe("this.ondisplay", "this.onshow");
+               setTimeout(part3, 0);
+       };
+       n.onerror = function() {
+               testFailed("onerror event handler should not be called");
+               setTimeout(part3, 0);
+       };
+       n.show();
+}
+
+function part3() {
+       debug("Denying permission to " + testURL);
+       testRunner.denyWebNotificationPermission(testURL);
+       shouldBe("window.webkitNotifications.checkPermission()", "2");
+       shouldThrow("window.webkitNotifications.createNotification('', 'title 3', 'body');");
+       setTimeout(part4, 0);
+}
+
+function part4() {
+       debug("Resetting all permissions");
+       testRunner.removeAllWebNotificationPermissions();
+       shouldBe("window.webkitNotifications.checkPermission()", "1");
+       testCompleted();
+}
+
+part1();
+</script>
diff --git a/LayoutTests/http/tests/notifications/legacy/window-show-on-click-expected.txt b/LayoutTests/http/tests/notifications/legacy/window-show-on-click-expected.txt
new file mode 100644 (file)
index 0000000..59ab8ae
--- /dev/null
@@ -0,0 +1,11 @@
+This test checks that a script can open windows when the user clicks on a native notification.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS webkitNotifications.checkPermission() is 0
+PASS clicking on notification successfully opened a window
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/http/tests/notifications/legacy/window-show-on-click.html b/LayoutTests/http/tests/notifications/legacy/window-show-on-click.html
new file mode 100644 (file)
index 0000000..7d903f6
--- /dev/null
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<script src="/resources/js-test-pre.js"></script>
+<script src="/resources/notifications-test-pre.js"></script>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+if (window.testRunner) {
+    testRunner.grantWebNotificationPermission(testURL);
+    testRunner.setCanOpenWindows(true);
+    testRunner.waitUntilDone();
+}
+
+description("This test checks that a script can open windows when the user clicks on a native notification.");
+
+shouldBe("webkitNotifications.checkPermission()", "0");
+var n = webkitNotifications.createNotification("", "", "");
+n.ondisplay = function() {
+    if (window.testRunner)
+        testRunner.simulateWebNotificationClick(this);
+};
+n.onclick = function() {
+    window.open('/notifications/resources/window-show-on-click.html');
+};
+n.show();
+
+function onWindowOpen() {
+    testPassed('clicking on notification successfully opened a window');
+    testCompleted();
+}
+</script>
index 103d8c0..a57d427 100644 (file)
@@ -162,9 +162,19 @@ webkit.org/b/98927 fast/dom/DeviceMotion [ Skip ]
 webkit.org/b/98927 fast/dom/DeviceOrientation [ Skip ]
 
 # https://bugs.webkit.org/show_bug.cgi?id=81697 Skip file:// based notifications tests
+fast/notifications
 fast/history/page-cache-notification-non-suspendable.html
 fast/history/page-cache-notification-suspendable.html
 
+# we do not enable legacy notifications
+http/tests/notifications/legacy/window-show-on-click.html
+http/tests/notifications/legacy/request.html
+http/tests/notifications/legacy/request-no-callback.html
+http/tests/notifications/legacy/events.html
+http/tests/notifications/legacy/show.html
+http/tests/notifications/legacy/double-show.html
+http/tests/notifications/legacy/notification-request-permission-then-navigate.html
+
 # Datalist is not yet enabled.
 webkit.org/b/98934 fast/forms/datalist [ Skip ]
 
index 329e76f..c425bf4 100644 (file)
@@ -48,6 +48,7 @@ fast/events/constructors/device-proximity-event-constructor.html
 printing
 
 # Web Notifications are not supported on iOS.
+fast/notifications
 http/tests/notifications
 fast/history/page-cache-notification-non-suspendable.html
 fast/history/page-cache-notification-suspendable.html
index 52a6f0d..0dc964b 100644 (file)
@@ -47,6 +47,9 @@ fast/events/attempt-scroll-with-no-scrollbars.html [ Failure ]
 # Pixel test doesn't repaint entire view so result is corrupted by previous test
 webkit.org/b/21916 tables/mozilla_expected_failures/bugs/bug178855.xml [ Pass ImageOnlyFailure Failure ]
 
+# https://bugs.webkit.org/show_bug.cgi?id=81697 Skip file:// based notifications tests
+fast/notifications
+
 # This port doesn't support detecting slow unload handlers.
 fast/dom/Window/slow-unload-handler.html
 fast/dom/Window/slow-unload-handler-only-frame-is-stopped.html
index 9c0ee18..8de3e42 100644 (file)
@@ -144,6 +144,7 @@ fast/events/popup-blocking-click-in-iframe.html [ Skip ]
 fast/dom/Geolocation/ [ Skip ]
 
 # TODO This port doesn't support Notifications.
+fast/notifications/ [ Skip ]
 http/tests/notifications/ [ Skip ]
 fast/history/page-cache-notification-non-suspendable.html [ Skip ]
 fast/history/page-cache-notification-suspendable.html [ Skip ]
index c9fe6a2..8639fed 100644 (file)
@@ -1,3 +1,17 @@
+2017-05-04  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r216206.
+        https://bugs.webkit.org/show_bug.cgi?id=171714
+
+        Multiple LayoutTests crashing in Document::page() (Requested
+        by ap on #webkit).
+
+        Reverted changeset:
+
+        "Remove support for legacy Notifications"
+        https://bugs.webkit.org/show_bug.cgi?id=171487
+        http://trac.webkit.org/changeset/216206
+
 2017-05-04  Don Olmstead  <don.olmstead@am.sony.com>
 
         [Win] Remove redundant macros that are set in the CMake config
index 4aba02d..0ba5e18 100644 (file)
@@ -139,6 +139,7 @@ ENABLE_KEYBOARD_KEY_ATTRIBUTE = ENABLE_KEYBOARD_KEY_ATTRIBUTE;
 ENABLE_KEYBOARD_CODE_ATTRIBUTE = ENABLE_KEYBOARD_CODE_ATTRIBUTE;
 ENABLE_LEGACY_CSS_VENDOR_PREFIXES = ENABLE_LEGACY_CSS_VENDOR_PREFIXES;
 ENABLE_LEGACY_ENCRYPTED_MEDIA[sdk=macosx*] = ENABLE_LEGACY_ENCRYPTED_MEDIA;
+ENABLE_LEGACY_NOTIFICATIONS[sdk=macosx*] = ENABLE_LEGACY_NOTIFICATIONS;
 ENABLE_LEGACY_VENDOR_PREFIXES = ENABLE_LEGACY_VENDOR_PREFIXES;
 ENABLE_LETTERPRESS[sdk=iphone*] = ENABLE_LETTERPRESS;
 ENABLE_LINK_PREFETCH = ;
@@ -254,4 +255,4 @@ ENABLE_VARIATION_FONTS_IF_NOT_ = $(ENABLE_VARIATION_FONTS_IF_NOT_NO);
 ENABLE_VARIATION_FONTS_IF_NOT_NO = ENABLE_VARIATION_FONTS;
 ENABLE_VARIATION_FONTS_IF_NOT_YES = ;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_DELEGATE) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FETCH_API) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOSNIFF) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEB_ANIMATIONS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_RTC) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_DELEGATE) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FETCH_API) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOSNIFF) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEB_ANIMATIONS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_RTC) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
index 603aff2..ca2e375 100644 (file)
@@ -1,3 +1,17 @@
+2017-05-04  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r216206.
+        https://bugs.webkit.org/show_bug.cgi?id=171714
+
+        Multiple LayoutTests crashing in Document::page() (Requested
+        by ap on #webkit).
+
+        Reverted changeset:
+
+        "Remove support for legacy Notifications"
+        https://bugs.webkit.org/show_bug.cgi?id=171487
+        http://trac.webkit.org/changeset/216206
+
 2017-05-04  Don Olmstead  <don.olmstead@am.sony.com>
 
         [Win] Remove redundant macros that are set in the CMake config
index 134a8b1..b584712 100644 (file)
@@ -538,6 +538,10 @@ the public iOS SDK. We will also need to update the FeatureDefines.xcconfig file
 #define ENABLE_LEGACY_ENCRYPTED_MEDIA 0
 #endif
 
+#if !defined(ENABLE_LEGACY_NOTIFICATIONS)
+#define ENABLE_LEGACY_NOTIFICATIONS 0
+#endif
+
 #if !defined(ENABLE_LEGACY_VENDOR_PREFIXES)
 #define ENABLE_LEGACY_VENDOR_PREFIXES 0
 #endif
index a472e40..2825be4 100644 (file)
@@ -261,8 +261,11 @@ set(WebCore_NON_SVG_IDL_FILES
 
     Modules/navigatorcontentutils/NavigatorContentUtils.idl
 
+    Modules/notifications/DOMWindowNotifications.idl
     Modules/notifications/Notification.idl
+    Modules/notifications/NotificationCenter.idl
     Modules/notifications/NotificationPermissionCallback.idl
+    Modules/notifications/WorkerGlobalScopeNotifications.idl
 
     Modules/proximity/DeviceProximityEvent.idl
 
@@ -979,8 +982,11 @@ set(WebCore_SOURCES
 
     Modules/navigatorcontentutils/NavigatorContentUtils.cpp
 
+    Modules/notifications/DOMWindowNotifications.cpp
     Modules/notifications/Notification.cpp
+    Modules/notifications/NotificationCenter.cpp
     Modules/notifications/NotificationController.cpp
+    Modules/notifications/WorkerGlobalScopeNotifications.cpp
 
     Modules/proximity/DeviceProximityController.cpp
     Modules/proximity/DeviceProximityEvent.cpp
index 0bca65c..d229dca 100644 (file)
@@ -1,3 +1,17 @@
+2017-05-04  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r216206.
+        https://bugs.webkit.org/show_bug.cgi?id=171714
+
+        Multiple LayoutTests crashing in Document::page() (Requested
+        by ap on #webkit).
+
+        Reverted changeset:
+
+        "Remove support for legacy Notifications"
+        https://bugs.webkit.org/show_bug.cgi?id=171487
+        http://trac.webkit.org/changeset/216206
+
 2017-05-04  Chris Dumez  <cdumez@apple.com>
 
         Drop remaining uses of PassRefPtr from CompositeEditCommand
index 4aba02d..0ba5e18 100644 (file)
@@ -139,6 +139,7 @@ ENABLE_KEYBOARD_KEY_ATTRIBUTE = ENABLE_KEYBOARD_KEY_ATTRIBUTE;
 ENABLE_KEYBOARD_CODE_ATTRIBUTE = ENABLE_KEYBOARD_CODE_ATTRIBUTE;
 ENABLE_LEGACY_CSS_VENDOR_PREFIXES = ENABLE_LEGACY_CSS_VENDOR_PREFIXES;
 ENABLE_LEGACY_ENCRYPTED_MEDIA[sdk=macosx*] = ENABLE_LEGACY_ENCRYPTED_MEDIA;
+ENABLE_LEGACY_NOTIFICATIONS[sdk=macosx*] = ENABLE_LEGACY_NOTIFICATIONS;
 ENABLE_LEGACY_VENDOR_PREFIXES = ENABLE_LEGACY_VENDOR_PREFIXES;
 ENABLE_LETTERPRESS[sdk=iphone*] = ENABLE_LETTERPRESS;
 ENABLE_LINK_PREFETCH = ;
@@ -254,4 +255,4 @@ ENABLE_VARIATION_FONTS_IF_NOT_ = $(ENABLE_VARIATION_FONTS_IF_NOT_NO);
 ENABLE_VARIATION_FONTS_IF_NOT_NO = ENABLE_VARIATION_FONTS;
 ENABLE_VARIATION_FONTS_IF_NOT_YES = ;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_DELEGATE) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FETCH_API) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOSNIFF) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEB_ANIMATIONS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_RTC) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_DELEGATE) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FETCH_API) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOSNIFF) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEB_ANIMATIONS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_RTC) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
index e3471cf..5a661f1 100644 (file)
 #include "JSDOMWindow.cpp"
 #include "JSDOMWindowFetch.cpp"
 #include "JSDOMWindowIndexedDatabase.cpp"
+#include "JSDOMWindowNotifications.cpp"
 #include "JSDOMWindowSpeechSynthesis.cpp"
 #include "JSDOMWindowWebDatabase.cpp"
 #include "JSElement.cpp"
 #include "JSNonDocumentTypeChildNode.cpp"
 #include "JSNonElementParentNode.cpp"
 #include "JSNotification.cpp"
+#include "JSNotificationCenter.cpp"
 #include "JSNotificationPermissionCallback.cpp"
 #include "JSOverflowEvent.cpp"
 #include "JSOfflineAudioCompletionEvent.cpp"
 #include "JSWorkerGlobalScope.cpp"
 #include "JSWorkerGlobalScopeFetch.cpp"
 #include "JSWorkerGlobalScopeIndexedDatabase.cpp"
+#include "JSWorkerGlobalScopeNotifications.cpp"
 #include "JSWorkerLocation.cpp"
 #include "JSWorkerNavigator.cpp"
 #include "JSWritableStream.cpp"
index 647222f..0acd29c 100644 (file)
@@ -202,8 +202,11 @@ JS_BINDING_IDLS = \
     $(WebCore)/Modules/mediastream/RTCSignalingState.idl \
     $(WebCore)/Modules/mediastream/RTCStatsReport.idl \
     $(WebCore)/Modules/mediastream/RTCTrackEvent.idl \
+    $(WebCore)/Modules/notifications/DOMWindowNotifications.idl \
     $(WebCore)/Modules/notifications/Notification.idl \
+    $(WebCore)/Modules/notifications/NotificationCenter.idl \
     $(WebCore)/Modules/notifications/NotificationPermissionCallback.idl \
+    $(WebCore)/Modules/notifications/WorkerGlobalScopeNotifications.idl \
     $(WebCore)/Modules/plugins/QuickTimePluginReplacement.idl \
     $(WebCore)/Modules/quota/DOMWindowQuota.idl \
     $(WebCore)/Modules/quota/NavigatorStorageQuota.idl \
diff --git a/Source/WebCore/Modules/notifications/DOMWindowNotifications.cpp b/Source/WebCore/Modules/notifications/DOMWindowNotifications.cpp
new file mode 100644 (file)
index 0000000..be9d681
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DOMWindowNotifications.h"
+
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+
+#include "DOMWindow.h"
+#include "Document.h"
+#include "NotificationCenter.h"
+#include "NotificationController.h"
+#include "Page.h"
+
+namespace WebCore {
+
+DOMWindowNotifications::DOMWindowNotifications(DOMWindow* window)
+    : DOMWindowProperty(window->frame())
+    , m_window(window)
+{
+}
+
+DOMWindowNotifications::~DOMWindowNotifications()
+{
+}
+
+const char* DOMWindowNotifications::supplementName()
+{
+    return "DOMWindowNotifications";
+}
+
+DOMWindowNotifications* DOMWindowNotifications::from(DOMWindow* window)
+{
+    DOMWindowNotifications* supplement = static_cast<DOMWindowNotifications*>(Supplement<DOMWindow>::from(window, supplementName()));
+    if (!supplement) {
+        auto newSupplement = std::make_unique<DOMWindowNotifications>(window);
+        supplement = newSupplement.get();
+        provideTo(window, supplementName(), WTFMove(newSupplement));
+    }
+    return supplement;
+}
+
+NotificationCenter* DOMWindowNotifications::webkitNotifications(DOMWindow& window)
+{
+    return DOMWindowNotifications::from(&window)->webkitNotifications();
+}
+
+void DOMWindowNotifications::disconnectFrameForDocumentSuspension()
+{
+    m_suspendedNotificationCenter = WTFMove(m_notificationCenter);
+    DOMWindowProperty::disconnectFrameForDocumentSuspension();
+}
+
+void DOMWindowNotifications::reconnectFrameFromDocumentSuspension(Frame* frame)
+{
+    DOMWindowProperty::reconnectFrameFromDocumentSuspension(frame);
+    m_notificationCenter = WTFMove(m_suspendedNotificationCenter);
+}
+
+void DOMWindowNotifications::willDestroyGlobalObjectInCachedFrame()
+{
+    m_suspendedNotificationCenter = nullptr;
+    DOMWindowProperty::willDestroyGlobalObjectInCachedFrame();
+}
+
+void DOMWindowNotifications::willDestroyGlobalObjectInFrame()
+{
+    m_notificationCenter = nullptr;
+    DOMWindowProperty::willDestroyGlobalObjectInFrame();
+}
+
+void DOMWindowNotifications::willDetachGlobalObjectFromFrame()
+{
+    m_notificationCenter = nullptr;
+    DOMWindowProperty::willDetachGlobalObjectFromFrame();
+}
+
+NotificationCenter* DOMWindowNotifications::webkitNotifications()
+{
+    if (!m_window->isCurrentlyDisplayedInFrame())
+        return nullptr;
+
+    if (m_notificationCenter)
+        return m_notificationCenter.get();
+
+    auto* document = m_window->document();
+    if (!document)
+        return nullptr;
+    
+    auto* page = document->page();
+    if (!page)
+        return nullptr;
+
+    auto* provider = NotificationController::clientFrom(*page);
+    if (!provider)
+        return nullptr;
+
+    m_notificationCenter = NotificationCenter::create(*document, provider);
+    return m_notificationCenter.get();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
diff --git a/Source/WebCore/Modules/notifications/DOMWindowNotifications.h b/Source/WebCore/Modules/notifications/DOMWindowNotifications.h
new file mode 100644 (file)
index 0000000..7fd5ba6
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+
+#include "DOMWindowProperty.h"
+#include "Supplementable.h"
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class DOMWindow;
+class NotificationCenter;
+
+class DOMWindowNotifications : public Supplement<DOMWindow>, public DOMWindowProperty {
+public:
+    explicit DOMWindowNotifications(DOMWindow*);
+    virtual ~DOMWindowNotifications();
+
+    static NotificationCenter* webkitNotifications(DOMWindow&);
+    static DOMWindowNotifications* from(DOMWindow*);
+
+    void disconnectFrameForDocumentSuspension() override;
+    void reconnectFrameFromDocumentSuspension(Frame*) override;
+    void willDestroyGlobalObjectInCachedFrame() override;
+    void willDestroyGlobalObjectInFrame() override;
+    void willDetachGlobalObjectFromFrame() override;
+
+private:
+    NotificationCenter* webkitNotifications();
+    static const char* supplementName();
+
+    DOMWindow* m_window;
+    RefPtr<NotificationCenter> m_notificationCenter;
+    RefPtr<NotificationCenter> m_suspendedNotificationCenter;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
diff --git a/Source/WebCore/Modules/notifications/DOMWindowNotifications.idl b/Source/WebCore/Modules/notifications/DOMWindowNotifications.idl
new file mode 100644 (file)
index 0000000..50ddfb2
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS,
+] partial interface DOMWindow {
+#if defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS
+    readonly attribute NotificationCenter webkitNotifications;
+#endif
+};
+
index 848266d..bb8719d 100644 (file)
 
 #include "config.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #include "Notification.h"
 
+#include "DOMWindow.h"
+#include "DOMWindowNotifications.h"
 #include "Document.h"
 #include "Event.h"
 #include "EventNames.h"
 #include "ExceptionCode.h"
+#include "NotificationCenter.h"
 #include "NotificationController.h"
 #include "NotificationPermissionCallback.h"
+#include "VoidCallback.h"
 #include "WindowFocusAllowedIndicator.h"
 
 namespace WebCore {
 
+#if ENABLE(LEGACY_NOTIFICATIONS)
+
+Notification::Notification(const String& title, const String& body, URL&& iconURL, ScriptExecutionContext& context, NotificationCenter& notificationCenter)
+    : ActiveDOMObject(&context)
+    , m_icon(WTFMove(iconURL))
+    , m_title(title)
+    , m_body(body)
+    , m_notificationCenter(&notificationCenter)
+{
+}
+
+#endif
+
+#if ENABLE(NOTIFICATIONS)
+
 Notification::Notification(Document& document, const String& title)
     : ActiveDOMObject(&document)
     , m_title(title)
     , m_state(Idle)
+    , m_notificationCenter(DOMWindowNotifications::webkitNotifications(*document.domWindow()))
     , m_taskTimer(std::make_unique<Timer>([this] () { show(); }))
 {
+    // FIXME: Seems that m_notificationCenter can be null so should not be changed from RefPtr to Ref.
+    // But the rest of the code in this class isn't trying to handle that case.
+    ASSERT(m_notificationCenter->client());
     m_taskTimer->startOneShot(0_s);
 }
 
+#endif
+
 Notification::~Notification() 
 {
 }
 
+#if ENABLE(LEGACY_NOTIFICATIONS)
+
+ExceptionOr<Ref<Notification>> Notification::create(const String& title, const String& body, const String& iconURL, ScriptExecutionContext& context, NotificationCenter& provider)
+{ 
+    if (provider.checkPermission() != NotificationClient::PermissionAllowed)
+        return Exception { SECURITY_ERR };
+
+    URL completedIconURL = iconURL.isEmpty() ? URL() : context.completeURL(iconURL);
+    if (!completedIconURL.isEmpty() && !completedIconURL.isValid())
+        return Exception { SYNTAX_ERR };
+
+    auto notification = adoptRef(*new Notification(title, body, WTFMove(completedIconURL), context, provider));
+    notification.get().suspendIfNeeded();
+    return WTFMove(notification);
+}
+
+#endif
+
+#if ENABLE(NOTIFICATIONS)
+
 static String directionString(Notification::Direction direction)
 {
     // FIXME: Storing this as a string is not the right way to do it.
@@ -77,38 +122,38 @@ static String directionString(Notification::Direction direction)
 Ref<Notification> Notification::create(Document& context, const String& title, const Options& options)
 {
     auto notification = adoptRef(*new Notification(context, title));
-    notification->m_body = options.body;
-    notification->m_tag = options.tag;
-    notification->m_lang = options.lang;
-    notification->m_direction = directionString(options.dir);
+    notification.get().m_body = options.body;
+    notification.get().m_tag = options.tag;
+    notification.get().m_lang = options.lang;
+    notification.get().m_direction = directionString(options.dir);
     if (!options.icon.isEmpty()) {
         auto iconURL = context.completeURL(options.icon);
         if (iconURL.isValid())
-            notification->m_icon = iconURL;
+            notification.get().m_icon = iconURL;
     }
-    notification->suspendIfNeeded();
+    notification.get().suspendIfNeeded();
     return notification;
 }
 
+#endif
+
 void Notification::show() 
 {
     // prevent double-showing
-    if (m_state != Idle)
-        return;
-
-    auto* page = downcast<Document>(*scriptExecutionContext()).page();
-    if (!page)
-        return;
-
-    auto& client = NotificationController::from(page)->client();
-
-    if (client.checkPermission(scriptExecutionContext()) != NotificationClient::PermissionAllowed) {
-        dispatchErrorEvent();
-        return;
-    }
-    if (client.show(this)) {
-        m_state = Showing;
-        setPendingActivity(this);
+    if (m_state == Idle && m_notificationCenter->client()) {
+#if ENABLE(NOTIFICATIONS)
+        auto* page = downcast<Document>(*scriptExecutionContext()).page();
+        if (!page)
+            return;
+        if (NotificationController::from(page)->client().checkPermission(scriptExecutionContext()) != NotificationClient::PermissionAllowed) {
+            dispatchErrorEvent();
+            return;
+        }
+#endif
+        if (m_notificationCenter->client()->show(this)) {
+            m_state = Showing;
+            setPendingActivity(this);
+        }
     }
 }
 
@@ -117,12 +162,10 @@ void Notification::close()
     switch (m_state) {
     case Idle:
         break;
-    case Showing: {
-        auto* page = downcast<Document>(*scriptExecutionContext()).page();
-        if (page)
-            NotificationController::from(page)->client().cancel(this);
+    case Showing:
+        if (m_notificationCenter->client())
+            m_notificationCenter->client()->cancel(this);
         break;
-    }
     case Closed:
         break;
     }
@@ -131,10 +174,8 @@ void Notification::close()
 void Notification::contextDestroyed()
 {
     ActiveDOMObject::contextDestroyed();
-
-    auto* page = downcast<Document>(*scriptExecutionContext()).page();
-    if (page)
-        NotificationController::from(page)->client().notificationObjectDestroyed(this);
+    if (m_notificationCenter->client())
+        m_notificationCenter->client()->notificationObjectDestroyed(this);
 }
 
 const char* Notification::activeDOMObjectName() const
@@ -178,6 +219,8 @@ void Notification::dispatchErrorEvent()
     dispatchEvent(Event::create(eventNames().errorEvent, false, false));
 }
 
+#if ENABLE(NOTIFICATIONS)
+
 String Notification::permission(Document& document)
 {
     return permissionString(NotificationController::from(document.page())->client().checkPermission(&document));
@@ -202,6 +245,8 @@ void Notification::requestPermission(Document& document, RefPtr<NotificationPerm
     NotificationController::from(document.page())->client().requestPermission(&document, WTFMove(callback));
 }
 
+#endif
+
 } // namespace WebCore
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
index e32af07..3b21bbc 100644 (file)
@@ -31,7 +31,7 @@
 
 #pragma once
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #include "ActiveDOMObject.h"
 #include "EventTarget.h"
 namespace WebCore {
 
 class Document;
+class NotificationCenter;
 class NotificationPermissionCallback;
 
 class Notification final : public RefCounted<Notification>, public ActiveDOMObject, public EventTargetWithInlineData {
     WTF_MAKE_FAST_ALLOCATED;
 public:
+#if ENABLE(LEGACY_NOTIFICATIONS)
+    static ExceptionOr<Ref<Notification>> create(const String& title, const String& body, const String& iconURL, ScriptExecutionContext&, NotificationCenter&);
+#endif
+
+#if ENABLE(NOTIFICATIONS)
     enum class Direction { Auto, Ltr, Rtl };
     struct Options {
         Direction dir;
@@ -58,6 +64,7 @@ public:
         String icon;
     };
     static Ref<Notification> create(Document&, const String& title, const Options&);
+#endif
     
     virtual ~Notification();
 
@@ -87,9 +94,11 @@ public:
 
     WEBCORE_EXPORT void finalize();
 
+#if ENABLE(NOTIFICATIONS)
     static String permission(Document&);
     WEBCORE_EXPORT static String permissionString(NotificationClient::Permission);
     static void requestPermission(Document&, RefPtr<NotificationPermissionCallback>&&);
+#endif
 
     ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); }
 
@@ -97,7 +106,13 @@ public:
     using RefCounted::deref;
 
 private:
+#if ENABLE(LEGACY_NOTIFICATIONS)
+    Notification(const String& title, const String& body, URL&& iconURL, ScriptExecutionContext&, NotificationCenter&);
+#endif
+
+#if ENABLE(NOTIFICATIONS)
     Notification(Document&, const String& title);
+#endif
 
     EventTargetInterface eventTargetInterface() const final { return NotificationEventTargetInterfaceType; }
 
@@ -118,9 +133,13 @@ private:
     enum State { Idle, Showing, Closed };
     State m_state { Idle };
 
+    RefPtr<NotificationCenter> m_notificationCenter;
+
+#if ENABLE(NOTIFICATIONS)
     std::unique_ptr<Timer> m_taskTimer;
+#endif
 };
 
 } // namespace WebCore
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
index 8cbfc0e..cb3fbee 100644 (file)
  */
 
 [
-    Conditional=NOTIFICATIONS,
+    Conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS,
     ActiveDOMObject,
     ExportMacro=WEBCORE_EXPORT,
+#if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
     Constructor(DOMString title, optional NotificationOptions options),
     ConstructorCallWith=Document,
+#endif
 ] interface Notification : EventTarget {
     void show();
-    void close();
+    [Conditional=LEGACY_NOTIFICATIONS, ImplementedAs=close] void cancel();
+    [Conditional=NOTIFICATIONS] void close();
 
-    [CallWith=Document] static readonly attribute DOMString permission;
-    [CallWith=Document] static void requestPermission(optional NotificationPermissionCallback? callback);
+    [Conditional=NOTIFICATIONS, CallWith=Document] static readonly attribute DOMString permission;
+    [Conditional=NOTIFICATIONS, CallWith=Document] static void requestPermission(optional NotificationPermissionCallback? callback);
 
     attribute EventHandler onclick;
-    attribute EventHandler onerror;
     attribute EventHandler onclose;
     [ImplementedAs=onshow] attribute EventHandler ondisplay;
+    attribute EventHandler onerror;
     attribute EventHandler onshow;
 
-    attribute DOMString tag;
-};
+    [Conditional=LEGACY_NOTIFICATIONS] attribute DOMString dir;
+    [Conditional=LEGACY_NOTIFICATIONS] attribute DOMString replaceId;
 
-[
-    Conditional=NOTIFICATIONS
-] enum NotificationDirection {
-    "auto",
-    "ltr",
-    "rtl"
+    [Conditional=NOTIFICATIONS] attribute DOMString tag;
 };
 
-[
-    Conditional=NOTIFICATIONS
-] dictionary NotificationOptions {
+[Conditional=NOTIFICATIONS] enum NotificationDirection { "auto", "ltr", "rtl" };
+
+[Conditional=NOTIFICATIONS] dictionary NotificationOptions {
     NotificationDirection dir = "auto";
     DOMString lang = "";
     DOMString body = "";
diff --git a/Source/WebCore/Modules/notifications/NotificationCenter.cpp b/Source/WebCore/Modules/notifications/NotificationCenter.cpp
new file mode 100644 (file)
index 0000000..925eb96
--- /dev/null
@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2012, 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+
+#include "NotificationCenter.h"
+
+#include "ExceptionCode.h"
+#include "Notification.h"
+#include "ScriptExecutionContext.h"
+#include "SecurityOrigin.h"
+#include "VoidCallback.h"
+
+namespace WebCore {
+
+Ref<NotificationCenter> NotificationCenter::create(ScriptExecutionContext& context, NotificationClient* client)
+{
+    auto notificationCenter = adoptRef(*new NotificationCenter(context, client));
+    notificationCenter->suspendIfNeeded();
+    return notificationCenter;
+}
+
+NotificationCenter::NotificationCenter(ScriptExecutionContext& context, NotificationClient* client)
+    : ActiveDOMObject(&context)
+    , m_client(client)
+    , m_timer([this]() { timerFired(); })
+{
+}
+
+#if ENABLE(LEGACY_NOTIFICATIONS)
+
+ExceptionOr<Ref<Notification>> NotificationCenter::createNotification(const String& iconURI, const String& title, const String& body)
+{
+    if (!m_client || !scriptExecutionContext())
+        return Exception { INVALID_STATE_ERR };
+    return Notification::create(title, body, iconURI, *scriptExecutionContext(), *this);
+}
+
+int NotificationCenter::checkPermission()
+{
+    if (!m_client || !scriptExecutionContext())
+        return NotificationClient::PermissionDenied;
+
+    switch (scriptExecutionContext()->securityOrigin()->canShowNotifications()) {
+    case SecurityOrigin::AlwaysAllow:
+        return NotificationClient::PermissionAllowed;
+    case SecurityOrigin::AlwaysDeny:
+        return NotificationClient::PermissionDenied;
+    case SecurityOrigin::Ask:
+        return m_client->checkPermission(scriptExecutionContext());
+    }
+
+    ASSERT_NOT_REACHED();
+    return m_client->checkPermission(scriptExecutionContext());
+}
+
+void NotificationCenter::requestPermission(RefPtr<VoidCallback>&& callback)
+{
+    if (!m_client || !scriptExecutionContext())
+        return;
+
+    switch (scriptExecutionContext()->securityOrigin()->canShowNotifications()) {
+    case SecurityOrigin::AlwaysAllow:
+    case SecurityOrigin::AlwaysDeny:
+        if (m_callbacks.isEmpty()) {
+            ref(); // Balanced by the derefs in NotificationCenter::stop and NotificationCenter::timerFired.
+            m_timer.startOneShot(0_s);
+        }
+        m_callbacks.append([callback]() {
+            if (callback)
+                callback->handleEvent();
+        });
+        return;
+    case SecurityOrigin::Ask:
+        m_client->requestPermission(scriptExecutionContext(), WTFMove(callback));
+        return;
+    }
+
+    ASSERT_NOT_REACHED();
+    m_client->requestPermission(scriptExecutionContext(), WTFMove(callback));
+}
+
+#endif
+
+void NotificationCenter::stop()
+{
+    if (!m_client)
+        return;
+
+    // Clear m_client immediately to guarantee reentrant calls to NotificationCenter do nothing.
+    // Also protect |this| so it's not indirectly destroyed under us by work done by the client.
+    auto& client = *std::exchange(m_client, nullptr);
+    Ref<NotificationCenter> protectedThis(*this);
+
+    if (!m_callbacks.isEmpty())
+        deref(); // Balanced by the ref in NotificationCenter::requestPermission.
+
+    m_timer.stop();
+    m_callbacks.clear();
+
+    client.cancelRequestsForPermission(scriptExecutionContext());
+    client.clearNotifications(scriptExecutionContext());
+}
+
+const char* NotificationCenter::activeDOMObjectName() const
+{
+    return "NotificationCenter";
+}
+
+bool NotificationCenter::canSuspendForDocumentSuspension() const
+{
+    // We don't need to worry about Notifications because those are ActiveDOMObject too.
+    // The NotificationCenter can safely be suspended if there are no pending permission requests.
+    return m_callbacks.isEmpty() && (!m_client || !m_client->hasPendingPermissionRequests(scriptExecutionContext()));
+}
+
+void NotificationCenter::timerFired()
+{
+    ASSERT(m_client);
+    auto callbacks = WTFMove(m_callbacks);
+    for (auto& callback : callbacks)
+        callback();
+    deref(); // Balanced by the ref in NotificationCenter::requestPermission.
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
diff --git a/Source/WebCore/Modules/notifications/NotificationCenter.h b/Source/WebCore/Modules/notifications/NotificationCenter.h
new file mode 100644 (file)
index 0000000..4646e18
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2011, 2012, 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "ActiveDOMObject.h"
+#include "ExceptionOr.h"
+#include "Timer.h"
+#include <wtf/RefCounted.h>
+
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+
+namespace WebCore {
+
+class Notification;
+class NotificationClient;
+class VoidCallback;
+
+class NotificationCenter final : public RefCounted<NotificationCenter>, private ActiveDOMObject {
+public:
+    static Ref<NotificationCenter> create(ScriptExecutionContext&, NotificationClient*);
+
+#if ENABLE(LEGACY_NOTIFICATIONS)
+    ExceptionOr<Ref<Notification>> createNotification(const String& iconURL, const String& title, const String& body);
+
+    int checkPermission();
+    void requestPermission(RefPtr<VoidCallback>&&);
+#endif
+
+    NotificationClient* client() const { return m_client; }
+
+    using ActiveDOMObject::hasPendingActivity;
+
+private:
+    NotificationCenter(ScriptExecutionContext&, NotificationClient*);
+
+    void stop() final;
+    const char* activeDOMObjectName() const final;
+    bool canSuspendForDocumentSuspension() const final;
+
+    void timerFired();
+
+    NotificationClient* m_client;
+    Vector<std::function<void ()>> m_callbacks;
+    Timer m_timer;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
diff --git a/Source/WebCore/Modules/notifications/NotificationCenter.idl b/Source/WebCore/Modules/notifications/NotificationCenter.idl
new file mode 100644 (file)
index 0000000..07a380f
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    ActiveDOMObject,
+    Conditional=LEGACY_NOTIFICATIONS,
+    NoInterfaceObject,
+] interface NotificationCenter {
+   [MayThrowException] Notification createNotification(DOMString iconUrl, DOMString title, DOMString body);
+
+   long checkPermission();
+   void requestPermission(optional VoidCallback? callback);
+};
index 24fb534..b03dfd9 100644 (file)
@@ -70,7 +70,12 @@ public:
     // Requests user permission to show desktop notifications from a particular
     // script context. The callback parameter should be run when the user has
     // made a decision.
+#if ENABLE(LEGACY_NOTIFICATIONS)
+    virtual void requestPermission(ScriptExecutionContext*, RefPtr<VoidCallback>&&) = 0;
+#endif
+#if ENABLE(NOTIFICATIONS)
     virtual void requestPermission(ScriptExecutionContext*, RefPtr<NotificationPermissionCallback>&&) = 0;
+#endif
 
     virtual bool hasPendingPermissionRequests(ScriptExecutionContext*) const = 0;
 
index a620353..fc08b27 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "NotificationController.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #include "NotificationClient.h"
 
@@ -63,4 +63,4 @@ void provideNotification(Page* page, NotificationClient* client)
 
 } // namespace WebCore
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
index e6019b1..25fca74 100644 (file)
@@ -25,7 +25,7 @@
 
 #pragma once
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #include "Page.h"
 #include <wtf/Forward.h>
@@ -52,4 +52,4 @@ private:
 
 } // namespace WebCore
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
diff --git a/Source/WebCore/Modules/notifications/WorkerGlobalScopeNotifications.cpp b/Source/WebCore/Modules/notifications/WorkerGlobalScopeNotifications.cpp
new file mode 100644 (file)
index 0000000..022163d
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ *
+ */
+
+#include "config.h"
+#include "WorkerGlobalScopeNotifications.h"
+
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+
+#include "NotificationCenter.h"
+#include "WorkerGlobalScope.h"
+#include "WorkerThread.h"
+
+namespace WebCore {
+
+WorkerGlobalScopeNotifications::WorkerGlobalScopeNotifications(WorkerGlobalScope& scope)
+    : m_context(&scope)
+{
+}
+
+WorkerGlobalScopeNotifications::~WorkerGlobalScopeNotifications()
+{
+}
+
+const char* WorkerGlobalScopeNotifications::supplementName()
+{
+    return "WorkerGlobalScopeNotifications";
+}
+
+WorkerGlobalScopeNotifications* WorkerGlobalScopeNotifications::from(WorkerGlobalScope& scope)
+{
+    WorkerGlobalScopeNotifications* supplement = static_cast<WorkerGlobalScopeNotifications*>(Supplement<WorkerGlobalScope>::from(&scope, supplementName()));
+    if (!supplement) {
+        auto newSupplement = std::make_unique<WorkerGlobalScopeNotifications>(scope);
+        supplement = newSupplement.get();
+        provideTo(&scope, supplementName(), WTFMove(newSupplement));
+    }
+    return supplement;
+}
+
+NotificationCenter* WorkerGlobalScopeNotifications::webkitNotifications(WorkerGlobalScope& scope)
+{
+    return WorkerGlobalScopeNotifications::from(scope)->webkitNotifications();
+}
+
+NotificationCenter* WorkerGlobalScopeNotifications::webkitNotifications()
+{
+    // FIXME: As of this writing, this always passes nullptr for the client.
+    // If it wasn't for that, the notification center create function could be taking a reference.
+    // How is it useful to create a notification center with no client?
+    if (!m_notificationCenter)
+        m_notificationCenter = NotificationCenter::create(*m_context, m_context->thread().getNotificationClient());
+    return m_notificationCenter.get();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
diff --git a/Source/WebCore/Modules/notifications/WorkerGlobalScopeNotifications.h b/Source/WebCore/Modules/notifications/WorkerGlobalScopeNotifications.h
new file mode 100644 (file)
index 0000000..6760e6e
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2008, 2009, 2013, 2014, 2015, 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#pragma once
+
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+
+#include "Supplementable.h"
+
+namespace WebCore {
+
+class NotificationCenter;
+class WorkerGlobalScope;
+
+class WorkerGlobalScopeNotifications : public Supplement<WorkerGlobalScope> {
+public:
+    explicit WorkerGlobalScopeNotifications(WorkerGlobalScope&);
+    virtual ~WorkerGlobalScopeNotifications();
+
+    static NotificationCenter* webkitNotifications(WorkerGlobalScope&);
+    static WorkerGlobalScopeNotifications* from(WorkerGlobalScope&);
+
+private:
+    NotificationCenter* webkitNotifications();
+    static const char* supplementName();
+
+    WorkerGlobalScope* m_context;
+    RefPtr<NotificationCenter> m_notificationCenter;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
diff --git a/Source/WebCore/Modules/notifications/WorkerGlobalScopeNotifications.idl b/Source/WebCore/Modules/notifications/WorkerGlobalScopeNotifications.idl
new file mode 100644 (file)
index 0000000..4eb249d
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ *
+ */
+
+[
+    Conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS,
+] partial interface WorkerGlobalScope {
+#if defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS
+    readonly attribute NotificationCenter webkitNotifications;
+#endif
+};
+
index ef97486..f66577a 100644 (file)
@@ -1,3 +1,17 @@
+2017-05-04  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r216206.
+        https://bugs.webkit.org/show_bug.cgi?id=171714
+
+        Multiple LayoutTests crashing in Document::page() (Requested
+        by ap on #webkit).
+
+        Reverted changeset:
+
+        "Remove support for legacy Notifications"
+        https://bugs.webkit.org/show_bug.cgi?id=171487
+        http://trac.webkit.org/changeset/216206
+
 2017-05-04  Don Olmstead  <don.olmstead@am.sony.com>
 
         [Win] Remove redundant macros that are set in the CMake config
index 4aba02d..0ba5e18 100644 (file)
@@ -139,6 +139,7 @@ ENABLE_KEYBOARD_KEY_ATTRIBUTE = ENABLE_KEYBOARD_KEY_ATTRIBUTE;
 ENABLE_KEYBOARD_CODE_ATTRIBUTE = ENABLE_KEYBOARD_CODE_ATTRIBUTE;
 ENABLE_LEGACY_CSS_VENDOR_PREFIXES = ENABLE_LEGACY_CSS_VENDOR_PREFIXES;
 ENABLE_LEGACY_ENCRYPTED_MEDIA[sdk=macosx*] = ENABLE_LEGACY_ENCRYPTED_MEDIA;
+ENABLE_LEGACY_NOTIFICATIONS[sdk=macosx*] = ENABLE_LEGACY_NOTIFICATIONS;
 ENABLE_LEGACY_VENDOR_PREFIXES = ENABLE_LEGACY_VENDOR_PREFIXES;
 ENABLE_LETTERPRESS[sdk=iphone*] = ENABLE_LETTERPRESS;
 ENABLE_LINK_PREFETCH = ;
@@ -254,4 +255,4 @@ ENABLE_VARIATION_FONTS_IF_NOT_ = $(ENABLE_VARIATION_FONTS_IF_NOT_NO);
 ENABLE_VARIATION_FONTS_IF_NOT_NO = ENABLE_VARIATION_FONTS;
 ENABLE_VARIATION_FONTS_IF_NOT_YES = ;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_DELEGATE) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FETCH_API) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOSNIFF) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEB_ANIMATIONS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_RTC) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_DELEGATE) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FETCH_API) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOSNIFF) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEB_ANIMATIONS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_RTC) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
index 618912c..502c9fa 100644 (file)
                33503C9A10179A74003B47E1 /* NotificationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 33503C9910179A74003B47E1 /* NotificationClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                33503CA310179AD7003B47E1 /* JSNotification.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33503C9F10179AD7003B47E1 /* JSNotification.cpp */; };
                33503CA410179AD7003B47E1 /* JSNotification.h in Headers */ = {isa = PBXBuildFile; fileRef = 33503CA010179AD7003B47E1 /* JSNotification.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               33503CA510179AD7003B47E1 /* JSNotificationCenter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33503CA110179AD7003B47E1 /* JSNotificationCenter.cpp */; };
+               33503CA610179AD7003B47E1 /* JSNotificationCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 33503CA210179AD7003B47E1 /* JSNotificationCenter.h */; };
                33503CC71017A1B1003B47E1 /* Notification.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33503CC61017A1B1003B47E1 /* Notification.cpp */; };
+               3390CA550FFC157B00921962 /* NotificationCenter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3390CA510FFC157B00921962 /* NotificationCenter.cpp */; };
+               3390CA560FFC157B00921962 /* NotificationCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3390CA520FFC157B00921962 /* NotificationCenter.h */; };
                339B5B63131DAA3200F48D02 /* CookiesStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 339B5B62131DAA3200F48D02 /* CookiesStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };
                33D0212D131DB37B004091A8 /* CookieStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = E13F01EA1270E10D00DFBA71 /* CookieStorage.h */; settings = {ATTRIBUTES = (Private, ); }; };
                3571883EEF618793751E4089 /* RenderMathMLMenclose.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3662F984047CEDBE5DDDAFAA /* RenderMathMLMenclose.cpp */; };
                97AABD2714FA09D5007457AE /* WebSocketHandshake.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0C14FA09D5007457AE /* WebSocketHandshake.h */; };
                97AABD2C14FA09D5007457AE /* WorkerThreadableWebSocketChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABD1114FA09D5007457AE /* WorkerThreadableWebSocketChannel.cpp */; };
                97AABD2D14FA09D5007457AE /* WorkerThreadableWebSocketChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD1214FA09D5007457AE /* WorkerThreadableWebSocketChannel.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               97B38E27151C4271004622E9 /* DOMWindowNotifications.h in Headers */ = {isa = PBXBuildFile; fileRef = 97B38E24151C4264004622E9 /* DOMWindowNotifications.h */; };
+               97B38E28151C4273004622E9 /* DOMWindowNotifications.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97B38E23151C4264004622E9 /* DOMWindowNotifications.cpp */; };
                97B8FFD116AE7F960038388D /* CharacterReferenceParserInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 97B8FFCF16AE7F920038388D /* CharacterReferenceParserInlines.h */; };
                97BC69DC1505F076001B74AC /* ChangeVersionWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97BC69D81505F076001B74AC /* ChangeVersionWrapper.cpp */; };
                97BC69DD1505F076001B74AC /* ChangeVersionWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 97BC69D91505F076001B74AC /* ChangeVersionWrapper.h */; };
                97DCE20210807C750057D394 /* HistoryController.h in Headers */ = {isa = PBXBuildFile; fileRef = 97DCE20010807C750057D394 /* HistoryController.h */; settings = {ATTRIBUTES = (Private, ); }; };
                97E4028F13A696ED00913D67 /* IconController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97E4028D13A696ED00913D67 /* IconController.cpp */; };
                97E4029013A696ED00913D67 /* IconController.h in Headers */ = {isa = PBXBuildFile; fileRef = 97E4028E13A696ED00913D67 /* IconController.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               97F8E665151D4A4B00D2D181 /* WorkerGlobalScopeNotifications.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97F8E661151D4A3F00D2D181 /* WorkerGlobalScopeNotifications.cpp */; };
+               97F8E666151D4A4E00D2D181 /* WorkerGlobalScopeNotifications.h in Headers */ = {isa = PBXBuildFile; fileRef = 97F8E662151D4A3F00D2D181 /* WorkerGlobalScopeNotifications.h */; };
                9831AE4A154225C900FE2644 /* ReferrerPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 9831AE49154225A200FE2644 /* ReferrerPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; };
                984264F112D5280A000D88A4 /* LinkLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 984264EF12D5280A000D88A4 /* LinkLoaderClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                985BB96D13A94058007A0B69 /* LinkRelAttribute.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 985BB96B13A94058007A0B69 /* LinkRelAttribute.cpp */; };
                33503C9910179A74003B47E1 /* NotificationClient.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = NotificationClient.h; sourceTree = "<group>"; };
                33503C9F10179AD7003B47E1 /* JSNotification.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNotification.cpp; sourceTree = "<group>"; };
                33503CA010179AD7003B47E1 /* JSNotification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNotification.h; sourceTree = "<group>"; };
+               33503CA110179AD7003B47E1 /* JSNotificationCenter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNotificationCenter.cpp; sourceTree = "<group>"; };
+               33503CA210179AD7003B47E1 /* JSNotificationCenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNotificationCenter.h; sourceTree = "<group>"; };
                33503CC61017A1B1003B47E1 /* Notification.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Notification.cpp; sourceTree = "<group>"; };
+               3390CA510FFC157B00921962 /* NotificationCenter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationCenter.cpp; sourceTree = "<group>"; };
+               3390CA520FFC157B00921962 /* NotificationCenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationCenter.h; sourceTree = "<group>"; };
+               3390CA530FFC157B00921962 /* NotificationCenter.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NotificationCenter.idl; sourceTree = "<group>"; };
                339B5B62131DAA3200F48D02 /* CookiesStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CookiesStrategy.h; sourceTree = "<group>"; };
                3662F984047CEDBE5DDDAFAA /* RenderMathMLMenclose.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLMenclose.cpp; sourceTree = "<group>"; };
                3717D7E517ECC3A6003C276D /* extract-localizable-strings.pl */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; path = "extract-localizable-strings.pl"; sourceTree = "<group>"; };
                97AABD0C14FA09D5007457AE /* WebSocketHandshake.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketHandshake.h; sourceTree = "<group>"; };
                97AABD1114FA09D5007457AE /* WorkerThreadableWebSocketChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerThreadableWebSocketChannel.cpp; sourceTree = "<group>"; };
                97AABD1214FA09D5007457AE /* WorkerThreadableWebSocketChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerThreadableWebSocketChannel.h; sourceTree = "<group>"; };
+               97B38E23151C4264004622E9 /* DOMWindowNotifications.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowNotifications.cpp; sourceTree = "<group>"; };
+               97B38E24151C4264004622E9 /* DOMWindowNotifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWindowNotifications.h; sourceTree = "<group>"; };
+               97B38E25151C4264004622E9 /* DOMWindowNotifications.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMWindowNotifications.idl; sourceTree = "<group>"; };
                97B8FFCF16AE7F920038388D /* CharacterReferenceParserInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharacterReferenceParserInlines.h; sourceTree = "<group>"; };
                97BC69D81505F076001B74AC /* ChangeVersionWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ChangeVersionWrapper.cpp; sourceTree = "<group>"; };
                97BC69D91505F076001B74AC /* ChangeVersionWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChangeVersionWrapper.h; sourceTree = "<group>"; };
                97E4028E13A696ED00913D67 /* IconController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IconController.h; sourceTree = "<group>"; };
                97E9EC8B15DC492F004F2E71 /* JSVoidCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVoidCallback.cpp; sourceTree = "<group>"; };
                97E9EC8C15DC492F004F2E71 /* JSVoidCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVoidCallback.h; sourceTree = "<group>"; };
+               97F8E661151D4A3F00D2D181 /* WorkerGlobalScopeNotifications.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerGlobalScopeNotifications.cpp; sourceTree = "<group>"; };
+               97F8E662151D4A3F00D2D181 /* WorkerGlobalScopeNotifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerGlobalScopeNotifications.h; sourceTree = "<group>"; };
+               97F8E663151D4A3F00D2D181 /* WorkerGlobalScopeNotifications.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WorkerGlobalScopeNotifications.idl; sourceTree = "<group>"; };
                9831AE49154225A200FE2644 /* ReferrerPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReferrerPolicy.h; sourceTree = "<group>"; };
                984264EF12D5280A000D88A4 /* LinkLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkLoaderClient.h; sourceTree = "<group>"; };
                985BB96B13A94058007A0B69 /* LinkRelAttribute.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LinkRelAttribute.cpp; sourceTree = "<group>"; };
                333F703D0FB49C16008E12A6 /* notifications */ = {
                        isa = PBXGroup;
                        children = (
+                               97B38E23151C4264004622E9 /* DOMWindowNotifications.cpp */,
+                               97B38E24151C4264004622E9 /* DOMWindowNotifications.h */,
+                               97B38E25151C4264004622E9 /* DOMWindowNotifications.idl */,
                                33503CC61017A1B1003B47E1 /* Notification.cpp */,
                                333F704F0FB49CA2008E12A6 /* Notification.h */,
                                333F704E0FB49CA2008E12A6 /* Notification.idl */,
+                               3390CA510FFC157B00921962 /* NotificationCenter.cpp */,
+                               3390CA520FFC157B00921962 /* NotificationCenter.h */,
+                               3390CA530FFC157B00921962 /* NotificationCenter.idl */,
                                33503C9910179A74003B47E1 /* NotificationClient.h */,
                                3128CA67147331520074C72A /* NotificationController.cpp */,
                                3128CA6A147331630074C72A /* NotificationController.h */,
                                31EC1DAC14FF26EA00C94662 /* NotificationPermissionCallback.h */,
                                31EC1D5014FEFD0800C94662 /* NotificationPermissionCallback.idl */,
+                               97F8E661151D4A3F00D2D181 /* WorkerGlobalScopeNotifications.cpp */,
+                               97F8E662151D4A3F00D2D181 /* WorkerGlobalScopeNotifications.h */,
+                               97F8E663151D4A3F00D2D181 /* WorkerGlobalScopeNotifications.idl */,
                        );
                        path = notifications;
                        sourceTree = "<group>";
                        children = (
                                33503C9F10179AD7003B47E1 /* JSNotification.cpp */,
                                33503CA010179AD7003B47E1 /* JSNotification.h */,
+                               33503CA110179AD7003B47E1 /* JSNotificationCenter.cpp */,
+                               33503CA210179AD7003B47E1 /* JSNotificationCenter.h */,
                                31EC1E2614FF60EE00C94662 /* JSNotificationPermissionCallback.cpp */,
                                31EC1E2714FF60EE00C94662 /* JSNotificationPermissionCallback.h */,
                        );
                                1403B99709EB13AF00797C7F /* DOMWindow.h in Headers */,
                                51FA2D78152132B300C1BA0B /* DOMWindowExtension.h in Headers */,
                                5185FC751BB4C4E80012898F /* DOMWindowIndexedDatabase.h in Headers */,
+                               97B38E27151C4271004622E9 /* DOMWindowNotifications.h in Headers */,
                                97D2AD0414B823A60093DF32 /* DOMWindowProperty.h in Headers */,
                                89F60B11157F686E0075E157 /* DOMWindowQuota.h in Headers */,
                                AA2A5AD616A4861600975A25 /* DOMWindowSpeechSynthesis.h in Headers */,
                                BCD9C2C30C17B69E005C90A2 /* JSNodeList.h in Headers */,
                                AD20B18D18E9D237005A8083 /* JSNodeListCustom.h in Headers */,
                                33503CA410179AD7003B47E1 /* JSNotification.h in Headers */,
+                               33503CA610179AD7003B47E1 /* JSNotificationCenter.h in Headers */,
                                31EC1E2914FF60EE00C94662 /* JSNotificationPermissionCallback.h in Headers */,
                                7E46F6FB1627A2CA00062223 /* JSOESElementIndexUint.h in Headers */,
                                9001788112E0370700648462 /* JSOESStandardDerivatives.h in Headers */,
                                9382AAB40D8C386100F357A6 /* NodeWithIndex.h in Headers */,
                                E46B41F91CB24E70008F11DE /* NoEventDispatchAssertion.h in Headers */,
                                312C0C41146DC6CC0016C911 /* Notification.h in Headers */,
+                               3390CA560FFC157B00921962 /* NotificationCenter.h in Headers */,
                                33503C9A10179A74003B47E1 /* NotificationClient.h in Headers */,
                                3128CA6B147331630074C72A /* NotificationController.h in Headers */,
                                31FE6DFA15004C2A0004EBC4 /* NotificationPermissionCallback.h in Headers */,
                                A3E2643114748991005A8588 /* WorkerEventQueue.h in Headers */,
                                2E4346490F546A8200B0F1BA /* WorkerGlobalScope.h in Headers */,
                                5185FCB41BB4C4E80012898F /* WorkerGlobalScopeIndexedDatabase.h in Headers */,
+                               97F8E666151D4A4E00D2D181 /* WorkerGlobalScopeNotifications.h in Headers */,
                                2E43464B0F546A8200B0F1BA /* WorkerGlobalScopeProxy.h in Headers */,
                                A54A0C621DB7F8C10017A90B /* WorkerInspectorController.h in Headers */,
                                A54A0C6C1DB831F90017A90B /* WorkerInspectorProxy.h in Headers */,
                                517FBA1E151AB17C00B57959 /* DOMWindowExtension.cpp in Sources */,
                                418C39561C8DAC7F0051C8A3 /* DOMWindowFetch.cpp in Sources */,
                                5185FC741BB4C4E80012898F /* DOMWindowIndexedDatabase.cpp in Sources */,
+                               97B38E28151C4273004622E9 /* DOMWindowNotifications.cpp in Sources */,
                                97D2AD0314B823A60093DF32 /* DOMWindowProperty.cpp in Sources */,
                                AA2A5AD716A4861A00975A25 /* DOMWindowSpeechSynthesis.cpp in Sources */,
                                A8CCBB48151F831600AB7CE9 /* DOMWindowWebDatabase.cpp in Sources */,
                                BCD9C2C20C17B69E005C90A2 /* JSNodeList.cpp in Sources */,
                                BCD9C2650C17AA67005C90A2 /* JSNodeListCustom.cpp in Sources */,
                                33503CA310179AD7003B47E1 /* JSNotification.cpp in Sources */,
+                               33503CA510179AD7003B47E1 /* JSNotificationCenter.cpp in Sources */,
                                31EC1E2814FF60EE00C94662 /* JSNotificationPermissionCallback.cpp in Sources */,
                                7E46F6FA1627A2CA00062223 /* JSOESElementIndexUint.cpp in Sources */,
                                9001788012E0370700648462 /* JSOESStandardDerivatives.cpp in Sources */,
                                4FFC022B1643B710004E1638 /* NodeRareData.cpp in Sources */,
                                E43105B816750F0C00DB2FB8 /* NodeTraversal.cpp in Sources */,
                                33503CC71017A1B1003B47E1 /* Notification.cpp in Sources */,
+                               3390CA550FFC157B00921962 /* NotificationCenter.cpp in Sources */,
                                3128CA68147331520074C72A /* NotificationController.cpp in Sources */,
                                E1513D511677F08800149FCB /* NotImplemented.cpp in Sources */,
                                1A569D0A0D7E2B82007C3983 /* NP_jsobject.cpp in Sources */,
                                2E4346480F546A8200B0F1BA /* WorkerGlobalScope.cpp in Sources */,
                                418C395A1C8DD6990051C8A3 /* WorkerGlobalScopeFetch.cpp in Sources */,
                                5185FCB31BB4C4E80012898F /* WorkerGlobalScopeIndexedDatabase.cpp in Sources */,
+                               97F8E665151D4A4B00D2D181 /* WorkerGlobalScopeNotifications.cpp in Sources */,
                                A54A0C611DB7F8C10017A90B /* WorkerInspectorController.cpp in Sources */,
                                A54A0C6B1DB831F90017A90B /* WorkerInspectorProxy.cpp in Sources */,
                                2E43464C0F546A8200B0F1BA /* WorkerLocation.cpp in Sources */,
index 8fc58f5..1c6c9f1 100644 (file)
@@ -23,7 +23,7 @@ MediaStream conditional=MEDIA_STREAM
 MediaStreamTrack conditional=MEDIA_STREAM
 MessagePort
 Node
-Notification conditional=NOTIFICATIONS
+Notification conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS
 Performance conditional=WEB_TIMING
 RTCDataChannel conditional=WEB_RTC
 RTCDTMFSender conditional=WEB_RTC_DTMF
index 66b1370..0558c75 100644 (file)
@@ -46,6 +46,7 @@
 #include "DOMTokenList.h"
 #include "DOMURL.h"
 #include "DOMWindowExtension.h"
+#include "DOMWindowNotifications.h"
 #include "DeviceMotionController.h"
 #include "DeviceOrientationController.h"
 #include "Document.h"
index 2cd4372..f809ee6 100644 (file)
@@ -69,7 +69,7 @@ public:
     WEBCORE_EXPORT static unsigned workerThreadCount();
     static void releaseFastMallocFreeMemoryInAllThreads();
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     NotificationClient* getNotificationClient() { return m_notificationClient; }
     void setNotificationClient(NotificationClient* client) { m_notificationClient = client; }
 #endif
@@ -110,7 +110,7 @@ private:
 
     std::unique_ptr<WorkerThreadStartupData> m_startupData;
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     NotificationClient* m_notificationClient { nullptr };
 #endif
 
index 2a80b50..e43ea48 100644 (file)
@@ -1,3 +1,17 @@
+2017-05-04  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r216206.
+        https://bugs.webkit.org/show_bug.cgi?id=171714
+
+        Multiple LayoutTests crashing in Document::page() (Requested
+        by ap on #webkit).
+
+        Reverted changeset:
+
+        "Remove support for legacy Notifications"
+        https://bugs.webkit.org/show_bug.cgi?id=171487
+        http://trac.webkit.org/changeset/216206
+
 2017-05-04  Jeremy Jones  <jeremyj@apple.com>
 
         UIColor +whiteColor and +clearColor are ambiguous and need to be casted when soft linked.
index 4aba02d..0ba5e18 100644 (file)
@@ -139,6 +139,7 @@ ENABLE_KEYBOARD_KEY_ATTRIBUTE = ENABLE_KEYBOARD_KEY_ATTRIBUTE;
 ENABLE_KEYBOARD_CODE_ATTRIBUTE = ENABLE_KEYBOARD_CODE_ATTRIBUTE;
 ENABLE_LEGACY_CSS_VENDOR_PREFIXES = ENABLE_LEGACY_CSS_VENDOR_PREFIXES;
 ENABLE_LEGACY_ENCRYPTED_MEDIA[sdk=macosx*] = ENABLE_LEGACY_ENCRYPTED_MEDIA;
+ENABLE_LEGACY_NOTIFICATIONS[sdk=macosx*] = ENABLE_LEGACY_NOTIFICATIONS;
 ENABLE_LEGACY_VENDOR_PREFIXES = ENABLE_LEGACY_VENDOR_PREFIXES;
 ENABLE_LETTERPRESS[sdk=iphone*] = ENABLE_LETTERPRESS;
 ENABLE_LINK_PREFETCH = ;
@@ -254,4 +255,4 @@ ENABLE_VARIATION_FONTS_IF_NOT_ = $(ENABLE_VARIATION_FONTS_IF_NOT_NO);
 ENABLE_VARIATION_FONTS_IF_NOT_NO = ENABLE_VARIATION_FONTS;
 ENABLE_VARIATION_FONTS_IF_NOT_YES = ;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_DELEGATE) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FETCH_API) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOSNIFF) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEB_ANIMATIONS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_RTC) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_DELEGATE) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FETCH_API) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOSNIFF) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEB_ANIMATIONS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_RTC) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
index 837875f..d87aa14 100644 (file)
@@ -25,7 +25,7 @@
 
 #import <WebCore/NotificationClient.h>
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #import <WebCore/Notification.h>
 #import <wtf/HashMap.h>
 #import <wtf/RefPtr.h>
@@ -48,7 +48,7 @@ public:
     WebNotificationClient(WebView *);
     WebView *webView() { return m_webView; }
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     // For testing purposes.
     uint64_t notificationIDForTesting(WebCore::Notification*);
 #endif
@@ -59,6 +59,9 @@ private:
     void clearNotifications(WebCore::ScriptExecutionContext*) override;
     void notificationObjectDestroyed(WebCore::Notification*) override;
     void notificationControllerDestroyed() override;
+#if ENABLE(LEGACY_NOTIFICATIONS)
+    void requestPermission(WebCore::ScriptExecutionContext*, RefPtr<WebCore::VoidCallback>&&) override;
+#endif
 #if ENABLE(NOTIFICATIONS)
     void requestPermission(WebCore::ScriptExecutionContext*, RefPtr<WebCore::NotificationPermissionCallback>&&) override;
 #endif
@@ -66,12 +69,12 @@ private:
     bool hasPendingPermissionRequests(WebCore::ScriptExecutionContext*) const override;
     WebCore::NotificationClient::Permission checkPermission(WebCore::ScriptExecutionContext*) override;
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     void requestPermission(WebCore::ScriptExecutionContext*, WebNotificationPolicyListener *);
 #endif
 
     WebView *m_webView;
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     HashMap<RefPtr<WebCore::Notification>, RetainPtr<WebNotification>> m_notificationMap;
     
     typedef HashMap<RefPtr<WebCore::ScriptExecutionContext>, Vector<RetainPtr<WebNotification>>> NotificationContextMap;
index 4fa0d41..0bdd0a7 100644 (file)
 
 #import "WebNotificationClient.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #import "WebDelegateImplementationCaching.h"
 #import "WebNotificationInternal.h"
 #import "WebPreferencesPrivate.h"
 #import "WebSecurityOriginInternal.h"
 #import "WebUIDelegatePrivate.h"
 #import "WebViewInternal.h"
-#import <WebCore/NotificationPermissionCallback.h>
 #import <WebCore/ScriptExecutionContext.h>
 #import <wtf/BlockObjCExceptions.h>
 #endif
 
+#if ENABLE(NOTIFICATIONS)
+#import <WebCore/NotificationPermissionCallback.h>
+#endif
+#if ENABLE(LEGACY_NOTIFICATIONS)
+#import <WebCore/VoidCallback.h>
+#endif
+
 using namespace WebCore;
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 @interface WebNotificationPolicyListener : NSObject <WebAllowDenyPolicyListener>
 {
+#if ENABLE(NOTIFICATIONS)
     RefPtr<NotificationPermissionCallback> _callback;
+#endif
+#if ENABLE(LEGACY_NOTIFICATIONS)
+    RefPtr<VoidCallback> _voidCallback;
+    bool _isLegacyRequest;
+#endif
 }
+#if ENABLE(NOTIFICATIONS)
 - (id)initWithCallback:(PassRefPtr<NotificationPermissionCallback>)callback;
+#endif
+#if ENABLE(LEGACY_NOTIFICATIONS)
+- (id)initWithVoidCallback:(PassRefPtr<VoidCallback>)callback;
+#endif
+
 @end
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 static uint64_t generateNotificationID()
 {
     static uint64_t uniqueNotificationID = 1;
@@ -63,7 +81,7 @@ WebNotificationClient::WebNotificationClient(WebView *webView)
 
 bool WebNotificationClient::show(Notification* notification)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (![m_webView _notificationProvider])
         return false;
 
@@ -71,7 +89,7 @@ bool WebNotificationClient::show(Notification* notification)
     RetainPtr<WebNotification> webNotification = adoptNS([[WebNotification alloc] initWithCoreNotification:notification notificationID:notificationID]);
     m_notificationMap.set(notification, webNotification);
 
-    auto it = m_notificationContextMap.add(notification->scriptExecutionContext(), Vector<RetainPtr<WebNotification>>()).iterator;
+    NotificationContextMap::iterator it = m_notificationContextMap.add(notification->scriptExecutionContext(), Vector<RetainPtr<WebNotification>>()).iterator;
     it->value.append(webNotification);
 
     [[m_webView _notificationProvider] showNotification:webNotification.get() fromWebView:m_webView];
@@ -84,7 +102,7 @@ bool WebNotificationClient::show(Notification* notification)
 
 void WebNotificationClient::cancel(Notification* notification)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     WebNotification *webNotification = m_notificationMap.get(notification).get();
     if (!webNotification)
         return;
@@ -97,8 +115,8 @@ void WebNotificationClient::cancel(Notification* notification)
 
 void WebNotificationClient::clearNotifications(ScriptExecutionContext* context)
 {
-#if ENABLE(NOTIFICATIONS)
-    auto it = m_notificationContextMap.find(context);
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+    NotificationContextMap::iterator it = m_notificationContextMap.find(context);
     if (it == m_notificationContextMap.end())
         return;
     
@@ -121,12 +139,12 @@ void WebNotificationClient::clearNotifications(ScriptExecutionContext* context)
 
 void WebNotificationClient::notificationObjectDestroyed(Notification* notification)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     RetainPtr<WebNotification> webNotification = m_notificationMap.take(notification);
     if (!webNotification)
         return;
 
-    auto it = m_notificationContextMap.find(notification->scriptExecutionContext());
+    NotificationContextMap::iterator it = m_notificationContextMap.find(notification->scriptExecutionContext());
     ASSERT(it != m_notificationContextMap.end());
     size_t index = it->value.find(webNotification);
     ASSERT(index != notFound);
@@ -145,7 +163,7 @@ void WebNotificationClient::notificationControllerDestroyed()
     delete this;
 }
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 void WebNotificationClient::requestPermission(ScriptExecutionContext* context, WebNotificationPolicyListener *listener)
 {
     SEL selector = @selector(webView:decidePolicyForNotificationRequestFromOrigin:listener:);
@@ -162,9 +180,20 @@ void WebNotificationClient::requestPermission(ScriptExecutionContext* context, W
 }
 #endif
 
+#if ENABLE(LEGACY_NOTIFICATIONS)
+void WebNotificationClient::requestPermission(ScriptExecutionContext* context, RefPtr<VoidCallback>&& callback)
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    WebNotificationPolicyListener *listener = [[WebNotificationPolicyListener alloc] initWithVoidCallback:callback];
+    requestPermission(context, listener);
+    [listener release];
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+#endif
+
 bool WebNotificationClient::hasPendingPermissionRequests(ScriptExecutionContext*) const
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     // We know permission was requested but we don't know if the client responded. In this case, we play it
     // safe and presume there is one pending so that ActiveDOMObjects don't get suspended.
     return m_everRequestedPermission;
@@ -186,7 +215,7 @@ void WebNotificationClient::requestPermission(ScriptExecutionContext* context, R
 
 NotificationClient::Permission WebNotificationClient::checkPermission(ScriptExecutionContext* context)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (!context || !context->isDocument())
         return NotificationClient::PermissionDenied;
     if (![[m_webView preferences] notificationsEnabled])
@@ -210,8 +239,7 @@ NotificationClient::Permission WebNotificationClient::checkPermission(ScriptExec
 #endif
 }
 
-#if ENABLE(NOTIFICATIONS)
-
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 uint64_t WebNotificationClient::notificationIDForTesting(WebCore::Notification* notification)
 {
     return [m_notificationMap.get(notification).get() notificationID];
@@ -219,6 +247,7 @@ uint64_t WebNotificationClient::notificationIDForTesting(WebCore::Notification*
 
 @implementation WebNotificationPolicyListener
 
+#if ENABLE(NOTIFICATIONS)
 - (id)initWithCallback:(PassRefPtr<NotificationPermissionCallback>)callback
 {
     if (!(self = [super init]))
@@ -227,17 +256,48 @@ uint64_t WebNotificationClient::notificationIDForTesting(WebCore::Notification*
     _callback = callback;
     return self;
 }
+#endif
+
+#if ENABLE(LEGACY_NOTIFICATIONS)
+- (id)initWithVoidCallback:(PassRefPtr<VoidCallback>)callback
+{
+    if (!(self = [super init]))
+        return nil;
+
+    _isLegacyRequest = true;
+    _voidCallback = callback;
+    return self;
+}
+#endif
 
 - (void)allow
 {
+#if ENABLE(LEGACY_NOTIFICATIONS)
+    if (_isLegacyRequest) {
+        if (_voidCallback)
+            _voidCallback->handleEvent();
+        return;
+    }
+#endif
+#if ENABLE(NOTIFICATIONS)
     if (_callback)
         _callback->handleEvent(Notification::permissionString(NotificationClient::PermissionAllowed));
+#endif
 }
 
 - (void)deny
 {
+#if ENABLE(LEGACY_NOTIFICATIONS)
+    if (_isLegacyRequest) {
+        if (_voidCallback)
+            _voidCallback->handleEvent();
+        return;
+    }
+#endif
+#if ENABLE(NOTIFICATIONS)
     if (_callback)
         _callback->handleEvent(Notification::permissionString(NotificationClient::PermissionDenied));
+#endif
 }
 
 #if PLATFORM(IOS)
index a70d75b..65cd59e 100644 (file)
@@ -30,7 +30,7 @@
 
 #import "WebNotificationInternal.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #import "WebSecurityOriginInternal.h"
 #import <WebCore/Notification.h>
 #import <WebCore/ScriptExecutionContext.h>
@@ -42,7 +42,7 @@ using namespace WebCore;
 @interface WebNotificationPrivate : NSObject
 {
 @public
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     RefPtr<Notification> _internal;
     uint64_t _notificationID;
 #endif
@@ -52,9 +52,8 @@ using namespace WebCore;
 @implementation WebNotificationPrivate
 @end
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 @implementation WebNotification (WebNotificationInternal)
-
 Notification* core(WebNotification *notification)
 {
     if (!notification->_private)
@@ -88,7 +87,7 @@ Notification* core(WebNotification *notification)
 
 - (NSString *)title
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     return core(self)->title();
 #else
     return nil;
@@ -97,7 +96,7 @@ Notification* core(WebNotification *notification)
 
 - (NSString *)body
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     return core(self)->body();
 #else
     return nil;
@@ -106,7 +105,7 @@ Notification* core(WebNotification *notification)
 
 - (NSString *)tag
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     return core(self)->tag();
 #else
     return nil;
@@ -115,7 +114,7 @@ Notification* core(WebNotification *notification)
 
 - (NSString *)iconURL
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     return core(self)->iconURL();
 #else
     return nil;
@@ -124,7 +123,7 @@ Notification* core(WebNotification *notification)
 
 - (NSString *)lang
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     return core(self)->lang();
 #else
     return nil;
@@ -133,7 +132,7 @@ Notification* core(WebNotification *notification)
 
 - (NSString *)dir
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     return core(self)->dir();
 #else
     return nil;
@@ -142,7 +141,7 @@ Notification* core(WebNotification *notification)
 
 - (WebSecurityOrigin *)origin
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     return [[[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:core(self)->scriptExecutionContext()->securityOrigin()] autorelease];
 #else
     return nil;
@@ -151,7 +150,7 @@ Notification* core(WebNotification *notification)
 
 - (uint64_t)notificationID
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     return _private->_notificationID;
 #else
     return 0;
@@ -160,28 +159,28 @@ Notification* core(WebNotification *notification)
 
 - (void)dispatchShowEvent
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     core(self)->dispatchShowEvent();
 #endif
 }
 
 - (void)dispatchCloseEvent
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     core(self)->dispatchCloseEvent();
 #endif
 }
 
 - (void)dispatchClickEvent
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     core(self)->dispatchClickEvent();
 #endif
 }
 
 - (void)dispatchErrorEvent
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     core(self)->dispatchErrorEvent();
 #endif
 }
index a779c07..ed6a3f7 100644 (file)
@@ -28,7 +28,7 @@
 
 #import "WebNotification.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 namespace WebCore {
 class Notification;
index db39b17..95e0eee 100644 (file)
@@ -1481,7 +1481,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
 #if ENABLE(GEOLOCATION)
     WebCore::provideGeolocationTo(_private->page, new WebGeolocationClient(self));
 #endif
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     WebCore::provideNotification(_private->page, new WebNotificationClient(self));
 #endif
 #if ENABLE(DEVICE_ORIENTATION)
@@ -10033,7 +10033,7 @@ static NSTextAlignment nsTextAlignmentFromRenderStyle(const RenderStyle* style)
 
 - (uint64_t)_notificationIDForTesting:(JSValueRef)jsNotification
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     auto* page = _private->page;
     if (!page)
         return 0;
index f0976bb..2c7b243 100644 (file)
@@ -1,3 +1,17 @@
+2017-05-04  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r216206.
+        https://bugs.webkit.org/show_bug.cgi?id=171714
+
+        Multiple LayoutTests crashing in Document::page() (Requested
+        by ap on #webkit).
+
+        Reverted changeset:
+
+        "Remove support for legacy Notifications"
+        https://bugs.webkit.org/show_bug.cgi?id=171487
+        http://trac.webkit.org/changeset/216206
+
 2017-05-04  Don Olmstead  <don.olmstead@am.sony.com>
 
         [Win] Remove redundant macros that are set in the CMake config
index 782a136..cd000b4 100644 (file)
@@ -70,7 +70,7 @@ static const size_t maxFilePathsListSize = USHRT_MAX;
 
 WebChromeClient::WebChromeClient(WebView* webView)
     : m_webView(webView)
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     , m_notificationsDelegate(std::make_unique<WebDesktopNotificationsDelegate>(webView))
 #endif
 {
index 809b8a7..4ece50a 100644 (file)
@@ -144,7 +144,7 @@ public:
     void exitVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&) final;
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     WebCore::NotificationClient* notificationPresenter() const final { return reinterpret_cast<WebCore::NotificationClient*>(m_notificationsDelegate.get()); }
 #endif
 
@@ -176,7 +176,7 @@ private:
 
     WebView* m_webView;
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     std::unique_ptr<WebDesktopNotificationsDelegate> m_notificationsDelegate;
 #endif
 };
index 6435076..14a7059 100644 (file)
@@ -35,7 +35,7 @@
 #include <WebCore/Document.h>
 #include <WebCore/URL.h>
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 using namespace WebCore;
 
@@ -223,4 +223,4 @@ COMPtr<IWebDesktopNotificationsDelegate> WebDesktopNotificationsDelegate::notifi
     return delegate;
 }
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
index f0f1d92..2878a98 100644 (file)
@@ -32,7 +32,7 @@
 #include <WebCore/Notification.h>
 #include <WebCore/NotificationClient.h>
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 interface IWebDesktopNotificationPresenter;
 
@@ -50,7 +50,12 @@ public:
     virtual void cancel(WebCore::Notification* object);
     virtual void notificationObjectDestroyed(WebCore::Notification* object);
     virtual void notificationControllerDestroyed();
+#if ENABLE(LEGACY_NOTIFICATIONS)
+    virtual void requestPermission(WebCore::SecurityOrigin*, RefPtr<WebCore::VoidCallback>&&);
+#endif
+#if ENABLE(NOTIFICATIONS)
     virtual void requestPermission(WebCore::SecurityOrigin*, RefPtr<WebCore::NotificationPermissionCallback>&&);
+#endif
     bool hasPendingPermissionRequests(WebCore::ScriptExecutionContext*) const override;
     virtual void cancelRequestsForPermission(WebCore::ScriptExecutionContext*);
     virtual WebCore::NotificationClient::Permission checkPermission(const URL&);
index dc7819e..656703d 100644 (file)
@@ -1,3 +1,17 @@
+2017-05-04  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r216206.
+        https://bugs.webkit.org/show_bug.cgi?id=171714
+
+        Multiple LayoutTests crashing in Document::page() (Requested
+        by ap on #webkit).
+
+        Reverted changeset:
+
+        "Remove support for legacy Notifications"
+        https://bugs.webkit.org/show_bug.cgi?id=171487
+        http://trac.webkit.org/changeset/216206
+
 2017-05-04  Mark Lam  <mark.lam@apple.com>
 
         NeverDestroyed<String>(ASCIILiteral(...)) is not thread safe.
index 4aba02d..0ba5e18 100644 (file)
@@ -139,6 +139,7 @@ ENABLE_KEYBOARD_KEY_ATTRIBUTE = ENABLE_KEYBOARD_KEY_ATTRIBUTE;
 ENABLE_KEYBOARD_CODE_ATTRIBUTE = ENABLE_KEYBOARD_CODE_ATTRIBUTE;
 ENABLE_LEGACY_CSS_VENDOR_PREFIXES = ENABLE_LEGACY_CSS_VENDOR_PREFIXES;
 ENABLE_LEGACY_ENCRYPTED_MEDIA[sdk=macosx*] = ENABLE_LEGACY_ENCRYPTED_MEDIA;
+ENABLE_LEGACY_NOTIFICATIONS[sdk=macosx*] = ENABLE_LEGACY_NOTIFICATIONS;
 ENABLE_LEGACY_VENDOR_PREFIXES = ENABLE_LEGACY_VENDOR_PREFIXES;
 ENABLE_LETTERPRESS[sdk=iphone*] = ENABLE_LETTERPRESS;
 ENABLE_LINK_PREFETCH = ;
@@ -254,4 +255,4 @@ ENABLE_VARIATION_FONTS_IF_NOT_ = $(ENABLE_VARIATION_FONTS_IF_NOT_NO);
 ENABLE_VARIATION_FONTS_IF_NOT_NO = ENABLE_VARIATION_FONTS;
 ENABLE_VARIATION_FONTS_IF_NOT_YES = ;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_DELEGATE) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FETCH_API) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOSNIFF) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEB_ANIMATIONS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_RTC) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_DELEGATE) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FETCH_API) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOSNIFF) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEB_ANIMATIONS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_RTC) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
index 2bdff08..0defca5 100644 (file)
@@ -111,7 +111,7 @@ void WebProcessCreationParameters::encode(IPC::Encoder& encoder) const
         encoder << bundleParameterData->dataReference();
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     encoder << notificationPermissions;
 #endif
 
@@ -278,7 +278,7 @@ bool WebProcessCreationParameters::decode(IPC::Decoder& decoder, WebProcessCreat
     }
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (!decoder.decode(parameters.notificationPermissions))
         return false;
 #endif
index 1fd06d3..a94b403 100644 (file)
@@ -150,7 +150,7 @@ struct WebProcessCreationParameters {
     RefPtr<API::Data> bundleParameterData;
 #endif // PLATFORM(COCOA)
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     HashMap<String, bool> notificationPermissions;
 #endif
 
index 8ae9c9a..850e65d 100644 (file)
@@ -709,7 +709,7 @@ WebProcessProxy& WebProcessPool::createNewWebProcess(WebsiteDataStore& websiteDa
 
     parameters.defaultRequestTimeoutInterval = API::URLRequest::defaultTimeoutInterval();
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     // FIXME: There should be a generic way for supplements to add to the intialization parameters.
     supplement<WebNotificationManagerProxy>()->populateCopyOfNotificationPermissions(parameters.notificationPermissions);
 #endif
index 92b6fdb..c44a808 100644 (file)
@@ -79,7 +79,8 @@
 #include <WebCore/UserScript.h>
 #include <WebCore/UserStyleSheet.h>
 
-#if ENABLE(NOTIFICATIONS)
+
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #include "WebNotificationManager.h"
 #endif
 
@@ -539,7 +540,7 @@ void InjectedBundle::setUserStyleSheetLocation(WebPageGroupProxy* pageGroup, con
 
 void InjectedBundle::setWebNotificationPermission(WebPage* page, const String& originString, bool allowed)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     page->notificationPermissionRequestManager()->setPermissionLevelForTesting(originString, allowed);
 #else
     UNUSED_PARAM(page);
@@ -550,7 +551,7 @@ void InjectedBundle::setWebNotificationPermission(WebPage* page, const String& o
 
 void InjectedBundle::removeAllWebNotificationPermissions(WebPage* page)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     page->notificationPermissionRequestManager()->removeAllPermissionsForTesting();
 #else
     UNUSED_PARAM(page);
@@ -559,7 +560,7 @@ void InjectedBundle::removeAllWebNotificationPermissions(WebPage* page)
 
 uint64_t InjectedBundle::webNotificationID(JSContextRef jsContext, JSValueRef jsNotification)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     WebCore::Notification* notification = JSNotification::toWrapped(toJS(jsContext)->vm(), toJS(toJS(jsContext), jsNotification));
     if (!notification)
         return 0;
index b1f8913..81ff1b1 100644 (file)
@@ -36,7 +36,7 @@
 #include <WebCore/SecurityOrigin.h>
 #include <WebCore/Settings.h>
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #include "WebNotificationManager.h"
 #endif
 
@@ -44,7 +44,7 @@ using namespace WebCore;
 
 namespace WebKit {
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 static uint64_t generateRequestID()
 {
     static uint64_t uniqueRequestID = 1;
@@ -57,7 +57,7 @@ Ref<NotificationPermissionRequestManager> NotificationPermissionRequestManager::
     return adoptRef(*new NotificationPermissionRequestManager(page));
 }
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 NotificationPermissionRequestManager::NotificationPermissionRequestManager(WebPage* page)
     : m_page(page)
 {
@@ -86,15 +86,38 @@ void NotificationPermissionRequestManager::startRequest(SecurityOrigin* origin,
 }
 #endif
 
+#if ENABLE(LEGACY_NOTIFICATIONS)
+void NotificationPermissionRequestManager::startRequest(SecurityOrigin* origin, RefPtr<WebCore::VoidCallback>&& callback)
+{
+    NotificationClient::Permission permission = permissionLevel(origin);
+    if (permission != NotificationClient::PermissionNotAllowed) {
+        if (callback)
+            callback->handleEvent();
+        return;
+    }
+    
+    uint64_t requestID = generateRequestID();
+    m_originToIDMap.set(origin, requestID);
+    m_idToOriginMap.set(requestID, origin);
+    m_idToVoidCallbackMap.set(requestID, WTFMove(callback));
+    m_page->send(Messages::WebPageProxy::RequestNotificationPermission(requestID, origin->toString()));
+}
+#endif
+
 void NotificationPermissionRequestManager::cancelRequest(SecurityOrigin* origin)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     uint64_t id = m_originToIDMap.take(origin);
     if (!id)
         return;
     
     m_idToOriginMap.remove(id);
+#if ENABLE(NOTIFICATIONS)
     m_idToCallbackMap.remove(id);
+#endif
+#if ENABLE(LEGACY_NOTIFICATIONS)
+    m_idToVoidCallbackMap.remove(id);
+#endif
 #else
     UNUSED_PARAM(origin);
 #endif
@@ -102,7 +125,7 @@ void NotificationPermissionRequestManager::cancelRequest(SecurityOrigin* origin)
 
 bool NotificationPermissionRequestManager::hasPendingPermissionRequests(SecurityOrigin* origin) const
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     return m_originToIDMap.contains(origin);
 #else
     UNUSED_PARAM(origin);
@@ -112,7 +135,7 @@ bool NotificationPermissionRequestManager::hasPendingPermissionRequests(Security
 
 NotificationClient::Permission NotificationPermissionRequestManager::permissionLevel(SecurityOrigin* securityOrigin)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (!m_page->corePage()->settings().notificationsEnabled())
         return NotificationClient::PermissionDenied;
     
@@ -125,7 +148,7 @@ NotificationClient::Permission NotificationPermissionRequestManager::permissionL
 
 void NotificationPermissionRequestManager::setPermissionLevelForTesting(const String& originString, bool allowed)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     WebProcess::singleton().supplement<WebNotificationManager>()->didUpdateNotificationDecision(originString, allowed);
 #else
     UNUSED_PARAM(originString);
@@ -135,14 +158,14 @@ void NotificationPermissionRequestManager::setPermissionLevelForTesting(const St
 
 void NotificationPermissionRequestManager::removeAllPermissionsForTesting()
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     WebProcess::singleton().supplement<WebNotificationManager>()->removeAllPermissionsForTesting();
 #endif
 }
 
 void NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision(uint64_t requestID, bool allowed)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (!isRequestIDValid(requestID))
         return;
 
@@ -154,11 +177,22 @@ void NotificationPermissionRequestManager::didReceiveNotificationPermissionDecis
 
     WebProcess::singleton().supplement<WebNotificationManager>()->didUpdateNotificationDecision(origin->toString(), allowed);
 
+#if ENABLE(LEGACY_NOTIFICATIONS)
+    RefPtr<WebCore::VoidCallback> voidCallback = m_idToVoidCallbackMap.take(requestID);
+    if (voidCallback) {
+        voidCallback->handleEvent();
+        return;
+    }
+#endif
+
+#if ENABLE(NOTIFICATIONS)
     RefPtr<NotificationPermissionCallback> callback = m_idToCallbackMap.take(requestID);
     if (!callback)
         return;
     
     callback->handleEvent(Notification::permissionString(allowed ? NotificationClient::PermissionAllowed : NotificationClient::PermissionDenied));
+#endif
+
 #else
     UNUSED_PARAM(requestID);
     UNUSED_PARAM(allowed);
index b486b24..86e4cfc 100644 (file)
@@ -52,6 +52,9 @@ public:
 #if ENABLE(NOTIFICATIONS)
     void startRequest(WebCore::SecurityOrigin*, RefPtr<WebCore::NotificationPermissionCallback>&&);
 #endif
+#if ENABLE(LEGACY_NOTIFICATIONS)
+    void startRequest(WebCore::SecurityOrigin*, RefPtr<WebCore::VoidCallback>&&);
+#endif
     void cancelRequest(WebCore::SecurityOrigin*);
     bool hasPendingPermissionRequests(WebCore::SecurityOrigin*) const;
     
@@ -69,10 +72,13 @@ private:
 #if ENABLE(NOTIFICATIONS)
     HashMap<uint64_t, RefPtr<WebCore::NotificationPermissionCallback>> m_idToCallbackMap;
 #endif
+#if ENABLE(LEGACY_NOTIFICATIONS)
+    HashMap<uint64_t, RefPtr<WebCore::VoidCallback>> m_idToVoidCallbackMap;
+#endif
     HashMap<RefPtr<WebCore::SecurityOrigin>, uint64_t> m_originToIDMap;
     HashMap<uint64_t, RefPtr<WebCore::SecurityOrigin>> m_idToOriginMap;
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     WebPage* m_page;
 #endif
 };
index 2199ecf..74e35f6 100644 (file)
@@ -30,7 +30,7 @@
 #include "WebProcess.h"
 #include "WebProcessCreationParameters.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #include "WebNotification.h"
 #include "WebNotificationManagerMessages.h"
 #include "WebPageProxyMessages.h"
@@ -47,7 +47,7 @@ using namespace WebCore;
 
 namespace WebKit {
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 static uint64_t generateNotificationID()
 {
     static uint64_t uniqueNotificationID = 1;
@@ -63,7 +63,7 @@ const char* WebNotificationManager::supplementName()
 WebNotificationManager::WebNotificationManager(WebProcess* process)
     : m_process(process)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     m_process->addMessageReceiver(Messages::WebNotificationManager::messageReceiverName(), *this);
 #endif
 }
@@ -74,7 +74,7 @@ WebNotificationManager::~WebNotificationManager()
 
 void WebNotificationManager::initialize(const WebProcessCreationParameters& parameters)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     m_permissionsMap = parameters.notificationPermissions;
 #else
     UNUSED_PARAM(parameters);
@@ -83,7 +83,7 @@ void WebNotificationManager::initialize(const WebProcessCreationParameters& para
 
 void WebNotificationManager::didUpdateNotificationDecision(const String& originString, bool allowed)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     m_permissionsMap.set(originString, allowed);
 #else
     UNUSED_PARAM(originString);
@@ -93,22 +93,23 @@ void WebNotificationManager::didUpdateNotificationDecision(const String& originS
 
 void WebNotificationManager::didRemoveNotificationDecisions(const Vector<String>& originStrings)
 {
-#if ENABLE(NOTIFICATIONS)
-    for (auto& originString : originStrings)
-        m_permissionsMap.remove(originString);
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+    size_t count = originStrings.size();
+    for (size_t i = 0; i < count; ++i)
+        m_permissionsMap.remove(originStrings[i]);
 #else
     UNUSED_PARAM(originStrings);
 #endif
 }
 
-NotificationClient::Permission WebNotificationManager::policyForOrigin(WebCore::SecurityOriginorigin) const
+NotificationClient::Permission WebNotificationManager::policyForOrigin(WebCore::SecurityOrigin *origin) const
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (!origin)
         return NotificationClient::PermissionNotAllowed;
 
     ASSERT(!origin->isUnique());
-    auto it = m_permissionsMap.find(origin->toRawString());
+    HashMap<String, bool>::const_iterator it = m_permissionsMap.find(origin->toRawString());
     if (it != m_permissionsMap.end())
         return it->value ? NotificationClient::PermissionAllowed : NotificationClient::PermissionDenied;
 #else
@@ -120,14 +121,14 @@ NotificationClient::Permission WebNotificationManager::policyForOrigin(WebCore::
 
 void WebNotificationManager::removeAllPermissionsForTesting()
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     m_permissionsMap.clear();
 #endif
 }
 
 uint64_t WebNotificationManager::notificationIDForTesting(Notification* notification)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (!notification)
         return 0;
     return m_notificationMap.get(notification);
@@ -139,7 +140,7 @@ uint64_t WebNotificationManager::notificationIDForTesting(Notification* notifica
 
 bool WebNotificationManager::show(Notification* notification, WebPage* page)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (!notification || !page->corePage()->settings().notificationsEnabled())
         return false;
     
@@ -147,10 +148,14 @@ bool WebNotificationManager::show(Notification* notification, WebPage* page)
     m_notificationMap.set(notification, notificationID);
     m_notificationIDMap.set(notificationID, notification);
     
-    auto it = m_notificationContextMap.add(notification->scriptExecutionContext(), Vector<uint64_t>()).iterator;
+    NotificationContextMap::iterator it = m_notificationContextMap.add(notification->scriptExecutionContext(), Vector<uint64_t>()).iterator;
     it->value.append(notificationID);
 
+#if ENABLE(NOTIFICATIONS)
     m_process->parentProcessConnection()->send(Messages::WebPageProxy::ShowNotification(notification->title(), notification->body(), notification->iconURL().string(), notification->tag(), notification->lang(), notification->dir(), notification->scriptExecutionContext()->securityOrigin()->toString(), notificationID), page->pageID());
+#else
+    m_process->parentProcessConnection()->send(Messages::WebPageProxy::ShowNotification(notification->title(), notification->body(), notification->iconURL().string(), notification->replaceId(), notification->lang(), notification->dir(), notification->scriptExecutionContext()->securityOrigin()->toString(), notificationID), page->pageID());
+#endif
     return true;
 #else
     UNUSED_PARAM(notification);
@@ -161,7 +166,7 @@ bool WebNotificationManager::show(Notification* notification, WebPage* page)
 
 void WebNotificationManager::cancel(Notification* notification, WebPage* page)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (!notification || !page->corePage()->settings().notificationsEnabled())
         return;
     
@@ -178,7 +183,7 @@ void WebNotificationManager::cancel(Notification* notification, WebPage* page)
 
 void WebNotificationManager::clearNotifications(WebCore::ScriptExecutionContext* context, WebPage* page)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     NotificationContextMap::iterator it = m_notificationContextMap.find(context);
     if (it == m_notificationContextMap.end())
         return;
@@ -203,7 +208,7 @@ void WebNotificationManager::clearNotifications(WebCore::ScriptExecutionContext*
 
 void WebNotificationManager::didDestroyNotification(Notification* notification, WebPage* page)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     uint64_t notificationID = m_notificationMap.take(notification);
     if (!notificationID)
         return;
@@ -219,7 +224,7 @@ void WebNotificationManager::didDestroyNotification(Notification* notification,
 
 void WebNotificationManager::didShowNotification(uint64_t notificationID)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (!isNotificationIDValid(notificationID))
         return;
     
@@ -235,7 +240,7 @@ void WebNotificationManager::didShowNotification(uint64_t notificationID)
 
 void WebNotificationManager::didClickNotification(uint64_t notificationID)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (!isNotificationIDValid(notificationID))
         return;
 
@@ -253,7 +258,7 @@ void WebNotificationManager::didClickNotification(uint64_t notificationID)
 
 void WebNotificationManager::didCloseNotifications(const Vector<uint64_t>& notificationIDs)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     size_t count = notificationIDs.size();
     for (size_t i = 0; i < count; ++i) {
         uint64_t notificationID = notificationIDs[i];
@@ -274,7 +279,7 @@ void WebNotificationManager::didCloseNotifications(const Vector<uint64_t>& notif
 #endif
 }
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 void WebNotificationManager::removeNotificationFromContextMap(uint64_t notificationID, Notification* notification)
 {
     // This is a helper function for managing the hash maps.
index 12b83a3..171e55f 100644 (file)
@@ -80,13 +80,13 @@ private:
     void didCloseNotifications(const Vector<uint64_t>& notificationIDs);
     void didRemoveNotificationDecisions(const Vector<String>& originStrings);
     
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     void removeNotificationFromContextMap(uint64_t notificationID, WebCore::Notification*);
 #endif
 
     WebProcess* m_process;
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     typedef HashMap<RefPtr<WebCore::Notification>, uint64_t> NotificationMap;
     NotificationMap m_notificationMap;
     
index c95fe0c..23a1401 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "WebNotificationClient.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #include "NotificationPermissionRequestManager.h"
 #include "WebNotificationManager.h"
@@ -72,10 +72,19 @@ void WebNotificationClient::notificationControllerDestroyed()
     delete this;
 }
 
+#if ENABLE(LEGACY_NOTIFICATIONS)
+void WebNotificationClient::requestPermission(ScriptExecutionContext* context, RefPtr<WebCore::VoidCallback>&& callback)
+{
+    m_page->notificationPermissionRequestManager()->startRequest(context->securityOrigin(), WTFMove(callback));
+}
+#endif
+
+#if ENABLE(NOTIFICATIONS)
 void WebNotificationClient::requestPermission(ScriptExecutionContext* context, RefPtr<NotificationPermissionCallback>&& callback)
 {
     m_page->notificationPermissionRequestManager()->startRequest(context->securityOrigin(), WTFMove(callback));
 }
+#endif
 
 bool WebNotificationClient::hasPendingPermissionRequests(ScriptExecutionContext* context) const
 {
@@ -96,4 +105,4 @@ NotificationClient::Permission WebNotificationClient::checkPermission(ScriptExec
 
 } // namespace WebKit
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
index 4c07e5c..9bc80d1 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef WebNotificationClient_h
 #define WebNotificationClient_h
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #include <WebCore/NotificationClient.h>
 
@@ -51,7 +51,12 @@ private:
     void clearNotifications(WebCore::ScriptExecutionContext*) override;
     void notificationObjectDestroyed(WebCore::Notification*) override;
     void notificationControllerDestroyed() override;
+#if ENABLE(LEGACY_NOTIFICATIONS)
+    void requestPermission(WebCore::ScriptExecutionContext*, RefPtr<WebCore::VoidCallback>&&) override;
+#endif
+#if ENABLE(NOTIFICATIONS)
     void requestPermission(WebCore::ScriptExecutionContext*, RefPtr<WebCore::NotificationPermissionCallback>&&) override;
+#endif
     void cancelRequestsForPermission(WebCore::ScriptExecutionContext*) override;
     bool hasPendingPermissionRequests(WebCore::ScriptExecutionContext*) const override;
     NotificationClient::Permission checkPermission(WebCore::ScriptExecutionContext*) override;
@@ -61,6 +66,6 @@ private:
 
 } // namespace WebKit
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #endif // WebNotificationClient_h
index bb95d70..515683a 100644 (file)
@@ -432,7 +432,7 @@ WebPage::WebPage(uint64_t pageID, WebPageCreationParameters&& parameters)
 #if ENABLE(GEOLOCATION)
     WebCore::provideGeolocationTo(m_page.get(), new WebGeolocationClient(this));
 #endif
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     WebCore::provideNotification(m_page.get(), new WebNotificationClient(this));
 #endif
 #if ENABLE(VIBRATION)
@@ -3198,7 +3198,7 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
     settings.setShouldDisplayTextDescriptions(store.getBoolValueForKey(WebPreferencesKey::shouldDisplayTextDescriptionsKey()));
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     settings.setNotificationsEnabled(store.getBoolValueForKey(WebPreferencesKey::notificationsEnabledKey()));
 #endif
 
index 5f90cac..187eef9 100644 (file)
 #include "WebToDatabaseProcessConnection.h"
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #include "WebNotificationManager.h"
 #endif
 
@@ -182,7 +182,7 @@ WebProcess::WebProcess()
     addSupplement<WebCookieManager>();
     addSupplement<AuthenticationManager>();
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     addSupplement<WebNotificationManager>();
 #endif
 
index 2cf427a..d4c9a71 100644 (file)
@@ -48,6 +48,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INPUT_TYPE_MONTH PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INPUT_TYPE_TIME PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LEGACY_CSS_VENDOR_PREFIXES PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LEGACY_ENCRYPTED_MEDIA PRIVATE ON)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LEGACY_NOTIFICATIONS PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LEGACY_VENDOR_PREFIXES PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LETTERPRESS PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LINK_PREFETCH PRIVATE OFF)
index 5d93ba0..665aec1 100644 (file)
@@ -44,6 +44,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INPUT_TYPE_MONTH PUBLIC OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INPUT_TYPE_TIME PUBLIC OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INPUT_TYPE_WEEK PUBLIC OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LEGACY_CSS_VENDOR_PREFIXES PUBLIC ON)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LEGACY_NOTIFICATIONS PUBLIC OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LEGACY_VENDOR_PREFIXES PUBLIC OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LINK_PREFETCH PUBLIC OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MATHML PUBLIC ON)
index 1509af4..ff73705 100644 (file)
@@ -136,6 +136,7 @@ macro(WEBKIT_OPTION_BEGIN)
     WEBKIT_OPTION_DEFINE(ENABLE_JIT "Enable JustInTime javascript support" PRIVATE ON)
     WEBKIT_OPTION_DEFINE(ENABLE_LEGACY_CSS_VENDOR_PREFIXES "Toggle legacy css vendor prefix support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_LEGACY_ENCRYPTED_MEDIA "Support legacy EME" PRIVATE OFF)
+    WEBKIT_OPTION_DEFINE(ENABLE_LEGACY_NOTIFICATIONS "Toggle Legacy Desktop Notifications Support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_LEGACY_VENDOR_PREFIXES "Toggle Legacy Vendor Prefix Support" PRIVATE ON)
     WEBKIT_OPTION_DEFINE(ENABLE_LETTERPRESS "Toggle letterpress support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_LINK_PREFETCH "Toggle pre fetching support" PRIVATE OFF)
index bfa392f..66c59e6 100644 (file)
@@ -45,6 +45,7 @@
     <ENABLE_INTL>ENABLE_INTL</ENABLE_INTL>
     <ENABLE_LEGACY_CSS_VENDOR_PREFIXES>ENABLE_LEGACY_CSS_VENDOR_PREFIXES</ENABLE_LEGACY_CSS_VENDOR_PREFIXES>
     <ENABLE_LEGACY_ENCRYPTED_MEDIA>ENABLE_LEGACY_ENCRYPTED_MEDIA</ENABLE_LEGACY_ENCRYPTED_MEDIA>
+    <ENABLE_LEGACY_NOTIFICATIONS />
     <ENABLE_LINK_PREFETCH />
     <ENABLE_LINK_PRERENDER />
     <ENABLE_MATHML>ENABLE_MATHML</ENABLE_MATHML>
@@ -84,7 +85,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
-      <PreprocessorDefinitions>$(ENABLE_3D_TRANSFORMS);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_ACCELERATED_OVERFLOW_SCROLLING);$(ENABLE_ATTACHMENT_ELEMENT);$(ENABLE_CANVAS_PATH);$(ENABLE_CANVAS_PROXY);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_CONDITIONAL_RULES);$(ENABLE_CSS_IMAGE_SET);$(ENABLE_CSS3_TEXT);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_SELECTORS_LEVEL4);$(ENABLE_CSS_SHAPE_INSIDE);$(ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED);$(ENABLE_CURSOR_VISIBILITY);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_ENCRYPTED_MEDIA);$(ENABLE_FETCH_API);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_INTL);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_ENCRYPTED_MEDIA);$(ENABLE_LINK_PREFETCH);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MOUSE_CURSOR_SCALE);$(ENABLE_NOTIFICATIONS);$(ENABLE_PROXIMITY_EVENTS);$(ENABLE_QUOTA);$(ENABLE_NAVIGATOR_CONTENT_UTILS);$(ENABLE_STREAMS_API);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHARED_WORKERS);$(ENABLE_MEDIA_CONTROLS_SCRIPT);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_SQL_DATABASE);$(ENABLE_STYLE_SCOPED);$(ENABLE_SUBPIXEL_LAYOUT);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_VIDEO);$(ENABLE_VIDEO_TRACK);$(ENABLE_VIEW_MODE_CSS_MEDIA);$(ENABLE_WEB_ANIMATIONS);$(ENABLE_WEB_AUDIO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WEBGL);$(ENABLE_WEBGPU);$(ENABLE_WEBVTT_REGIONS);$(ENABLE_XHR_TIMEOUT);$(ENABLE_XSLT);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>$(ENABLE_3D_TRANSFORMS);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_ACCELERATED_OVERFLOW_SCROLLING);$(ENABLE_ATTACHMENT_ELEMENT);$(ENABLE_CANVAS_PATH);$(ENABLE_CANVAS_PROXY);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_CONDITIONAL_RULES);$(ENABLE_CSS_IMAGE_SET);$(ENABLE_CSS3_TEXT);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_SELECTORS_LEVEL4);$(ENABLE_CSS_SHAPE_INSIDE);$(ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED);$(ENABLE_CURSOR_VISIBILITY);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_ENCRYPTED_MEDIA);$(ENABLE_FETCH_API);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_INTL);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_ENCRYPTED_MEDIA);$(ENABLE_LEGACY_NOTIFICATIONS);$(ENABLE_LINK_PREFETCH);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MOUSE_CURSOR_SCALE);$(ENABLE_NOTIFICATIONS);$(ENABLE_PROXIMITY_EVENTS);$(ENABLE_QUOTA);$(ENABLE_NAVIGATOR_CONTENT_UTILS);$(ENABLE_STREAMS_API);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHARED_WORKERS);$(ENABLE_MEDIA_CONTROLS_SCRIPT);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_SQL_DATABASE);$(ENABLE_STYLE_SCOPED);$(ENABLE_SUBPIXEL_LAYOUT);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_VIDEO);$(ENABLE_VIDEO_TRACK);$(ENABLE_VIEW_MODE_CSS_MEDIA);$(ENABLE_WEB_ANIMATIONS);$(ENABLE_WEB_AUDIO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WEBGL);$(ENABLE_WEBGPU);$(ENABLE_WEBVTT_REGIONS);$(ENABLE_XHR_TIMEOUT);$(ENABLE_XSLT);%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
   </ItemDefinitionGroup>
   <ItemGroup>
       <Value>$(ENABLE_LEGACY_ENCRYPTED_MEDIA)</Value>
       <EnvironmentVariable>true</EnvironmentVariable>
     </BuildMacro>
+    <BuildMacro Include="ENABLE_LEGACY_NOTIFICATIONS">
+      <Value>$(ENABLE_LEGACY_NOTIFICATIONS)</Value>
+      <EnvironmentVariable>true</EnvironmentVariable>
+    </BuildMacro>
     <BuildMacro Include="ENABLE_LINK_PREFETCH">
       <Value>$(ENABLE_LINK_PREFETCH)</Value>
       <EnvironmentVariable>true</EnvironmentVariable>
index 6348c3e..3084770 100644 (file)
@@ -45,6 +45,7 @@
     <ENABLE_INTL>ENABLE_INTL</ENABLE_INTL>
     <ENABLE_LEGACY_CSS_VENDOR_PREFIXES>ENABLE_LEGACY_CSS_VENDOR_PREFIXES</ENABLE_LEGACY_CSS_VENDOR_PREFIXES>
     <ENABLE_LEGACY_ENCRYPTED_MEDIA />
+    <ENABLE_LEGACY_NOTIFICATIONS />
     <ENABLE_LINK_PREFETCH />
     <ENABLE_LINK_PRERENDER />
     <ENABLE_MATHML>ENABLE_MATHML</ENABLE_MATHML>
@@ -83,7 +84,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
-      <PreprocessorDefinitions>$(ENABLE_3D_TRANSFORMS);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_ACCELERATED_OVERFLOW_SCROLLING);$(ENABLE_ATTACHMENT_ELEMENT);$(ENABLE_CANVAS_PATH);$(ENABLE_CANVAS_PROXY);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_CONDITIONAL_RULES);$(ENABLE_CSS_IMAGE_SET);$(ENABLE_CSS3_TEXT);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_SELECTORS_LEVEL4);$(ENABLE_CSS_SHAPE_INSIDE);$(ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED);$(ENABLE_CURSOR_VISIBILITY);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_ENCRYPTED_MEDIA);$(ENABLE_FETCH_API);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_INTL);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_ENCRYPTED_MEDIA);$(ENABLE_LINK_PREFETCH);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MOUSE_CURSOR_SCALE);$(ENABLE_NOTIFICATIONS);$(ENABLE_PROXIMITY_EVENTS);$(ENABLE_QUOTA);$(ENABLE_NAVIGATOR_CONTENT_UTILS);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHARED_WORKERS);$(ENABLE_MEDIA_CONTROLS_SCRIPT);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_SQL_DATABASE);$(ENABLE_STYLE_SCOPED);$(ENABLE_SUBPIXEL_LAYOUT);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_VIDEO);$(ENABLE_VIDEO_TRACK);$(ENABLE_VIEW_MODE_CSS_MEDIA);$(ENABLE_WEB_ANIMATIONS);$(ENABLE_WEB_AUDIO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WEBGL);$(ENABLE_WEBVTT_REGIONS);$(ENABLE_XHR_TIMEOUT);$(ENABLE_XSLT);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>$(ENABLE_3D_TRANSFORMS);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_ACCELERATED_OVERFLOW_SCROLLING);$(ENABLE_ATTACHMENT_ELEMENT);$(ENABLE_CANVAS_PATH);$(ENABLE_CANVAS_PROXY);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_CONDITIONAL_RULES);$(ENABLE_CSS_IMAGE_SET);$(ENABLE_CSS3_TEXT);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_SELECTORS_LEVEL4);$(ENABLE_CSS_SHAPE_INSIDE);$(ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED);$(ENABLE_CURSOR_VISIBILITY);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_ENCRYPTED_MEDIA);$(ENABLE_FETCH_API);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_INTL);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_ENCRYPTED_MEDIA);$(ENABLE_LEGACY_NOTIFICATIONS);$(ENABLE_LINK_PREFETCH);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MOUSE_CURSOR_SCALE);$(ENABLE_NOTIFICATIONS);$(ENABLE_PROXIMITY_EVENTS);$(ENABLE_QUOTA);$(ENABLE_NAVIGATOR_CONTENT_UTILS);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHARED_WORKERS);$(ENABLE_MEDIA_CONTROLS_SCRIPT);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_SQL_DATABASE);$(ENABLE_STYLE_SCOPED);$(ENABLE_SUBPIXEL_LAYOUT);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_VIDEO);$(ENABLE_VIDEO_TRACK);$(ENABLE_VIEW_MODE_CSS_MEDIA);$(ENABLE_WEB_ANIMATIONS);$(ENABLE_WEB_AUDIO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WEBGL);$(ENABLE_WEBVTT_REGIONS);$(ENABLE_XHR_TIMEOUT);$(ENABLE_XSLT);%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
   </ItemDefinitionGroup>
   <ItemGroup>
       <Value>$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES)</Value>
       <EnvironmentVariable>true</EnvironmentVariable>
     </BuildMacro>
+    <BuildMacro Include="ENABLE_LEGACY_NOTIFICATIONS">
+      <Value>$(ENABLE_LEGACY_NOTIFICATIONS)</Value>
+      <EnvironmentVariable>true</EnvironmentVariable>
+    </BuildMacro>
     <BuildMacro Include="ENABLE_LINK_PREFETCH">
       <Value>$(ENABLE_LINK_PREFETCH)</Value>
       <EnvironmentVariable>true</EnvironmentVariable>
index f448de4..77d4f24 100644 (file)
@@ -1,3 +1,17 @@
+2017-05-04  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r216206.
+        https://bugs.webkit.org/show_bug.cgi?id=171714
+
+        Multiple LayoutTests crashing in Document::page() (Requested
+        by ap on #webkit).
+
+        Reverted changeset:
+
+        "Remove support for legacy Notifications"
+        https://bugs.webkit.org/show_bug.cgi?id=171487
+        http://trac.webkit.org/changeset/216206
+
 2017-05-04  Mark Lam  <mark.lam@apple.com>
 
         API test WTF.StaticStringImpl crashing in TestWebKitAPI::WTF_StaticStringImpl_Test::TestBody() + 3188
index 162cba4..da39eb1 100644 (file)
@@ -125,7 +125,7 @@ HRESULT DRTDesktopNotificationPresenter::checkNotificationPermission(_In_ BSTR /
 
     *result = 0;
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     JSStringRef jsOrigin = JSStringCreateWithBSTR(origin);
     bool allowed = ::gTestRunner->checkDesktopNotificationPermission(jsOrigin);
 
index d9534b8..2c3ae11 100644 (file)
@@ -281,6 +281,9 @@ my @features = (
     { option => "legacy-encrypted-media", desc => "Toggle Legacy EME V2 support",
       define => "ENABLE_LEGACY_ENCRYPTED_MEDIA", default => 0, value => \$legacyEncryptedMediaSupport },
 
+    { option => "legacy-notifications", desc => "Toggle Legacy Notifications support",
+      define => "ENABLE_LEGACY_NOTIFICATIONS", default => 0, value => \$legacyNotificationsSupport },
+
     { option => "legacy-vendor-prefixes", desc => "Toggle Legacy Vendor Prefix support",
       define => "ENABLE_LEGACY_VENDOR_PREFIXES", default => 1, value => \$legacyVendorPrefixSupport },
 
index 4aba02d..0ba5e18 100644 (file)
@@ -139,6 +139,7 @@ ENABLE_KEYBOARD_KEY_ATTRIBUTE = ENABLE_KEYBOARD_KEY_ATTRIBUTE;
 ENABLE_KEYBOARD_CODE_ATTRIBUTE = ENABLE_KEYBOARD_CODE_ATTRIBUTE;
 ENABLE_LEGACY_CSS_VENDOR_PREFIXES = ENABLE_LEGACY_CSS_VENDOR_PREFIXES;
 ENABLE_LEGACY_ENCRYPTED_MEDIA[sdk=macosx*] = ENABLE_LEGACY_ENCRYPTED_MEDIA;
+ENABLE_LEGACY_NOTIFICATIONS[sdk=macosx*] = ENABLE_LEGACY_NOTIFICATIONS;
 ENABLE_LEGACY_VENDOR_PREFIXES = ENABLE_LEGACY_VENDOR_PREFIXES;
 ENABLE_LETTERPRESS[sdk=iphone*] = ENABLE_LETTERPRESS;
 ENABLE_LINK_PREFETCH = ;
@@ -254,4 +255,4 @@ ENABLE_VARIATION_FONTS_IF_NOT_ = $(ENABLE_VARIATION_FONTS_IF_NOT_NO);
 ENABLE_VARIATION_FONTS_IF_NOT_NO = ENABLE_VARIATION_FONTS;
 ENABLE_VARIATION_FONTS_IF_NOT_YES = ;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_DELEGATE) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FETCH_API) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOSNIFF) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEB_ANIMATIONS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_RTC) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_DELEGATE) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FETCH_API) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FTL_JIT) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOSNIFF) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEB_ANIMATIONS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_RTC) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);