From 7581057d66226104c08994301c8229fc5330915e Mon Sep 17 00:00:00 2001 From: Bashamega Date: Fri, 26 Dec 2025 20:18:06 +0200 Subject: [PATCH] Migrate StructuredSerializeOptions --- inputfiles/knownTypes.json | 3 --- inputfiles/overridingTypes.jsonc | 9 --------- inputfiles/patches/html.kdl | 8 ++++++++ src/build/patches.ts | 7 ++++--- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/inputfiles/knownTypes.json b/inputfiles/knownTypes.json index d0ba44099..df1b8cda5 100644 --- a/inputfiles/knownTypes.json +++ b/inputfiles/knownTypes.json @@ -61,7 +61,6 @@ "RTCStatsIceCandidatePairState", "RTCStatsType", "RTCTransportStats", - "Transferable", "ValueTypeMap", "VideoFacingModeEnum" ], @@ -91,12 +90,10 @@ "RsaKeyGenParams", "RsaOaepParams", "RsaPssParams", - "Transferable", "ValueTypeMap" ], "Worklet": [ "EventListenerOrEventListenerObject", - "Transferable", "ValueTypeMap" ] } diff --git a/inputfiles/overridingTypes.jsonc b/inputfiles/overridingTypes.jsonc index 27ae7ec0d..d12f91d58 100644 --- a/inputfiles/overridingTypes.jsonc +++ b/inputfiles/overridingTypes.jsonc @@ -3319,15 +3319,6 @@ }, "dictionaries": { "dictionary": { - "StructuredSerializeOptions": { - "members": { - "member": { - "transfer": { - "overrideType": "Transferable[]" - } - } - } - }, "MessageEventInit": { "members": { "member": { diff --git a/inputfiles/patches/html.kdl b/inputfiles/patches/html.kdl index 4e2bef63c..d3fa04d2f 100644 --- a/inputfiles/patches/html.kdl +++ b/inputfiles/patches/html.kdl @@ -20,6 +20,14 @@ interface HTMLImageElement { property loading overrideType=#""eager" | "lazy""# } +dictionary StructuredSerializeOptions { + member transfer { + type { + type Transferable + } + } +} + removals { dictionary CanvasRenderingContext2DSettings { member colorType // Blink-only as of 2025-12, being tested in WebKit diff --git a/src/build/patches.ts b/src/build/patches.ts index eea32a0de..8bc4351d6 100644 --- a/src/build/patches.ts +++ b/src/build/patches.ts @@ -374,7 +374,7 @@ function handleMethodAndConstructor( */ function handleDictionary(child: Node): DeepPartial { const name = string(child.values[0]); - const member: Record> = {}; + const member: Record> = {}; let typeParameters = {}; for (const c of child.children) { @@ -411,11 +411,12 @@ function handleDictionary(child: Node): DeepPartial { * Handles dictionary member nodes * @param c The member node to handle. */ -function handleMember(c: Node): Partial { +function handleMember(c: Node): DeepPartial { const name = string(c.values[0]); + const typeNodes = c.children.filter((c) => c.name === "type"); return { name, - ...optionalMember("type", "string", c.properties?.type), + ...handleTyped(typeNodes, c.properties?.type), ...optionalMember("required", "boolean", c.properties?.required), ...optionalMember("deprecated", "string", c.properties?.deprecated), ...optionalMember("overrideType", "string", c.properties?.overrideType),