-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename NavigatorGeolocation* interfaces to Geolocation* #23
Conversation
They were prefixed in #20 when removing [NoInterfaceObject], to avoid polluting the global namespace with generic interface names. However, no other specs that add an object to navigator prefix the interface name with Navigator. Examples: https://storage.spec.whatwg.org/#api https://w3c.github.io/clipboard-apis/#navigator-interface https://w3c.github.io/keyboard-lock/#navigator-interface https://w3c.github.io/permissions/#navigator-and-workernavigator-extension https://w3c.github.io/presentation-api/#interface-presentation https://w3c.github.io/webappsec-credential-management/#framework-credential-management https://wicg.github.io/media-capabilities/#navigators-extensions https://wicg.github.io/mediasession/#the-mediasession-interface https://wicg.github.io/netinfo/#navigatornetworkinformation-interface
I found the examples from a merging of all IDL from all specs. Here's the raw text I was looking at for some more examples: [Exposed=Window]
interface Navigator {
Promise<BatteryManager> getBattery();
boolean sendBeacon(USVString url, optional BodyInit? data = null);
[SecureContext, SameObject] readonly attribute Clipboard clipboard;
[SecureContext, SameObject] readonly attribute CredentialsContainer credentials;
[SecureContext] Promise<MediaKeySystemAccess> requestMediaKeySystemAccess(DOMString keySystem,
sequence<MediaKeySystemConfiguration> supportedConfigurations);
sequence<Gamepad?> getGamepads();
readonly attribute Geolocation geolocation;
[SecureContext, SameObject] readonly attribute Keyboard keyboard;
[SecureContext, SameObject] readonly attribute Keyboard keyboard;
[SameObject] readonly attribute MediaCapabilities mediaCapabilities;
[SameObject, SecureContext]
readonly attribute MediaDevices mediaDevices;
[SecureContext]
void getUserMedia(MediaStreamConstraints constraints, NavigatorUserMediaSuccessCallback successCallback, NavigatorUserMediaErrorCallback errorCallback);
[SameObject] readonly attribute MediaSession mediaSession;
readonly attribute Permissions permissions;
readonly attribute long maxTouchPoints;
[SecureContext, SameObject] readonly attribute Presentation presentation;
[SecureContext, SameObject] readonly attribute ServiceWorkerContainer serviceWorker;
boolean vibrate(VibratePattern pattern);
[SecureContext] Promise<WakeLock> getWakeLock(WakeLockType type);
[SameObject]
readonly attribute Bluetooth bluetooth;
[SecureContext] Promise<void> share(optional ShareData data);
[SecureContext] Promise<MIDIAccess> requestMIDIAccess(optional MIDIOptions options);
[SameObject] readonly attribute USB usb;
[SameObject] readonly attribute XR xr;
readonly attribute DOMString appCodeName; // constant "Mozilla"
readonly attribute DOMString appName; // constant "Netscape"
readonly attribute DOMString appVersion;
readonly attribute DOMString platform;
readonly attribute DOMString product; // constant "Gecko"
[Exposed=Window] readonly attribute DOMString productSub;
readonly attribute DOMString userAgent;
[Exposed=Window] readonly attribute DOMString vendor;
[Exposed=Window] readonly attribute DOMString vendorSub;
[Exposed=Window] boolean taintEnabled(); // constant false
[Exposed=Window] readonly attribute DOMString oscpu;
readonly attribute DOMString language;
readonly attribute FrozenArray<DOMString> languages;
readonly attribute boolean onLine;
void registerProtocolHandler(DOMString scheme, USVString url, DOMString title);
void unregisterProtocolHandler(DOMString scheme, USVString url);
readonly attribute boolean cookieEnabled;
[SameObject] readonly attribute PluginArray plugins;
[SameObject] readonly attribute MimeTypeArray mimeTypes;
boolean javaEnabled();
readonly attribute unsigned long long hardwareConcurrency;
readonly attribute NetworkInformation connection;
readonly attribute StorageManager storage;
readonly attribute boolean webdriver;
// objects implementing this interface also implement the interfaces given below
};
|
As a drive-by I added [SameObject] and sent PRs to other specs too: |
@foolip, thanks for paying attention to these details. This was discussed in #19 and the summary that motivated the proposal seems to be:
I'd like to hear what others think? This might not be a huge ergonomic issue, but is nice to get right. |
@inexorabletash also pointed out to me that |
Correction: |
FWIW, the canonical incantation is (I mis-typed in chat, sorry!) |
Right, given an instance it is possible to get the prototype and the interface object event if the interface object isn't exposed. To take an example of an interface which is exposed, I think the risks are quite low of a rename, but you can always search httparchive for the old names of the interfaces to get an idea. Avoiding a common prefix with Maybe the best tradeoff is to just not expose the interfaces, thereby also avoiding #25? |
It's not clear to me |
I am okay with merging this. It also resolves an issue I discovered when implementing this in Chromium where some systems might be depending on the old name of the Given that |
I find @annevk’s arguments reasonable. Also considering Sensor subclasses only expose constructors limits clash potential. Let’s merge this unless someone shouts. |
@reillyeon, no concerns raised, so please feel free to merge this PR at will and coordinate with Blink's Intent to Implement and Ship. Thanks everyone for your comments and @foolip for taking an action. |
This change renames the following interfaces and removes the [NoInterfaceObject] annotation so that these types are now exposed to script: Coordinates -> GeolocationCoordinates Position -> GeolocationPosition PositionError -> GeolocationPositionError This is done in response to an effort to remove this annotation from WebIDL. Spec pull requests (merged): w3c/geolocation#20 w3c/geolocation#23 Intent to Ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/Xig9oewsQMA/eyC7dbtiAAAJ Bug: 931847 Change-Id: I38d0172afc33d5757b664e2807356d8727e82d7f
This change renames the following interfaces and removes the [NoInterfaceObject] annotation so that these types are now exposed to script: Coordinates -> GeolocationCoordinates Position -> GeolocationPosition PositionError -> GeolocationPositionError This is done in response to an effort to remove this annotation from WebIDL. Spec pull requests (merged): w3c/geolocation#20 w3c/geolocation#23 Intent to Ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/Xig9oewsQMA/eyC7dbtiAAAJ Bug: 931847 Change-Id: I38d0172afc33d5757b664e2807356d8727e82d7f
This change renames the following interfaces and removes the [NoInterfaceObject] annotation so that these types are now exposed to script: Coordinates -> GeolocationCoordinates Position -> GeolocationPosition PositionError -> GeolocationPositionError This is done in response to an effort to remove this annotation from WebIDL. Spec pull requests (merged): w3c/geolocation#20 w3c/geolocation#23 Intent to Ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/Xig9oewsQMA/eyC7dbtiAAAJ Bug: 931847 Change-Id: I38d0172afc33d5757b664e2807356d8727e82d7f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1471230 Commit-Queue: Reilly Grant <[email protected]> Reviewed-by: Yoav Weiss <[email protected]> Cr-Commit-Position: refs/heads/master@{#695573}
…ve [NoInterfaceObject], a=testonly Automatic update from web-platform-tests [geolocation] Rename interfaces and remove [NoInterfaceObject] This change renames the following interfaces and removes the [NoInterfaceObject] annotation so that these types are now exposed to script: Coordinates -> GeolocationCoordinates Position -> GeolocationPosition PositionError -> GeolocationPositionError This is done in response to an effort to remove this annotation from WebIDL. Spec pull requests (merged): w3c/geolocation#20 w3c/geolocation#23 Intent to Ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/Xig9oewsQMA/eyC7dbtiAAAJ Bug: 931847 Change-Id: I38d0172afc33d5757b664e2807356d8727e82d7f -- wpt-commits: 99a9f0b73bd0ac3a739dfe2157b93578b760ed5d wpt-pr: 18989
…ve [NoInterfaceObject], a=testonly Automatic update from web-platform-tests [geolocation] Rename interfaces and remove [NoInterfaceObject] This change renames the following interfaces and removes the [NoInterfaceObject] annotation so that these types are now exposed to script: Coordinates -> GeolocationCoordinates Position -> GeolocationPosition PositionError -> GeolocationPositionError This is done in response to an effort to remove this annotation from WebIDL. Spec pull requests (merged): w3c/geolocation#20 w3c/geolocation#23 Intent to Ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/Xig9oewsQMA/eyC7dbtiAAAJ Bug: 931847 Change-Id: I38d0172afc33d5757b664e2807356d8727e82d7f -- wpt-commits: 99a9f0b73bd0ac3a739dfe2157b93578b760ed5d wpt-pr: 18989
…ve [NoInterfaceObject], a=testonly Automatic update from web-platform-tests [geolocation] Rename interfaces and remove [NoInterfaceObject] This change renames the following interfaces and removes the [NoInterfaceObject] annotation so that these types are now exposed to script: Coordinates -> GeolocationCoordinates Position -> GeolocationPosition PositionError -> GeolocationPositionError This is done in response to an effort to remove this annotation from WebIDL. Spec pull requests (merged): w3c/geolocation#20 w3c/geolocation#23 Intent to Ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/Xig9oewsQMA/eyC7dbtiAAAJ Bug: 931847 Change-Id: I38d0172afc33d5757b664e2807356d8727e82d7f -- wpt-commits: 99a9f0b73bd0ac3a739dfe2157b93578b760ed5d wpt-pr: 18989 UltraBlame original commit: d9416fbe9cef4320251f42861d2fd7dbf1bffe18
…ve [NoInterfaceObject], a=testonly Automatic update from web-platform-tests [geolocation] Rename interfaces and remove [NoInterfaceObject] This change renames the following interfaces and removes the [NoInterfaceObject] annotation so that these types are now exposed to script: Coordinates -> GeolocationCoordinates Position -> GeolocationPosition PositionError -> GeolocationPositionError This is done in response to an effort to remove this annotation from WebIDL. Spec pull requests (merged): w3c/geolocation#20 w3c/geolocation#23 Intent to Ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/Xig9oewsQMA/eyC7dbtiAAAJ Bug: 931847 Change-Id: I38d0172afc33d5757b664e2807356d8727e82d7f -- wpt-commits: 99a9f0b73bd0ac3a739dfe2157b93578b760ed5d wpt-pr: 18989 UltraBlame original commit: d9416fbe9cef4320251f42861d2fd7dbf1bffe18
…ve [NoInterfaceObject], a=testonly Automatic update from web-platform-tests [geolocation] Rename interfaces and remove [NoInterfaceObject] This change renames the following interfaces and removes the [NoInterfaceObject] annotation so that these types are now exposed to script: Coordinates -> GeolocationCoordinates Position -> GeolocationPosition PositionError -> GeolocationPositionError This is done in response to an effort to remove this annotation from WebIDL. Spec pull requests (merged): w3c/geolocation#20 w3c/geolocation#23 Intent to Ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/Xig9oewsQMA/eyC7dbtiAAAJ Bug: 931847 Change-Id: I38d0172afc33d5757b664e2807356d8727e82d7f -- wpt-commits: 99a9f0b73bd0ac3a739dfe2157b93578b760ed5d wpt-pr: 18989 UltraBlame original commit: d9416fbe9cef4320251f42861d2fd7dbf1bffe18
Landed in gecko: https://bugzilla.mozilla.org/show_bug.cgi?id=1575144 |
Thank you all! To summarize, this is now fixed in all major engines:
|
w3c/geolocation#23 removed the Navigator* prefix from the NavigatorGeolocation interface. w3c/geolocation@26226b5
* Deprecate NavigatorGeolocation w3c/geolocation#23 removed the Navigator* prefix from the NavigatorGeolocation interface. w3c/geolocation@26226b5 * Drop NavigatorGeolocation (rather than deprecate) See #5606 (comment)
They were prefixed in #20
when removing [NoInterfaceObject], to avoid polluting the global
namespace with generic interface names.
However, no other specs that add an object to navigator prefix the
interface name with Navigator. Examples:
https://storage.spec.whatwg.org/#api
https://w3c.github.io/clipboard-apis/#navigator-interface
https://w3c.github.io/keyboard-lock/#navigator-interface
https://w3c.github.io/permissions/#navigator-and-workernavigator-extension
https://w3c.github.io/presentation-api/#interface-presentation
https://w3c.github.io/webappsec-credential-management/#framework-credential-management
https://wicg.github.io/media-capabilities/#navigators-extensions
https://wicg.github.io/mediasession/#the-mediasession-interface
https://wicg.github.io/netinfo/#navigatornetworkinformation-interface