Re: A new hack for singleton objects

On 3/18/15 9:21 AM, Anne van Kesteren wrote:
> On Wed, Mar 18, 2015 at 2:11 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
>> As currently defined, Notification.requestPermission uses the origin of
>> "wherever script was entered" (entry settings object's origin).  See
>> <https://notifications.spec.whatwg.org/#dom-notification-requestpermission>.
>> I personally consider this sort of action-at-a-distance very broken, but
>> some spec editors seem to think that because UAs do it for some things (e.g.
>> Location) we should do it for everything.  :(
>
> Being the editor, I don't think that's true.

To be clear, I don't think you're one of "some spec editors".

> We lack some clear terminology and principles around globals and origins which is why
> they continue to be a mess. As you know I've filed various bugs on
> both HTML and IDL to get this cleared up, but not much progress to
> date. Given how the Notifications API is not really widely deployed
> yet, I'm sure we can change this. What would you suggest it says?

It'd make the most sense to me personally to use the origin of the 
global of the Realm of the requestPermission function.

Except of course the HTML spec pretends like globals don't have origins, 
which is also singularly unhelpful....

-Boris

Received on Wednesday, 18 March 2015 13:30:17 UTC