W3C home > Mailing lists > Public > public-web-bluetooth-log@w3.org > October 2016

Re: [web-bluetooth] Add [SameObject] extended attribute to bluetooth

From: François Beaufort via GitHub <sysbot+gh@w3.org>
Date: Tue, 25 Oct 2016 08:34:03 +0000
To: public-web-bluetooth-log@w3.org
Message-ID: <issue_comment.created-255972070-1477384439-sysbot+gh@w3.org>
`[SameObject]` is used as well in 
https://chromium.googlesource.com/chromium/src/+/master/third_party/WebKit/Source/modules/mediastream/NavigatorUserMedia.idl
 and 
https://chromium.googlesource.com/chromium/src/+/master/third_party/WebKit/Source/modules/webusb/USBConnectionEvent.idl

```js
partial interface Navigator {
    [SameObject] readonly attribute MediaDevices mediaDevices;
};
```

```js
[
    Constructor(DOMString type, USBConnectionEventInit eventInitDict),
    OriginTrialEnabled=WebUSB,
] interface USBConnectionEvent : Event {
    [SameObject] readonly attribute USBDevice device;
};
```

So how about adding it to `referringDevice`?

```diff
interface Bluetooth {
  [SecureContext]
  Promise<boolean> getAvailability();
  [SecureContext]
  attribute EventHandler onavailabilitychanged;
  [SecureContext]
-  readonly attribute BluetoothDevice? referringDevice;
+  [SameObject] readonly attribute BluetoothDevice? referringDevice;
  [SecureContext]
  Promise<BluetoothDevice> requestDevice(optional RequestDeviceOptions
 options);
};

-- 
GitHub Notification of comment by beaufortfrancois
Please view or discuss this issue at 
https://github.com/WebBluetoothCG/web-bluetooth/pull/318#issuecomment-255972070
 using your GitHub account
Received on Tuesday, 25 October 2016 08:34:12 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 25 October 2016 08:34:13 UTC