Diff
Modified: trunk/LayoutTests/ChangeLog (128112 => 128113)
--- trunk/LayoutTests/ChangeLog 2012-09-10 21:52:24 UTC (rev 128112)
+++ trunk/LayoutTests/ChangeLog 2012-09-10 22:12:52 UTC (rev 128113)
@@ -1,3 +1,16 @@
+2012-08-31 Jon Lee <[email protected]>
+
+ 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.
+
2012-09-10 Geoffrey Garen <[email protected]>
DFG misses arguments tear-off for function.arguments if 'arguments' is used
Modified: trunk/Source/WebCore/ChangeLog (128112 => 128113)
--- trunk/Source/WebCore/ChangeLog 2012-09-10 21:52:24 UTC (rev 128112)
+++ trunk/Source/WebCore/ChangeLog 2012-09-10 22:12:52 UTC (rev 128113)
@@ -1,3 +1,47 @@
+2012-09-07 Jon Lee <[email protected]>
+
+ 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.
+
+2012-08-31 Jon Lee <[email protected]>
+
+ 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.
+
+ The latest spec only allows setting the event listeners after the notification has been created.
+
+ Test: http/tests/notifications/events-in-dictionary.html
+
+ * Modules/notifications/Notification.cpp:
+ (WebCore::Notification::create): Do not look for the event handlers in the options dictionary.
+
2012-09-10 Tony Chang <[email protected]>
Rename computeLogicalWidth to updateLogicalWidth
Modified: trunk/Source/WebCore/Modules/notifications/Notification.cpp (128112 => 128113)
--- trunk/Source/WebCore/Modules/notifications/Notification.cpp 2012-09-10 21:52:24 UTC (rev 128112)
+++ trunk/Source/WebCore/Modules/notifications/Notification.cpp 2012-09-10 22:12:52 UTC (rev 128113)
@@ -146,6 +146,15 @@
notification->setBody(argument);
if (options.get("tag", argument))
notification->setTag(argument);
+ if (options.get("lang", argument))
+ notification->setLang(argument);
+ if (options.get("dir", argument))
+ notification->setDir(argument);
+ if (options.get("icon", argument)) {
+ KURL iconURI = argument.isEmpty() ? KURL() : context->completeURL(argument);
+ if (!iconURI.isEmpty() && iconURI.isValid())
+ notification->setIconURL(iconURI);
+ }
notification->suspendIfNeeded();
return notification.release();
Modified: trunk/Source/WebCore/Modules/notifications/Notification.h (128112 => 128113)
--- trunk/Source/WebCore/Modules/notifications/Notification.h 2012-09-10 21:52:24 UTC (rev 128112)
+++ trunk/Source/WebCore/Modules/notifications/Notification.h 2012-09-10 22:12:52 UTC (rev 128113)
@@ -86,14 +86,20 @@
bool isHTML() const { return m_isHTML; }
void setHTML(bool isHTML) { m_isHTML = isHTML; }
+#if ENABLE(LEGACY_NOTIFICATIONS)
KURL url() const { return m_notificationURL; }
void setURL(KURL url) { m_notificationURL = url; }
-
+#endif
+
KURL iconURL() const { return m_icon; }
+ void setIconURL(const KURL& url) { m_icon = url; }
String title() const { return m_title; }
String body() const { return m_body; }
+ String lang() const { return m_lang; }
+ void setLang(const String& lang) { m_lang = lang; }
+
String dir() const { return m_direction; }
void setDir(const String& dir) { m_direction = dir; }
@@ -174,10 +180,12 @@
KURL m_icon;
String m_title;
String m_body;
- // FIXME: Deprecate HTML Notifications.
+#if ENABLE(LEGACY_NOTIFICATIONS)
KURL m_notificationURL;
+#endif
String m_direction;
+ String m_lang;
String m_tag;
enum NotificationState {
Modified: trunk/Source/WebCore/Modules/notifications/Notification.idl (128112 => 128113)
--- trunk/Source/WebCore/Modules/notifications/Notification.idl 2012-09-10 21:52:24 UTC (rev 128112)
+++ trunk/Source/WebCore/Modules/notifications/Notification.idl 2012-09-10 22:12:52 UTC (rev 128113)
@@ -64,8 +64,8 @@
attribute EventListener onclose;
attribute EventListener onclick;
+#if defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS
attribute DOMString dir;
-#if defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS
attribute DOMString replaceId;
#endif
#if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
Modified: trunk/Source/WebKit/mac/ChangeLog (128112 => 128113)
--- trunk/Source/WebKit/mac/ChangeLog 2012-09-10 21:52:24 UTC (rev 128112)
+++ trunk/Source/WebKit/mac/ChangeLog 2012-09-10 22:12:52 UTC (rev 128113)
@@ -1,3 +1,18 @@
+2012-09-07 Jon Lee <[email protected]>
+
+ 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]):
+
2012-09-10 Jer Noble <[email protected]>
NSInvalidArgumentException in WebFrameLoaderClient::shouldSendDoNotTrackHTTPHeader()
Modified: trunk/Source/WebKit/mac/WebView/WebNotification.h (128112 => 128113)
--- trunk/Source/WebKit/mac/WebView/WebNotification.h 2012-09-10 21:52:24 UTC (rev 128112)
+++ trunk/Source/WebKit/mac/WebView/WebNotification.h 2012-09-10 22:12:52 UTC (rev 128113)
@@ -38,6 +38,8 @@
- (NSString *)body;
- (NSString *)tag;
- (NSString *)iconURL;
+- (NSString *)lang;
+- (NSString *)dir;
- (WebSecurityOrigin *)origin;
- (uint64_t)notificationID;
Modified: trunk/Source/WebKit/mac/WebView/WebNotification.mm (128112 => 128113)
--- trunk/Source/WebKit/mac/WebView/WebNotification.mm 2012-09-10 21:52:24 UTC (rev 128112)
+++ trunk/Source/WebKit/mac/WebView/WebNotification.mm 2012-09-10 22:12:52 UTC (rev 128113)
@@ -117,6 +117,24 @@
#endif
}
+- (NSString *)lang
+{
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+ return core(self)->lang();
+#else
+ return nil;
+#endif
+}
+
+- (NSString *)dir
+{
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+ return core(self)->dir();
+#else
+ return nil;
+#endif
+}
+
- (WebSecurityOrigin *)origin
{
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
Modified: trunk/Source/WebKit2/ChangeLog (128112 => 128113)
--- trunk/Source/WebKit2/ChangeLog 2012-09-10 21:52:24 UTC (rev 128112)
+++ trunk/Source/WebKit2/ChangeLog 2012-09-10 22:12:52 UTC (rev 128113)
@@ -1,3 +1,36 @@
+2012-09-07 Jon Lee <[email protected]>
+
+ 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):
+
2012-09-10 Alexey Proskuryakov <[email protected]>
Build fix.
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKNotification.cpp (128112 => 128113)
--- trunk/Source/WebKit2/UIProcess/API/C/WKNotification.cpp 2012-09-10 21:52:24 UTC (rev 128112)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKNotification.cpp 2012-09-10 22:12:52 UTC (rev 128113)
@@ -57,6 +57,16 @@
return toCopiedAPI(toImpl(notification)->tag());
}
+WKStringRef WKNotificationCopyLang(WKNotificationRef notification)
+{
+ return toCopiedAPI(toImpl(notification)->lang());
+}
+
+WKStringRef WKNotificationCopyDir(WKNotificationRef notification)
+{
+ return toCopiedAPI(toImpl(notification)->dir());
+}
+
WKSecurityOriginRef WKNotificationGetSecurityOrigin(WKNotificationRef notification)
{
return toAPI(toImpl(notification)->origin());
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKNotification.h (128112 => 128113)
--- trunk/Source/WebKit2/UIProcess/API/C/WKNotification.h 2012-09-10 21:52:24 UTC (rev 128112)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKNotification.h 2012-09-10 22:12:52 UTC (rev 128113)
@@ -38,6 +38,8 @@
WK_EXPORT WKStringRef WKNotificationCopyBody(WKNotificationRef notification);
WK_EXPORT WKStringRef WKNotificationCopyIconURL(WKNotificationRef notification);
WK_EXPORT WKStringRef WKNotificationCopyTag(WKNotificationRef notification);
+WK_EXPORT WKStringRef WKNotificationCopyLang(WKNotificationRef notification);
+WK_EXPORT WKStringRef WKNotificationCopyDir(WKNotificationRef notification);
WK_EXPORT WKSecurityOriginRef WKNotificationGetSecurityOrigin(WKNotificationRef notification);
WK_EXPORT uint64_t WKNotificationGetID(WKNotificationRef notification);
Modified: trunk/Source/WebKit2/UIProcess/Notifications/WebNotification.cpp (128112 => 128113)
--- trunk/Source/WebKit2/UIProcess/Notifications/WebNotification.cpp 2012-09-10 21:52:24 UTC (rev 128112)
+++ trunk/Source/WebKit2/UIProcess/Notifications/WebNotification.cpp 2012-09-10 22:12:52 UTC (rev 128113)
@@ -33,11 +33,13 @@
namespace WebKit {
-WebNotification::WebNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& originString, uint64_t notificationID)
+WebNotification::WebNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t notificationID)
: m_title(title)
, m_body(body)
, m_iconURL(iconURL)
, m_tag(tag)
+ , m_lang(lang)
+ , m_dir(dir)
, m_origin(WebSecurityOrigin::createFromString(originString))
, m_notificationID(notificationID)
{
Modified: trunk/Source/WebKit2/UIProcess/Notifications/WebNotification.h (128112 => 128113)
--- trunk/Source/WebKit2/UIProcess/Notifications/WebNotification.h 2012-09-10 21:52:24 UTC (rev 128112)
+++ trunk/Source/WebKit2/UIProcess/Notifications/WebNotification.h 2012-09-10 22:12:52 UTC (rev 128113)
@@ -45,21 +45,23 @@
public:
static const Type APIType = TypeNotification;
- static PassRefPtr<WebNotification> create(const String& title, const String& body, const String& iconURL, const String& tag, const String& originString, uint64_t notificationID)
+ static PassRefPtr<WebNotification> create(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t notificationID)
{
- return adoptRef(new WebNotification(title, body, iconURL, tag, originString, notificationID));
+ return adoptRef(new WebNotification(title, body, iconURL, tag, lang, dir, originString, notificationID));
}
const String& title() const { return m_title; }
const String& body() const { return m_body; }
const String& iconURL() const { return m_iconURL; }
const String& tag() const { return m_tag; }
+ const String& lang() const { return m_lang; }
+ const String& dir() const { return m_dir; }
WebSecurityOrigin* origin() const { return m_origin.get(); }
uint64_t notificationID() const { return m_notificationID; }
private:
- WebNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& originString, uint64_t notificationID);
+ WebNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t notificationID);
virtual Type type() const { return APIType; }
@@ -67,6 +69,8 @@
String m_body;
String m_iconURL;
String m_tag;
+ String m_lang;
+ String m_dir;
RefPtr<WebSecurityOrigin> m_origin;
uint64_t m_notificationID;
};
Modified: trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp (128112 => 128113)
--- trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp 2012-09-10 21:52:24 UTC (rev 128112)
+++ trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp 2012-09-10 22:12:52 UTC (rev 128113)
@@ -76,12 +76,12 @@
didReceiveWebNotificationManagerProxyMessage(connection, messageID, arguments);
}
-void WebNotificationManagerProxy::show(WebPageProxy* page, const String& title, const String& body, const String& iconURL, const String& tag, const String& originString, uint64_t notificationID)
+void WebNotificationManagerProxy::show(WebPageProxy* page, const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t notificationID)
{
if (!isNotificationIDValid(notificationID))
return;
- RefPtr<WebNotification> notification = WebNotification::create(title, body, iconURL, tag, originString, notificationID);
+ RefPtr<WebNotification> notification = WebNotification::create(title, body, iconURL, tag, lang, dir, originString, notificationID);
m_notifications.set(notificationID, notification);
m_provider.show(page, notification.get());
}
Modified: trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h (128112 => 128113)
--- trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h 2012-09-10 21:52:24 UTC (rev 128112)
+++ trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h 2012-09-10 22:12:52 UTC (rev 128113)
@@ -60,7 +60,7 @@
void initializeProvider(const WKNotificationProvider*);
void populateCopyOfNotificationPermissions(HashMap<String, bool>&);
- void show(WebPageProxy*, const String& title, const String& body, const String& iconURL, const String& tag, const String& originString, uint64_t notificationID);
+ void show(WebPageProxy*, const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t notificationID);
void providerDidShowNotification(uint64_t notificationID);
void providerDidClickNotification(uint64_t notificationID);
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (128112 => 128113)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2012-09-10 21:52:24 UTC (rev 128112)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2012-09-10 22:12:52 UTC (rev 128113)
@@ -3716,9 +3716,9 @@
request->deny();
}
-void WebPageProxy::showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& originString, uint64_t notificationID)
+void WebPageProxy::showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t notificationID)
{
- m_process->context()->notificationManagerProxy()->show(this, title, body, iconURL, tag, originString, notificationID);
+ m_process->context()->notificationManagerProxy()->show(this, title, body, iconURL, tag, lang, dir, originString, notificationID);
}
float WebPageProxy::headerHeight(WebFrameProxy* frame)
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (128112 => 128113)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2012-09-10 21:52:24 UTC (rev 128112)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2012-09-10 22:12:52 UTC (rev 128113)
@@ -830,7 +830,7 @@
void reattachToWebProcessWithItem(WebBackForwardListItem*);
void requestNotificationPermission(uint64_t notificationID, const String& originString);
- void showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& originString, uint64_t notificationID);
+ void showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t notificationID);
#if USE(TILED_BACKING_STORE)
void pageDidRequestScroll(const WebCore::IntPoint&);
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (128112 => 128113)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2012-09-10 21:52:24 UTC (rev 128112)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2012-09-10 22:12:52 UTC (rev 128113)
@@ -232,7 +232,7 @@
# Notification messages
RequestNotificationPermission(uint64_t requestID, WTF::String originIdentifier)
- ShowNotification(WTF::String title, WTF::String body, WTF::String iconURL, WTF::String tag, WTF::String originIdentifier, uint64_t notificationID)
+ ShowNotification(WTF::String title, WTF::String body, WTF::String iconURL, WTF::String tag, WTF::String lang, WTF::String dir, WTF::String originIdentifier, uint64_t notificationID)
# Spelling and grammar messages
#if USE(UNIFIED_TEXT_CHECKING)
Modified: trunk/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp (128112 => 128113)
--- trunk/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp 2012-09-10 21:52:24 UTC (rev 128112)
+++ trunk/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp 2012-09-10 22:12:52 UTC (rev 128113)
@@ -137,9 +137,9 @@
it->second.append(notificationID);
#if ENABLE(NOTIFICATIONS)
- m_process->connection()->send(Messages::WebPageProxy::ShowNotification(notification->title(), notification->body(), notification->iconURL().string(), notification->tag(), notification->scriptExecutionContext()->securityOrigin()->toString(), notificationID), page->pageID());
+ m_process->connection()->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->connection()->send(Messages::WebPageProxy::ShowNotification(notification->title(), notification->body(), notification->iconURL().string(), notification->replaceId(), notification->scriptExecutionContext()->securityOrigin()->toString(), notificationID), page->pageID());
+ m_process->connection()->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