w3c / geolocation

W3C Geolocation API
https://www.w3.org/TR/geolocation/
81 stars 56 forks source link

Callbacks functions don't have a handleEvent operation #24

Closed foolip closed 4 years ago

foolip commented 5 years ago

http://w3c.github.io/geolocation-api/#dom-navigatorgeolocation-getcurrentposition says:

If the attempt is successful, the successCallback MUST be invoked (i.e. the handleEvent operation MUST be called on the callback object) with a new NavigatorGeolocationPosition object, reflecting the current location of the device.

However, the type definition of the callback is:

callback PositionCallback = void (NavigatorGeolocationPosition position);

This is a https://heycam.github.io/webidl/#idl-callback-functions. The spec wording has it confused with https://heycam.github.io/webidl/#dfn-callback-interface and in particular https://dom.spec.whatwg.org/#callbackdef-eventlistener.

https://heycam.github.io/webidl/#invoke-a-callback-function is the way to invoke callback functions, and https://dom.spec.whatwg.org/#notify-mutation-observers has an example of the phrasing.