From 080063a492ee018726c2621e34abfa8d627dad75 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sat, 7 Sep 2024 22:02:50 -0700 Subject: [PATCH] Add IDL for several missing features (#1795) --- custom/idl/WebGPU.idl | 10 ++++++++++ custom/idl/cssom.idl | 7 +++++++ custom/idl/font-loading.idl | 6 ++++++ custom/idl/html.idl | 6 ++++++ custom/idl/ink-presenter.idl | 5 +++++ custom/idl/invokers.idl | 13 +++++++++++++ custom/idl/mediacapture.idl | 3 +++ custom/idl/offscreen-canvas.idl | 3 +++ custom/idl/shared-storage.idl | 26 ++++++++++++++++++++++++++ test-builder/api.ts | 5 ++++- 10 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 custom/idl/ink-presenter.idl create mode 100644 custom/idl/invokers.idl create mode 100644 custom/idl/mediacapture.idl create mode 100644 custom/idl/offscreen-canvas.idl create mode 100644 custom/idl/shared-storage.idl diff --git a/custom/idl/WebGPU.idl b/custom/idl/WebGPU.idl index 2f9dc4240..fa38ce0ee 100644 --- a/custom/idl/WebGPU.idl +++ b/custom/idl/WebGPU.idl @@ -10,3 +10,13 @@ partial interface GPUComputePassEncoder { partial interface GPURenderPassEncoder { undefined writeTimestamp(); }; + +// Removed from the spec + +partial interface GPUAdapter { + undefined requestAdapterInfo(); +}; + +partial interface GPUSupportedLimits { + attribute long maxInterStageShaderComponents; +}; diff --git a/custom/idl/cssom.idl b/custom/idl/cssom.idl index 92229b977..4cada7540 100644 --- a/custom/idl/cssom.idl +++ b/custom/idl/cssom.idl @@ -93,3 +93,10 @@ partial interface Document { readonly attribute FrozenArray styleSheetSets; undefined enableStyleSheetsForSet(DOMString? name); }; + +// Moved to CSSStyleProperties in spec, but has not yet been moved in browser implementations + +[Exposed=Window] +partial interface CSSStyleDeclaration { + [CEReactions] attribute [LegacyNullToEmptyString] CSSOMString cssFloat; +}; diff --git a/custom/idl/font-loading.idl b/custom/idl/font-loading.idl index f8362599e..6fd43e8b0 100644 --- a/custom/idl/font-loading.idl +++ b/custom/idl/font-loading.idl @@ -3,3 +3,9 @@ partial interface FontFace { attribute CSSOMString variant; }; + +// Non-standard + +partial interface FontFaceSet { + constructor(); +}; diff --git a/custom/idl/html.idl b/custom/idl/html.idl index 76d8e60a7..0c15c1efc 100644 --- a/custom/idl/html.idl +++ b/custom/idl/html.idl @@ -273,3 +273,9 @@ partial interface HTMLMediaElement { partial interface HTMLAnchorElement { [CEReactions]attribute DOMString hrefTranslate; }; + +// Non-standard + +partial interface HTMLElement { + attribute HTMLAnchorElement anchorElement; +}; diff --git a/custom/idl/ink-presenter.idl b/custom/idl/ink-presenter.idl new file mode 100644 index 000000000..1bdaa9f4b --- /dev/null +++ b/custom/idl/ink-presenter.idl @@ -0,0 +1,5 @@ +// Removed from the spec + +partial interface InkPresenter { + attribute boolean expectedImprovement; +}; diff --git a/custom/idl/invokers.idl b/custom/idl/invokers.idl new file mode 100644 index 000000000..1f74f193c --- /dev/null +++ b/custom/idl/invokers.idl @@ -0,0 +1,13 @@ +// https://github.com/whatwg/html/pull/9841 -- renamed to command attributes + +partial interface HTMLButtonElement { + attribute DOMString invokeaction; + attribute DOMString invoketarget; +}; + +[Exposed=Window] +interface InvokeEvent { + constructor(); + attribute DOMString invoker; + attribute DOMString action; +}; diff --git a/custom/idl/mediacapture.idl b/custom/idl/mediacapture.idl new file mode 100644 index 000000000..061d02460 --- /dev/null +++ b/custom/idl/mediacapture.idl @@ -0,0 +1,3 @@ +partial interface Navigator { + undefined getUserMedia(); +}; diff --git a/custom/idl/offscreen-canvas.idl b/custom/idl/offscreen-canvas.idl new file mode 100644 index 000000000..c12cd4494 --- /dev/null +++ b/custom/idl/offscreen-canvas.idl @@ -0,0 +1,3 @@ +partial interface OffscreenCanvasRenderingContext2D { + undefined commit(); +}; diff --git a/custom/idl/shared-storage.idl b/custom/idl/shared-storage.idl new file mode 100644 index 000000000..fc37d71e0 --- /dev/null +++ b/custom/idl/shared-storage.idl @@ -0,0 +1,26 @@ +// Removed from the spec + +[Exposed=Window] +interface SharedStorageOperation {}; + +[Exposed=Window] +interface SharedStorageRunOperation { + attribute any run; +}; + +[Exposed=Window] +interface SharedStorageSelectURLOperation { + attribute any run; +}; + +[Exposed=Window] +interface WindowSharedStorage { + attribute SharedStorageRunOperation run; + attribute SharedStorageSelectURLOperation selectURL; + attribute WorkletSharedStorage worklet; +}; + +[Exposed=Window] +interface WorkletSharedStorage { + maplike; +}; diff --git a/test-builder/api.ts b/test-builder/api.ts index bd6976b99..868c0c5b5 100644 --- a/test-builder/api.ts +++ b/test-builder/api.ts @@ -23,7 +23,10 @@ const mergeMembers = (target, source) => { const targetMembers = new Set(target.members.map((m) => m.name)); const sourceMembers = new Set(); for (const member of source.members) { - if (targetMembers.has(member.name)) { + if (!member.name) { + // Constructors and other nameless members should just be added + sourceMembers.add(member); + } else if (targetMembers.has(member.name)) { const targetMember = target.members.find((m) => m.name); // Static members may have the same name as a non-static member. // If target has static member with same name, remove from target.