Skip to content

Commit

Permalink
Fix IDL exports for specs that use default values (#34)
Browse files Browse the repository at this point in the history
Results generated from the latest version of Reffy, which now extracts WebIDL
definitions from the main body of the spec, and not from the IDL index appendix.
  • Loading branch information
tidoust committed Jul 25, 2019
1 parent d3e2b3f commit 52f31b9
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 15 deletions.
10 changes: 10 additions & 0 deletions whatwg/idl/performance-timeline.idl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ interface PerformanceEntry {
[Default] object toJSON();
};

callback PerformanceObserverCallback = void (PerformanceObserverEntryList entries,
PerformanceObserver observer);
[Constructor(PerformanceObserverCallback callback), Exposed=(Window,Worker)]
interface PerformanceObserver {
void observe (optional PerformanceObserverInit options = {});
void disconnect ();
PerformanceEntryList takeRecords();
[SameObject] static readonly attribute FrozenArray<DOMString> supportedEntryTypes;
};

dictionary PerformanceObserverInit {
sequence<DOMString> entryTypes;
DOMString type;
Expand Down
20 changes: 20 additions & 0 deletions whatwg/idl/push-api.idl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ partial interface ServiceWorkerRegistration {
readonly attribute PushManager pushManager;
};

[Exposed=(Window,Worker), SecureContext]
interface PushManager {
[SameObject] static readonly attribute FrozenArray<DOMString> supportedContentEncodings;

Promise<PushSubscription> subscribe(optional PushSubscriptionOptionsInit options = {});
Promise<PushSubscription?> getSubscription();
Promise<PushPermissionState> permissionState(optional PushSubscriptionOptionsInit options = {});
};

[Exposed=(Window,Worker), SecureContext]
interface PushSubscriptionOptions {
readonly attribute boolean userVisibleOnly;
Expand Down Expand Up @@ -55,12 +64,23 @@ partial interface ServiceWorkerGlobalScope {
attribute EventHandler onpushsubscriptionchange;
};

[Constructor(DOMString type, optional PushEventInit eventInitDict = {}), Exposed=ServiceWorker, SecureContext]
interface PushEvent : ExtendableEvent {
readonly attribute PushMessageData? data;
};

typedef (BufferSource or USVString) PushMessageDataInit;

dictionary PushEventInit : ExtendableEventInit {
PushMessageDataInit data;
};

[Constructor(DOMString type, optional PushSubscriptionChangeEventInit eventInitDict = {}), Exposed=ServiceWorker, SecureContext]
interface PushSubscriptionChangeEvent : ExtendableEvent {
readonly attribute PushSubscription? newSubscription;
readonly attribute PushSubscription? oldSubscription;
};

dictionary PushSubscriptionChangeEventInit : ExtendableEventInit {
PushSubscription newSubscription = null;
PushSubscription oldSubscription = null;
Expand Down
30 changes: 15 additions & 15 deletions whatwg/idl/user-timing.idl
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
// Source: User Timing Level 3 (https://w3c.github.io/user-timing/)

dictionary PerformanceMarkOptions {
any detail;
DOMHighResTimeStamp startTime;
};
any detail;
DOMHighResTimeStamp startTime;
};

dictionary PerformanceMeasureOptions {
any detail;
(DOMString or DOMHighResTimeStamp) start;
DOMHighResTimeStamp duration;
(DOMString or DOMHighResTimeStamp) end;
};
dictionary PerformanceMeasureOptions {
any detail;
(DOMString or DOMHighResTimeStamp) start;
DOMHighResTimeStamp duration;
(DOMString or DOMHighResTimeStamp) end;
};

partial interface Performance {
PerformanceMark mark(DOMString markName, optional PerformanceMarkOptions markOptions = {});
void clearMarks(optional DOMString markName);
PerformanceMeasure measure(DOMString measureName, optional (DOMString or PerformanceMeasureOptions) startOrMeasureOptions = {}, optional DOMString endMark);
void clearMeasures(optional DOMString measureName);
};
partial interface Performance {
PerformanceMark mark(DOMString markName, optional PerformanceMarkOptions markOptions = {});
void clearMarks(optional DOMString markName);
PerformanceMeasure measure(DOMString measureName, optional (DOMString or PerformanceMeasureOptions) startOrMeasureOptions = {}, optional DOMString endMark);
void clearMeasures(optional DOMString measureName);
};

[Exposed=(Window,Worker),
Constructor(DOMString markName, optional PerformanceMarkOptions markOptions)]
Expand Down
6 changes: 6 additions & 0 deletions whatwg/idl/wake-lock.idl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ dictionary WakeLockPermissionDescriptor : PermissionDescriptor {

enum WakeLockType { "screen", "system" };

[SecureContext, Exposed=(DedicatedWorker, Window)]
interface WakeLock {
[Exposed=Window] static Promise<PermissionState> requestPermission(WakeLockType type);
static Promise<void> request(WakeLockType type, optional WakeLockRequestOptions options = {});
};

dictionary WakeLockRequestOptions {
AbortSignal signal;
};
36 changes: 36 additions & 0 deletions whatwg/idl/web-nfc.idl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,42 @@ enum NDEFRecordType {
"opaque"
};

typedef (DOMString or ArrayBuffer or NDEFMessageInit) NDEFMessageSource;

[Constructor(), SecureContext, Exposed=Window]
interface NFCWriter {
Promise<void> push(NDEFMessageSource message, optional NFCPushOptions options={});
};

[Constructor(optional NFCReaderOptions options={}), SecureContext, Exposed=Window]
interface NFCReader : EventTarget {
attribute EventHandler onreading;
attribute EventHandler onerror;

void start();
void stop();
};

[Constructor(DOMString type, NFCReadingEventInit readingEventInitDict), SecureContext, Exposed=Window]
interface NFCReadingEvent : Event {
readonly attribute DOMString serialNumber;
[SameObject] readonly attribute NDEFMessage message;
};

dictionary NFCReadingEventInit : EventInit {
DOMString? serialNumber = "";
required NDEFMessageInit message;
};

[Constructor(DOMString type, NFCErrorEventInit errorEventInitDict), SecureContext, Exposed=Window]
interface NFCErrorEvent : Event {
readonly attribute DOMException error;
};

dictionary NFCErrorEventInit : EventInit {
required DOMException error;
};

enum NDEFCompatibility {
"nfc-forum",
"vendor",
Expand Down
4 changes: 4 additions & 0 deletions whatwg/idl/web-share.idl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// (https://github.com/tidoust/reffy-reports)
// Source: Web Share API - Level 1 (https://wicg.github.io/web-share/)

partial interface Navigator {
[SecureContext] Promise<void> share(optional ShareData data = {});
};

dictionary ShareData {
USVString title;
USVString text;
Expand Down

0 comments on commit 52f31b9

Please sign in to comment.