Changeset 128113 in webkit
- Timestamp:
- Sep 10, 2012 3:12:52 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r128111 r128113 1 2012-08-31 Jon Lee <jonlee@apple.com> 2 3 The options dictionary in Notification constructor should not accept event listeners 4 https://bugs.webkit.org/show_bug.cgi?id=95538 5 <rdar://problem/12213901> 6 7 Reviewed by Alexey Proskuryakov. 8 9 Make sure the onshow handler added in the options dictionary does not get called. 10 11 * http/tests/notifications/events-in-dictionary-expected.txt: Added. 12 * http/tests/notifications/events-in-dictionary.html: Added. 13 1 14 2012-09-10 Geoffrey Garen <ggaren@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r128110 r128113 1 2012-09-07 Jon Lee <jonlee@apple.com> 2 3 Update notifications to latest spec 4 https://bugs.webkit.org/show_bug.cgi?id=91726 5 <rdar://problem/11910451> 6 7 Reviewed by Alexey Proskuryakov. 8 9 Among the changes: 10 11 Addition of lang attribute 12 http://lists.w3.org/Archives/Public/public-web-notification/2012Jul/0025.html 13 14 Specification of icon URL is icon instead of iconURL 15 http://lists.w3.org/Archives/Public/public-web-notification/2012Jul/0012.html 16 17 Tests are not possible since at best they only verify exposure of the attributes, which isn't 18 terribly useful, and use of the attributes depend on the platform. 19 20 * Modules/notifications/Notification.cpp: 21 (WebCore::Notification::create): Add support for reading lang, dir, and icon from option dictionary. 22 * Modules/notifications/Notification.h: 23 (Notification): Make url() and setURL(), which are used for HTML notifications, only available with 24 ENABLE(LEGACY_NOTIFICATIONS). 25 (WebCore::Notification::setIconURL): Added so that it can be set from the option dictionary. 26 (WebCore::Notification::lang): 27 (WebCore::Notification::setLang): 28 * Modules/notifications/Notification.idl: According to specification, dir is not exposed. 29 30 2012-08-31 Jon Lee <jonlee@apple.com> 31 32 The options dictionary in Notification constructor should not accept event listeners 33 https://bugs.webkit.org/show_bug.cgi?id=95538 34 <rdar://problem/12213901> 35 36 Reviewed by Alexey Proskuryakov. 37 38 The latest spec only allows setting the event listeners after the notification has been created. 39 40 Test: http/tests/notifications/events-in-dictionary.html 41 42 * Modules/notifications/Notification.cpp: 43 (WebCore::Notification::create): Do not look for the event handlers in the options dictionary. 44 1 45 2012-09-10 Tony Chang <tony@chromium.org> 2 46 -
trunk/Source/WebCore/Modules/notifications/Notification.cpp
r128080 r128113 147 147 if (options.get("tag", argument)) 148 148 notification->setTag(argument); 149 if (options.get("lang", argument)) 150 notification->setLang(argument); 151 if (options.get("dir", argument)) 152 notification->setDir(argument); 153 if (options.get("icon", argument)) { 154 KURL iconURI = argument.isEmpty() ? KURL() : context->completeURL(argument); 155 if (!iconURI.isEmpty() && iconURI.isValid()) 156 notification->setIconURL(iconURI); 157 } 149 158 150 159 notification->suspendIfNeeded(); -
trunk/Source/WebCore/Modules/notifications/Notification.h
r127321 r128113 87 87 void setHTML(bool isHTML) { m_isHTML = isHTML; } 88 88 89 #if ENABLE(LEGACY_NOTIFICATIONS) 89 90 KURL url() const { return m_notificationURL; } 90 91 void setURL(KURL url) { m_notificationURL = url; } 91 92 #endif 93 92 94 KURL iconURL() const { return m_icon; } 95 void setIconURL(const KURL& url) { m_icon = url; } 93 96 94 97 String title() const { return m_title; } 95 98 String body() const { return m_body; } 99 100 String lang() const { return m_lang; } 101 void setLang(const String& lang) { m_lang = lang; } 96 102 97 103 String dir() const { return m_direction; } … … 175 181 String m_title; 176 182 String m_body; 177 // FIXME: Deprecate HTML Notifications. 183 #if ENABLE(LEGACY_NOTIFICATIONS) 178 184 KURL m_notificationURL; 185 #endif 179 186 180 187 String m_direction; 188 String m_lang; 181 189 String m_tag; 182 190 -
trunk/Source/WebCore/Modules/notifications/Notification.idl
r125280 r128113 65 65 attribute EventListener onclick; 66 66 67 #if defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS 67 68 attribute DOMString dir; 68 #if defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS69 69 attribute DOMString replaceId; 70 70 #endif -
trunk/Source/WebKit/mac/ChangeLog
r128112 r128113 1 2012-09-07 Jon Lee <jonlee@apple.com> 2 3 Update notifications to latest spec 4 https://bugs.webkit.org/show_bug.cgi?id=91726 5 <rdar://problem/11910451> 6 7 Reviewed by Alexey Proskuryakov. 8 9 Expose lang and dir. 10 11 * WebView/WebNotification.h: 12 * WebView/WebNotification.mm: 13 (-[WebNotification lang]): 14 (-[WebNotification dir]): 15 1 16 2012-09-10 Jer Noble <jer.noble@apple.com> 2 17 -
trunk/Source/WebKit/mac/WebView/WebNotification.h
r127009 r128113 39 39 - (NSString *)tag; 40 40 - (NSString *)iconURL; 41 - (NSString *)lang; 42 - (NSString *)dir; 41 43 - (WebSecurityOrigin *)origin; 42 44 - (uint64_t)notificationID; -
trunk/Source/WebKit/mac/WebView/WebNotification.mm
r127009 r128113 118 118 } 119 119 120 - (NSString *)lang 121 { 122 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 123 return core(self)->lang(); 124 #else 125 return nil; 126 #endif 127 } 128 129 - (NSString *)dir 130 { 131 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 132 return core(self)->dir(); 133 #else 134 return nil; 135 #endif 136 } 137 120 138 - (WebSecurityOrigin *)origin 121 139 { -
trunk/Source/WebKit2/ChangeLog
r128103 r128113 1 2012-09-07 Jon Lee <jonlee@apple.com> 2 3 Update notifications to latest spec 4 https://bugs.webkit.org/show_bug.cgi?id=91726 5 <rdar://problem/11910451> 6 7 Reviewed by Alexey Proskuryakov. 8 9 Expose lang and dir. 10 11 * UIProcess/API/C/WKNotification.cpp: 12 (WKNotificationCopyLang): 13 (WKNotificationCopyDir): 14 * UIProcess/API/C/WKNotification.h: 15 * UIProcess/Notifications/WebNotification.cpp: 16 (WebKit::WebNotification::WebNotification): 17 * UIProcess/Notifications/WebNotification.h: 18 (WebKit::WebNotification::create): 19 (WebKit::WebNotification::lang): 20 (WebKit::WebNotification::dir): 21 (WebNotification): 22 * UIProcess/Notifications/WebNotificationManagerProxy.cpp: 23 (WebKit::WebNotificationManagerProxy::show): 24 * UIProcess/Notifications/WebNotificationManagerProxy.h: 25 (WebNotificationManagerProxy): 26 * UIProcess/WebPageProxy.cpp: 27 (WebKit::WebPageProxy::showNotification): 28 * UIProcess/WebPageProxy.h: 29 (WebPageProxy): 30 * UIProcess/WebPageProxy.messages.in: 31 * WebProcess/Notifications/WebNotificationManager.cpp: 32 (WebKit::WebNotificationManager::show): 33 1 34 2012-09-10 Alexey Proskuryakov <ap@apple.com> 2 35 -
trunk/Source/WebKit2/UIProcess/API/C/WKNotification.cpp
r112821 r128113 58 58 } 59 59 60 WKStringRef WKNotificationCopyLang(WKNotificationRef notification) 61 { 62 return toCopiedAPI(toImpl(notification)->lang()); 63 } 64 65 WKStringRef WKNotificationCopyDir(WKNotificationRef notification) 66 { 67 return toCopiedAPI(toImpl(notification)->dir()); 68 } 69 60 70 WKSecurityOriginRef WKNotificationGetSecurityOrigin(WKNotificationRef notification) 61 71 { -
trunk/Source/WebKit2/UIProcess/API/C/WKNotification.h
r112821 r128113 39 39 WK_EXPORT WKStringRef WKNotificationCopyIconURL(WKNotificationRef notification); 40 40 WK_EXPORT WKStringRef WKNotificationCopyTag(WKNotificationRef notification); 41 WK_EXPORT WKStringRef WKNotificationCopyLang(WKNotificationRef notification); 42 WK_EXPORT WKStringRef WKNotificationCopyDir(WKNotificationRef notification); 41 43 WK_EXPORT WKSecurityOriginRef WKNotificationGetSecurityOrigin(WKNotificationRef notification); 42 44 WK_EXPORT uint64_t WKNotificationGetID(WKNotificationRef notification); -
trunk/Source/WebKit2/UIProcess/Notifications/WebNotification.cpp
r112821 r128113 34 34 namespace WebKit { 35 35 36 WebNotification::WebNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& originString, uint64_t notificationID)36 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) 37 37 : m_title(title) 38 38 , m_body(body) 39 39 , m_iconURL(iconURL) 40 40 , m_tag(tag) 41 , m_lang(lang) 42 , m_dir(dir) 41 43 , m_origin(WebSecurityOrigin::createFromString(originString)) 42 44 , m_notificationID(notificationID) -
trunk/Source/WebKit2/UIProcess/Notifications/WebNotification.h
r112821 r128113 46 46 static const Type APIType = TypeNotification; 47 47 48 static PassRefPtr<WebNotification> create(const String& title, const String& body, const String& iconURL, const String& tag, const String& originString, uint64_t notificationID)48 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) 49 49 { 50 return adoptRef(new WebNotification(title, body, iconURL, tag, originString, notificationID));50 return adoptRef(new WebNotification(title, body, iconURL, tag, lang, dir, originString, notificationID)); 51 51 } 52 52 … … 55 55 const String& iconURL() const { return m_iconURL; } 56 56 const String& tag() const { return m_tag; } 57 const String& lang() const { return m_lang; } 58 const String& dir() const { return m_dir; } 57 59 WebSecurityOrigin* origin() const { return m_origin.get(); } 58 60 … … 60 62 61 63 private: 62 WebNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& originString, uint64_t notificationID);64 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); 63 65 64 66 virtual Type type() const { return APIType; } … … 68 70 String m_iconURL; 69 71 String m_tag; 72 String m_lang; 73 String m_dir; 70 74 RefPtr<WebSecurityOrigin> m_origin; 71 75 uint64_t m_notificationID; -
trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp
r112821 r128113 77 77 } 78 78 79 void WebNotificationManagerProxy::show(WebPageProxy* page, const String& title, const String& body, const String& iconURL, const String& tag, const String& originString, uint64_t notificationID)79 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) 80 80 { 81 81 if (!isNotificationIDValid(notificationID)) 82 82 return; 83 83 84 RefPtr<WebNotification> notification = WebNotification::create(title, body, iconURL, tag, originString, notificationID);84 RefPtr<WebNotification> notification = WebNotification::create(title, body, iconURL, tag, lang, dir, originString, notificationID); 85 85 m_notifications.set(notificationID, notification); 86 86 m_provider.show(page, notification.get()); -
trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h
r112821 r128113 61 61 void populateCopyOfNotificationPermissions(HashMap<String, bool>&); 62 62 63 void show(WebPageProxy*, const String& title, const String& body, const String& iconURL, const String& tag, const String& originString, uint64_t notificationID);63 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); 64 64 65 65 void providerDidShowNotification(uint64_t notificationID); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r127988 r128113 3717 3717 } 3718 3718 3719 void WebPageProxy::showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& originString, uint64_t notificationID)3720 { 3721 m_process->context()->notificationManagerProxy()->show(this, title, body, iconURL, tag, originString, notificationID);3719 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) 3720 { 3721 m_process->context()->notificationManagerProxy()->show(this, title, body, iconURL, tag, lang, dir, originString, notificationID); 3722 3722 } 3723 3723 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r127988 r128113 831 831 832 832 void requestNotificationPermission(uint64_t notificationID, const String& originString); 833 void showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& originString, uint64_t notificationID);833 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); 834 834 835 835 #if USE(TILED_BACKING_STORE) -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r127988 r128113 233 233 # Notification messages 234 234 RequestNotificationPermission(uint64_t requestID, WTF::String originIdentifier) 235 ShowNotification(WTF::String title, WTF::String body, WTF::String iconURL, WTF::String tag, WTF::String originIdentifier, uint64_t notificationID)235 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) 236 236 237 237 # Spelling and grammar messages -
trunk/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
r127019 r128113 138 138 139 139 #if ENABLE(NOTIFICATIONS) 140 m_process->connection()->send(Messages::WebPageProxy::ShowNotification(notification->title(), notification->body(), notification->iconURL().string(), notification->tag(), notification-> scriptExecutionContext()->securityOrigin()->toString(), notificationID), page->pageID());140 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()); 141 141 #else 142 m_process->connection()->send(Messages::WebPageProxy::ShowNotification(notification->title(), notification->body(), notification->iconURL().string(), notification->replaceId(), notification-> scriptExecutionContext()->securityOrigin()->toString(), notificationID), page->pageID());142 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()); 143 143 #endif 144 144 return true;
Note: See TracChangeset
for help on using the changeset viewer.