Skip to content

Commit

Permalink
bluetooth: web: IDL fixes: Inherit EventTarget, SameObject navigator.…
Browse files Browse the repository at this point in the history
…bluetooth

These changes reflect the IDL update made in the spec:
WebBluetoothCG/web-bluetooth@8d5ed39

EventTarget is not a mixin, and so 'Implements' should not be used,
instead bluetooth should inherit from EventTarget.

Also, navigator.bluetooth should use [SameObject].

Review-Url: https://codereview.chromium.org/2616443002
Cr-Commit-Position: refs/heads/master@{#445306}
  • Loading branch information
scheib authored and Commit bot committed Jan 23, 2017
1 parent 91b05c8 commit 09b5874
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@
assert_true('bluetooth' in navigator,
'navigator.bluetooth exists.');
}, 'navigator.bluetooth IDL test');

test(() => {
assert_equals(navigator.bluetooth, navigator.bluetooth);
}, '[SameObject] test for navigator.bluetooth');
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ interface BlobEvent : Event
getter data
getter timecode
method constructor
interface Bluetooth
interface Bluetooth : EventTarget
attribute @@toStringTag
method constructor
method requestDevice
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ interface BlobEvent : Event
getter data
getter timecode
method constructor
interface Bluetooth
interface Bluetooth : EventTarget
attribute @@toStringTag
method constructor
method requestDevice
Expand Down
2 changes: 1 addition & 1 deletion third_party/WebKit/Source/modules/bluetooth/Bluetooth.idl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[
RuntimeEnabled=WebBluetooth,
] interface Bluetooth {
] interface Bluetooth : EventTarget {
[CallWith=ScriptState, RaisesException, MeasureAs=WebBluetoothRequestDevice] Promise<BluetoothDevice> requestDevice (
RequestDeviceOptions options
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
[
RuntimeEnabled=WebBluetooth,
] partial interface Navigator {
readonly attribute Bluetooth bluetooth;
[SameObject] readonly attribute Bluetooth bluetooth;
};

0 comments on commit 09b5874

Please sign in to comment.