Bug 84825 - New Notification constructor does not take security origin permissions into account
Summary: New Notification constructor does not take security origin permissions into a...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.7
: P2 Normal
Assignee: Jon Lee
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-04-24 21:52 PDT by Jon Lee
Modified: 2012-04-24 22:51 PDT (History)
3 users (show)

See Also:


Attachments
Patch (3.76 KB, patch)
2012-04-24 22:23 PDT, Jon Lee
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Lee 2012-04-24 21:52:29 PDT
Running new Notification() show the notification regardless of whether the security origin has permission to do so. It should instead be calling the onerror() callback.
Comment 1 Radar WebKit Bug Importer 2012-04-24 21:53:02 PDT
<rdar://problem/11315405>
Comment 2 Jon Lee 2012-04-24 22:23:39 PDT
Created attachment 138738 [details]
Patch
Comment 3 Darin Adler 2012-04-24 22:27:13 PDT
Comment on attachment 138738 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=138738&action=review

> Source/WebCore/ChangeLog:18
> +        (WebCore::Notification::dispatchErrorEvent): The default constructor of ErrorEvent doesn't
> +        create the proper event object. Create it using Event::create().

Is there a test showing that this was wrong?
Comment 4 Jon Lee 2012-04-24 22:49:19 PDT
(In reply to comment #3)
> (From update of attachment 138738 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=138738&action=review
> 
> > Source/WebCore/ChangeLog:18
> > +        (WebCore::Notification::dispatchErrorEvent): The default constructor of ErrorEvent doesn't
> > +        create the proper event object. Create it using Event::create().
> 
> Is there a test showing that this was wrong?

No. The only tests available are of the legacy API, which threw an exception when creating the notification, so there was no situation in which the error event got dispatched. The new behavior based on the latest draft of the spec utilizes this event.

There are a series of tasks already in bugzilla for bringing the notifications tests up to date once support for notifications is available on the mac.
Comment 5 Jon Lee 2012-04-24 22:51:55 PDT
Committed r115166: <http://trac.webkit.org/changeset/115166>