w3c / geolocation

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

Error when method are called on not fully active docs #96

Closed marcoscaceres closed 3 years ago

marcoscaceres commented 3 years ago

Speaking to @saschanaz, they suggested that watchPosition() and getCurrentPosition() should invoke the error callbacks if the document is not fully active.

This makes sense in particular for promise-wrapped code, which would otherwise get stuck.

// current spec, this doesn't proceed in the odd case where the geo 
// object is from a non-fully active doc. 
await new Promise((res, rej) => geo.getCurrentPosition(res, rej));
marcoscaceres commented 3 years ago

Sent https://github.com/w3c/geolocation-api/pull/97