Skip to content

Update to webref/[email protected] #1764

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

Merged
merged 5 commits into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,29 @@ interface AuthenticationExtensionsClientInputs {
credProps?: boolean;
hmacCreateSecret?: boolean;
minPinLength?: boolean;
prf?: AuthenticationExtensionsPRFInputs;
}

interface AuthenticationExtensionsClientOutputs {
appid?: boolean;
credProps?: CredentialPropertiesOutput;
hmacCreateSecret?: boolean;
prf?: AuthenticationExtensionsPRFOutputs;
}

interface AuthenticationExtensionsPRFInputs {
eval?: AuthenticationExtensionsPRFValues;
evalByCredential?: Record<string, AuthenticationExtensionsPRFValues>;
}

interface AuthenticationExtensionsPRFOutputs {
enabled?: boolean;
results?: AuthenticationExtensionsPRFValues;
}

interface AuthenticationExtensionsPRFValues {
first: BufferSource;
second?: BufferSource;
}

interface AuthenticatorSelectionCriteria {
Expand Down Expand Up @@ -684,16 +701,6 @@ interface InputEventInit extends UIEventInit {
targetRanges?: StaticRange[];
}

interface IntersectionObserverEntryInit {
boundingClientRect: DOMRectInit;
intersectionRatio: number;
intersectionRect: DOMRectInit;
isIntersecting: boolean;
rootBounds: DOMRectInit | null;
target: Element;
time: DOMHighResTimeStamp;
}

interface IntersectionObserverInit {
root?: Element | Document | null;
rootMargin?: string;
Expand Down Expand Up @@ -903,6 +910,7 @@ interface MediaStreamTrackEventInit extends EventInit {
interface MediaTrackCapabilities {
aspectRatio?: DoubleRange;
autoGainControl?: boolean[];
backgroundBlur?: boolean[];
channelCount?: ULongRange;
deviceId?: string;
displaySurface?: string;
Expand All @@ -920,6 +928,7 @@ interface MediaTrackCapabilities {
interface MediaTrackConstraintSet {
aspectRatio?: ConstrainDouble;
autoGainControl?: ConstrainBoolean;
backgroundBlur?: ConstrainBoolean;
channelCount?: ConstrainULong;
deviceId?: ConstrainDOMString;
displaySurface?: ConstrainDOMString;
Expand All @@ -941,6 +950,7 @@ interface MediaTrackConstraints extends MediaTrackConstraintSet {
interface MediaTrackSettings {
aspectRatio?: number;
autoGainControl?: boolean;
backgroundBlur?: boolean;
channelCount?: number;
deviceId?: string;
displaySurface?: string;
Expand All @@ -958,6 +968,7 @@ interface MediaTrackSettings {
interface MediaTrackSupportedConstraints {
aspectRatio?: boolean;
autoGainControl?: boolean;
backgroundBlur?: boolean;
channelCount?: boolean;
deviceId?: boolean;
displaySurface?: boolean;
Expand Down Expand Up @@ -8732,7 +8743,7 @@ interface FontFaceSet extends EventTarget {

declare var FontFaceSet: {
prototype: FontFaceSet;
new(initialFaces: FontFace[]): FontFaceSet;
new(): FontFaceSet;
};

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSetLoadEvent) */
Expand Down Expand Up @@ -14205,7 +14216,7 @@ interface IntersectionObserverEntry {

declare var IntersectionObserverEntry: {
prototype: IntersectionObserverEntry;
new(intersectionObserverEntryInit: IntersectionObserverEntryInit): IntersectionObserverEntry;
new(): IntersectionObserverEntry;
};

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/KHR_parallel_shader_compile) */
Expand Down Expand Up @@ -21709,7 +21720,7 @@ interface SubtleCrypto {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) */
decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) */
deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length?: number | null): Promise<ArrayBuffer>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) */
Expand Down
4 changes: 2 additions & 2 deletions baselines/serviceworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2746,7 +2746,7 @@ interface FontFaceSet extends EventTarget {

declare var FontFaceSet: {
prototype: FontFaceSet;
new(initialFaces: FontFace[]): FontFaceSet;
new(): FontFaceSet;
};

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSetLoadEvent) */
Expand Down Expand Up @@ -5028,7 +5028,7 @@ interface SubtleCrypto {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) */
decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) */
deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length?: number | null): Promise<ArrayBuffer>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) */
Expand Down
4 changes: 2 additions & 2 deletions baselines/sharedworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2635,7 +2635,7 @@ interface FontFaceSet extends EventTarget {

declare var FontFaceSet: {
prototype: FontFaceSet;
new(initialFaces: FontFace[]): FontFaceSet;
new(): FontFaceSet;
};

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSetLoadEvent) */
Expand Down Expand Up @@ -4835,7 +4835,7 @@ interface SubtleCrypto {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) */
decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) */
deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length?: number | null): Promise<ArrayBuffer>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) */
Expand Down
4 changes: 2 additions & 2 deletions baselines/webworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3012,7 +3012,7 @@ interface FontFaceSet extends EventTarget {

declare var FontFaceSet: {
prototype: FontFaceSet;
new(initialFaces: FontFace[]): FontFaceSet;
new(): FontFaceSet;
};

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSetLoadEvent) */
Expand Down Expand Up @@ -5407,7 +5407,7 @@ interface SubtleCrypto {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) */
decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) */
deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length?: number | null): Promise<ArrayBuffer>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) */
Expand Down
21 changes: 21 additions & 0 deletions inputfiles/overridingTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -3214,7 +3214,15 @@
}
}
},
"MIDIAccess": {
"exposed": "Window", // Window only on Gecko/Blink as of 2024-07
"transferable": false // Not transferable on Gecko/Blink as of 2024-07
},
"MIDIConnectionEvent": {
"exposed": "Window" // Window only on Gecko/Blink as of 2024-07
},
"MIDIInput": {
"exposed": "Window", // Window only on Gecko/Blink as of 2024-07
"events": {
"event": [
{
Expand All @@ -3224,7 +3232,20 @@
]
}
},
"MIDIInputMap": {
"exposed": "Window" // Window only on Gecko/Blink as of 2024-07
},
"MIDIMessageEvent": {
"exposed": "Window" // Window only on Gecko/Blink as of 2024-07
},
"MIDIOutput": {
"exposed": "Window" // Window only on Gecko/Blink as of 2024-07
},
"MIDIOutputMap": {
"exposed": "Window" // Window only on Gecko/Blink as of 2024-07
},
"MIDIPort": {
"exposed": "Window", // Window only on Gecko/Blink as of 2024-07
"events": {
"event": [
{
Expand Down
33 changes: 17 additions & 16 deletions inputfiles/removedTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
},
"MediaSessionAction": {
"value": [
"enterpictureinpicture", // Blink only as of 2023-10
"hangup", // Blink only as of 2022-09
"nextslide", // Blink only as of as of 2024-06
"previousslide", // Blink only as of as of 2024-06
"togglecamera", // Blink only as of 2022-09
"togglemicrophone", // Blink only as of 2022-09
"togglescreenshare" // No implementation as of 2022-09
"enterpictureinpicture", // Blink only as of 2024-07
"hangup", // Blink only as of 2024-07
"nextslide", // Blink only as of as of 2024-07
"previousslide", // Blink only as of as of 2024-07
"togglecamera", // Blink only as of 2024-07
"togglemicrophone", // Blink only as of 2024-07
"togglescreenshare", // No implementation as of 2024-07
"voiceactivity" // No implementation as of 2024-07
]
},
"RequestDestination": {
Expand Down Expand Up @@ -93,8 +94,7 @@
"CSSRule": {
"constants": {
"constant": {
"MARGIN_RULE": null, // WebKit only as of 2023-10
"VIEW_TRANSITION_RULE": null // No implementation as of 2023-10
"MARGIN_RULE": null // WebKit only as of 2023-10
}
}
},
Expand All @@ -108,6 +108,9 @@
}
}
},
"IntersectionObserverEntry": {
"constructor": null // WebKit-only as of 2024-07
},
"PaymentResponse": {
"methods": {
"method": {
Expand Down Expand Up @@ -213,9 +216,7 @@
"hmacGetSecret": null, // No implementation as of 2023-11
"largeBlob": null,
"payment": null,
"prf": null,
"supplementalPubKeys": null, // No implementation as of 2023-11
"uvm": null
"supplementalPubKeys": null // No implementation as of 2023-11
}
}
},
Expand All @@ -226,9 +227,7 @@
"appidExclude": null, // No implementation as of 2023-11
"hmacGetSecret": null, // No implementation as of 2023-11
"largeBlob": null,
"prf": null,
"supplementalPubKeys": null, // No implementation as of 2023-11
"uvm": null
"supplementalPubKeys": null // No implementation as of 2023-11
}
}
},
Expand Down Expand Up @@ -309,7 +308,9 @@
"IntersectionObserverInit": {
"members": {
"member": {
"scrollMargin": null // Blink only as of 2023-10
"delay": null, // Blink only as of 2024-07
"scrollMargin": null, // Blink only as of 2024-07
"trackVisibility": null // Blink only as of 2024-07
}
}
},
Expand Down
14 changes: 8 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 18 additions & 14 deletions src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,6 @@ async function emitDom() {
await Promise.all([...(await getWebidls()).entries()].map(convertWidl))
).filter((i) => i) as ReturnType<typeof convert>[];

const transferables = widlStandardTypes.flatMap((st) => {
return Object.values(st.browser.interfaces?.interface ?? {}).filter(
(i) => i.transferable,
);
});

addedItems.typedefs.typedef.push({
name: "Transferable",
type: [
...transferables.map((v) => ({ type: v.name })),
{ type: "ArrayBuffer" },
],
});

async function convertWidl([shortName, idl]: string[]) {
let commentsMap: Record<string, string>;
try {
Expand Down Expand Up @@ -271,6 +257,24 @@ async function emitDom() {
}
}

const transferables = Object.values(
webidl.interfaces?.interface ?? {},
).filter((i) => i.transferable);

webidl = merge(webidl, {
typedefs: {
typedef: [
{
name: "Transferable",
type: [
...transferables.map((v) => ({ type: v.name })),
{ type: "ArrayBuffer" },
],
},
],
},
});

const knownTypes = await readInputJSON("knownTypes.json");

emitFlavor(webidl, new Set(knownTypes.Window), {
Expand Down
Loading