diff options
Diffstat (limited to 'Source/WebCore/Modules/notifications/Notification.idl')
-rw-r--r-- | Source/WebCore/Modules/notifications/Notification.idl | 62 |
1 files changed, 25 insertions, 37 deletions
diff --git a/Source/WebCore/Modules/notifications/Notification.idl b/Source/WebCore/Modules/notifications/Notification.idl index 6b0e14021..cb3fbee74 100644 --- a/Source/WebCore/Modules/notifications/Notification.idl +++ b/Source/WebCore/Modules/notifications/Notification.idl @@ -32,49 +32,37 @@ [ Conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS, ActiveDOMObject, - EventTarget, + ExportMacro=WEBCORE_EXPORT, #if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS - Constructor(DOMString title, [Default=Undefined] optional Dictionary options), - ConstructorCallWith=ScriptExecutionContext, + Constructor(DOMString title, optional NotificationOptions options), + ConstructorCallWith=Document, #endif -] interface Notification { +] interface Notification : EventTarget { void show(); -#if defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS - void cancel(); -#endif -#if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS - void close(); -#endif + [Conditional=LEGACY_NOTIFICATIONS, ImplementedAs=close] void cancel(); + [Conditional=NOTIFICATIONS] void close(); + [Conditional=NOTIFICATIONS, CallWith=Document] static readonly attribute DOMString permission; + [Conditional=NOTIFICATIONS, CallWith=Document] static void requestPermission(optional NotificationPermissionCallback? callback); -#if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS - [CallWith=ScriptExecutionContext] static readonly attribute DOMString permission; - [CallWith=ScriptExecutionContext] static void requestPermission(optional NotificationPermissionCallback callback); -#endif - - attribute EventListener onshow; -#if defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS - attribute EventListener ondisplay; -#endif - attribute EventListener onerror; - attribute EventListener onclose; - attribute EventListener onclick; + attribute EventHandler onclick; + attribute EventHandler onclose; + [ImplementedAs=onshow] attribute EventHandler ondisplay; + attribute EventHandler onerror; + attribute EventHandler onshow; -#if defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS - attribute DOMString dir; - attribute DOMString replaceId; -#endif -#if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS - attribute DOMString tag; -#endif + [Conditional=LEGACY_NOTIFICATIONS] attribute DOMString dir; + [Conditional=LEGACY_NOTIFICATIONS] attribute DOMString replaceId; - // EventTarget interface - void addEventListener(DOMString type, - EventListener listener, - optional boolean useCapture); - void removeEventListener(DOMString type, - EventListener listener, - optional boolean useCapture); - [RaisesException] boolean dispatchEvent(Event evt); + [Conditional=NOTIFICATIONS] attribute DOMString tag; }; +[Conditional=NOTIFICATIONS] enum NotificationDirection { "auto", "ltr", "rtl" }; + +[Conditional=NOTIFICATIONS] dictionary NotificationOptions { + NotificationDirection dir = "auto"; + DOMString lang = ""; + DOMString body = ""; + DOMString tag = ""; + DOMString icon; +}; |