Source/WebCore: Update notifications to latest spec
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Sep 2012 22:12:52 +0000 (22:12 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Sep 2012 22:12:52 +0000 (22:12 +0000)
commitf15f4cf7f29d2b2330dd4a33f247b1e276e8ddbf
tree0482ec84a6a1f6c771d9e7e73c1e7c6ae5fcd95e
parent003ffc91bbc045db67c1e73919a51a95eef6e8b8
Source/WebCore: Update notifications to latest spec
https://bugs.webkit.org/show_bug.cgi?id=91726
<rdar://problem/11910451>

Reviewed by Alexey Proskuryakov.

Among the changes:

Addition of lang attribute
http://lists.w3.org/Archives/Public/public-web-notification/2012Jul/0025.html

Specification of icon URL is icon instead of iconURL
http://lists.w3.org/Archives/Public/public-web-notification/2012Jul/0012.html

Tests are not possible since at best they only verify exposure of the attributes, which isn't
terribly useful, and use of the attributes depend on the platform.

* Modules/notifications/Notification.cpp:
(WebCore::Notification::create): Add support for reading lang, dir, and icon from option dictionary.
* Modules/notifications/Notification.h:
(Notification): Make url() and setURL(), which are used for HTML notifications, only available with
ENABLE(LEGACY_NOTIFICATIONS).
(WebCore::Notification::setIconURL): Added so that it can be set from the option dictionary.
(WebCore::Notification::lang):
(WebCore::Notification::setLang):
* Modules/notifications/Notification.idl: According to specification, dir is not exposed.

Source/WebKit/mac: Update notifications to latest spec
https://bugs.webkit.org/show_bug.cgi?id=91726
<rdar://problem/11910451>

Reviewed by Alexey Proskuryakov.

Expose lang and dir.

* WebView/WebNotification.h:
* WebView/WebNotification.mm:
(-[WebNotification lang]):
(-[WebNotification dir]):

Source/WebKit2: Update notifications to latest spec
https://bugs.webkit.org/show_bug.cgi?id=91726
<rdar://problem/11910451>

Reviewed by Alexey Proskuryakov.

Expose lang and dir.

* UIProcess/API/C/WKNotification.cpp:
(WKNotificationCopyLang):
(WKNotificationCopyDir):
* UIProcess/API/C/WKNotification.h:
* UIProcess/Notifications/WebNotification.cpp:
(WebKit::WebNotification::WebNotification):
* UIProcess/Notifications/WebNotification.h:
(WebKit::WebNotification::create):
(WebKit::WebNotification::lang):
(WebKit::WebNotification::dir):
(WebNotification):
* UIProcess/Notifications/WebNotificationManagerProxy.cpp:
(WebKit::WebNotificationManagerProxy::show):
* UIProcess/Notifications/WebNotificationManagerProxy.h:
(WebNotificationManagerProxy):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showNotification):
* UIProcess/WebPageProxy.h:
(WebPageProxy):
* UIProcess/WebPageProxy.messages.in:
* WebProcess/Notifications/WebNotificationManager.cpp:
(WebKit::WebNotificationManager::show):

LayoutTests: The options dictionary in Notification constructor should not accept event listeners
https://bugs.webkit.org/show_bug.cgi?id=95538
<rdar://problem/12213901>

Reviewed by Alexey Proskuryakov.

Make sure the onshow handler added in the options dictionary does not get called.

* http/tests/notifications/events-in-dictionary-expected.txt: Added.
* http/tests/notifications/events-in-dictionary.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@128113 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/Modules/notifications/Notification.cpp
Source/WebCore/Modules/notifications/Notification.h
Source/WebCore/Modules/notifications/Notification.idl
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebNotification.h
Source/WebKit/mac/WebView/WebNotification.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKNotification.cpp
Source/WebKit2/UIProcess/API/C/WKNotification.h
Source/WebKit2/UIProcess/Notifications/WebNotification.cpp
Source/WebKit2/UIProcess/Notifications/WebNotification.h
Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp
Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp