Change Notification.permissionLevel() to Notification.permission
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Aug 2012 15:20:41 +0000 (15:20 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Aug 2012 15:20:41 +0000 (15:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=88919
<rdar://problem/11650319>

Reviewed by Kentaro Hara.

Source/WebCore:

Retrieving the permission level has changed to Notification.permission, per this discussion:
http://lists.w3.org/Archives/Public/public-web-notification/2012Jun/0000.html

Test: fast/notifications/notifications-permission.html

* Modules/notifications/Notification.cpp: Rename to match attribute name.
(WebCore::Notification::permission):
* Modules/notifications/Notification.h: Rename to match attribute name.
(Notification):
* Modules/notifications/Notification.idl: Change to static readonly attribute.

LayoutTests:

* fast/notifications/notifications-permission-expected.txt: Added.
* fast/notifications/notifications-permission.html: Added.
* platform/chromium/TestExpectations: V8 does not properly support IDL static
attributes. This is tracked in bug 93488.

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

LayoutTests/ChangeLog
LayoutTests/fast/notifications/notifications-permission-expected.txt [new file with mode: 0644]
LayoutTests/fast/notifications/notifications-permission.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/notifications/Notification.cpp
Source/WebCore/Modules/notifications/Notification.h
Source/WebCore/Modules/notifications/Notification.idl

index 5242892..19a8a10 100644 (file)
@@ -1,3 +1,16 @@
+2012-08-10  Jon Lee  <jonlee@apple.com>
+
+        Change Notification.permissionLevel() to Notification.permission
+        https://bugs.webkit.org/show_bug.cgi?id=88919
+        <rdar://problem/11650319>
+
+        Reviewed by Kentaro Hara.
+
+        * fast/notifications/notifications-permission-expected.txt: Added.
+        * fast/notifications/notifications-permission.html: Added.
+        * platform/chromium/TestExpectations: V8 does not properly support IDL static
+        attributes. This is tracked in bug 93488.
+
 2012-08-10  Andrey Kosyakov  <caseq@chromium.org>
 
         Web Inspector: add frame ids to TimeStamp, Time and TimeEnd records in Timeline
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..937c307
--- /dev/null
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../js/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="../js/resources/js-test-post.js"></script>
+</body>
+</html>
index d681b87..19fd0a6 100644 (file)
@@ -3471,3 +3471,7 @@ BUGWK93568 DEBUG : http/tests/misc/window-dot-stop.html = PASS TEXT
 
 // Should only need rebaselining after bug 93558, if both squares are fully green.
 BUGWK93558 : compositing/masks/layer-mask-placement.html = IMAGE
+
+// V8 does not support static attributes
+BUGWK93488 SKIP : fast/notifications/notifications-permission.html = TEXT
+
index 1a8430e..b3e69c1 100644 (file)
@@ -1,3 +1,22 @@
+2012-08-10  Jon Lee  <jonlee@apple.com>
+
+        Change Notification.permissionLevel() to Notification.permission
+        https://bugs.webkit.org/show_bug.cgi?id=88919
+        <rdar://problem/11650319>
+
+        Reviewed by Kentaro Hara.
+
+        Retrieving the permission level has changed to Notification.permission, per this discussion:
+        http://lists.w3.org/Archives/Public/public-web-notification/2012Jun/0000.html
+
+        Test: fast/notifications/notifications-permission.html
+
+        * Modules/notifications/Notification.cpp: Rename to match attribute name.
+        (WebCore::Notification::permission):
+        * Modules/notifications/Notification.h: Rename to match attribute name.
+        (Notification):
+        * Modules/notifications/Notification.idl: Change to static readonly attribute.
+
 2012-08-10  Kentaro Hara  <haraken@chromium.org>
 
         [V8] Remove collectIsolatedContexts() from V8Proxy
index 348992a..9248e1b 100644 (file)
@@ -254,7 +254,7 @@ void Notification::taskTimerFired(Timer<Notification>* timer)
 
 
 #if ENABLE(NOTIFICATIONS)
-const String& Notification::permissionLevel(ScriptExecutionContext* context)
+const String& Notification::permission(ScriptExecutionContext* context)
 {
     ASSERT(context->isDocument());
     ASSERT(static_cast<Document*>(context)->page());
index 8de9100..17a0395 100644 (file)
@@ -138,7 +138,7 @@ public:
     void finalize();
 
 #if ENABLE(NOTIFICATIONS)
-    static const String& permissionLevel(ScriptExecutionContext*);
+    static const String& permission(ScriptExecutionContext*);
     static const String& permissionString(NotificationClient::Permission);
     static void requestPermission(ScriptExecutionContext*, PassRefPtr<NotificationPermissionCallback>);
 #endif
index da2eb7f..0f029f8 100644 (file)
@@ -52,7 +52,7 @@ module threads {
 
 
 #if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
-        [CallWith=ScriptExecutionContext] static DOMString permissionLevel();
+        static readonly attribute [CallWith=ScriptExecutionContext] DOMString permission;
         [Custom] static void requestPermission(in NotificationPermissionCallback callback);
 #endif