diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index a6556cb39..7895a1662 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -2751,6 +2751,10 @@ interface SerialPortRequestOptions { filters?: SerialPortFilter[]; } +interface SetHTMLOptions { + sanitizer?: Sanitizer | SanitizerConfig | SanitizerPresets; +} + interface ShadowRootInit { clonable?: boolean; customElementRegistry?: CustomElementRegistry | null; @@ -14142,6 +14146,12 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, NonDocumentTyp * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) */ setAttributeNodeNS(attr: Attr): Attr | null; + /** + * The **`setHTML()`** method of the Element interface provides an XSS-safe method to parse and sanitize a string of HTML and insert it into the DOM as a subtree of the element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setHTML) + */ + setHTML(html: string, options?: SetHTMLOptions): void; /** * The **`setHTMLUnsafe()`** method of the Element interface is used to parse HTML input into a DocumentFragment, optionally filtering out unwanted elements and attributes, and those that don't belong in the context, and then using it to replace the element's subtree in the DOM. * @@ -17987,7 +17997,7 @@ interface HTMLElementEventMap extends ElementEventMap, GlobalEventHandlersEventM * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement) */ -interface HTMLElement extends Element, ElementCSSInlineStyle, ElementContentEditable, GlobalEventHandlers, HTMLOrSVGElement { +interface HTMLElement extends Element, ElementCSSInlineStyle, ElementContentEditable, GlobalEventHandlers, HTMLOrSVGElement, HTMLOrSVGOrMathMLElement { /** * The **`HTMLElement.accessKey`** property sets the keystroke which a user can press to jump to a given element. * @@ -20312,7 +20322,10 @@ declare var HTMLOptionsCollection: { new(): HTMLOptionsCollection; }; -interface HTMLOrSVGElement { +interface HTMLOrSVGElement extends HTMLOrSVGOrMathMLElement { +} + +interface HTMLOrSVGOrMathMLElement { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/autofocus) */ autofocus: boolean; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/dataset) */ @@ -24036,7 +24049,7 @@ interface MathMLElementEventMap extends ElementEventMap, GlobalEventHandlersEven * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MathMLElement) */ -interface MathMLElement extends Element, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGElement { +interface MathMLElement extends Element, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGOrMathMLElement { addEventListener(type: K, listener: (this: MathMLElement, ev: MathMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MathMLElement, ev: MathMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -26033,6 +26046,7 @@ declare var NavigationPreloadManager: { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition) */ interface NavigationTransition { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition/committed) */ readonly committed: Promise; /** * The **`finished`** read-only property of the NavigationTransition interface returns a Promise that fulfills at the same time the navigatesuccess event fires, or rejects at the same time the navigateerror event fires. @@ -31828,7 +31842,7 @@ interface SVGElementEventMap extends ElementEventMap, GlobalEventHandlersEventMa * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGElement) */ -interface SVGElement extends Element, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGElement { +interface SVGElement extends Element, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGElement, HTMLOrSVGOrMathMLElement { /** @deprecated */ readonly className: any; /** diff --git a/baselines/ts5.5/dom.generated.d.ts b/baselines/ts5.5/dom.generated.d.ts index e1e2ad25d..760d5f162 100644 --- a/baselines/ts5.5/dom.generated.d.ts +++ b/baselines/ts5.5/dom.generated.d.ts @@ -2748,6 +2748,10 @@ interface SerialPortRequestOptions { filters?: SerialPortFilter[]; } +interface SetHTMLOptions { + sanitizer?: Sanitizer | SanitizerConfig | SanitizerPresets; +} + interface ShadowRootInit { clonable?: boolean; customElementRegistry?: CustomElementRegistry | null; @@ -14129,6 +14133,12 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, NonDocumentTyp * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) */ setAttributeNodeNS(attr: Attr): Attr | null; + /** + * The **`setHTML()`** method of the Element interface provides an XSS-safe method to parse and sanitize a string of HTML and insert it into the DOM as a subtree of the element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setHTML) + */ + setHTML(html: string, options?: SetHTMLOptions): void; /** * The **`setHTMLUnsafe()`** method of the Element interface is used to parse HTML input into a DocumentFragment, optionally filtering out unwanted elements and attributes, and those that don't belong in the context, and then using it to replace the element's subtree in the DOM. * @@ -17971,7 +17981,7 @@ interface HTMLElementEventMap extends ElementEventMap, GlobalEventHandlersEventM * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement) */ -interface HTMLElement extends Element, ElementCSSInlineStyle, ElementContentEditable, GlobalEventHandlers, HTMLOrSVGElement { +interface HTMLElement extends Element, ElementCSSInlineStyle, ElementContentEditable, GlobalEventHandlers, HTMLOrSVGElement, HTMLOrSVGOrMathMLElement { /** * The **`HTMLElement.accessKey`** property sets the keystroke which a user can press to jump to a given element. * @@ -20291,7 +20301,10 @@ declare var HTMLOptionsCollection: { new(): HTMLOptionsCollection; }; -interface HTMLOrSVGElement { +interface HTMLOrSVGElement extends HTMLOrSVGOrMathMLElement { +} + +interface HTMLOrSVGOrMathMLElement { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/autofocus) */ autofocus: boolean; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/dataset) */ @@ -24012,7 +24025,7 @@ interface MathMLElementEventMap extends ElementEventMap, GlobalEventHandlersEven * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MathMLElement) */ -interface MathMLElement extends Element, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGElement { +interface MathMLElement extends Element, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGOrMathMLElement { addEventListener(type: K, listener: (this: MathMLElement, ev: MathMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MathMLElement, ev: MathMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -26009,6 +26022,7 @@ declare var NavigationPreloadManager: { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition) */ interface NavigationTransition { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition/committed) */ readonly committed: Promise; /** * The **`finished`** read-only property of the NavigationTransition interface returns a Promise that fulfills at the same time the navigatesuccess event fires, or rejects at the same time the navigateerror event fires. @@ -31803,7 +31817,7 @@ interface SVGElementEventMap extends ElementEventMap, GlobalEventHandlersEventMa * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGElement) */ -interface SVGElement extends Element, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGElement { +interface SVGElement extends Element, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGElement, HTMLOrSVGOrMathMLElement { /** @deprecated */ readonly className: any; /** diff --git a/baselines/ts5.6/dom.generated.d.ts b/baselines/ts5.6/dom.generated.d.ts index be2edd668..f62c5468e 100644 --- a/baselines/ts5.6/dom.generated.d.ts +++ b/baselines/ts5.6/dom.generated.d.ts @@ -2748,6 +2748,10 @@ interface SerialPortRequestOptions { filters?: SerialPortFilter[]; } +interface SetHTMLOptions { + sanitizer?: Sanitizer | SanitizerConfig | SanitizerPresets; +} + interface ShadowRootInit { clonable?: boolean; customElementRegistry?: CustomElementRegistry | null; @@ -14139,6 +14143,12 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, NonDocumentTyp * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) */ setAttributeNodeNS(attr: Attr): Attr | null; + /** + * The **`setHTML()`** method of the Element interface provides an XSS-safe method to parse and sanitize a string of HTML and insert it into the DOM as a subtree of the element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setHTML) + */ + setHTML(html: string, options?: SetHTMLOptions): void; /** * The **`setHTMLUnsafe()`** method of the Element interface is used to parse HTML input into a DocumentFragment, optionally filtering out unwanted elements and attributes, and those that don't belong in the context, and then using it to replace the element's subtree in the DOM. * @@ -17984,7 +17994,7 @@ interface HTMLElementEventMap extends ElementEventMap, GlobalEventHandlersEventM * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement) */ -interface HTMLElement extends Element, ElementCSSInlineStyle, ElementContentEditable, GlobalEventHandlers, HTMLOrSVGElement { +interface HTMLElement extends Element, ElementCSSInlineStyle, ElementContentEditable, GlobalEventHandlers, HTMLOrSVGElement, HTMLOrSVGOrMathMLElement { /** * The **`HTMLElement.accessKey`** property sets the keystroke which a user can press to jump to a given element. * @@ -20309,7 +20319,10 @@ declare var HTMLOptionsCollection: { new(): HTMLOptionsCollection; }; -interface HTMLOrSVGElement { +interface HTMLOrSVGElement extends HTMLOrSVGOrMathMLElement { +} + +interface HTMLOrSVGOrMathMLElement { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/autofocus) */ autofocus: boolean; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/dataset) */ @@ -24033,7 +24046,7 @@ interface MathMLElementEventMap extends ElementEventMap, GlobalEventHandlersEven * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MathMLElement) */ -interface MathMLElement extends Element, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGElement { +interface MathMLElement extends Element, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGOrMathMLElement { addEventListener(type: K, listener: (this: MathMLElement, ev: MathMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MathMLElement, ev: MathMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -26030,6 +26043,7 @@ declare var NavigationPreloadManager: { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition) */ interface NavigationTransition { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition/committed) */ readonly committed: Promise; /** * The **`finished`** read-only property of the NavigationTransition interface returns a Promise that fulfills at the same time the navigatesuccess event fires, or rejects at the same time the navigateerror event fires. @@ -31825,7 +31839,7 @@ interface SVGElementEventMap extends ElementEventMap, GlobalEventHandlersEventMa * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGElement) */ -interface SVGElement extends Element, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGElement { +interface SVGElement extends Element, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGElement, HTMLOrSVGOrMathMLElement { /** @deprecated */ readonly className: any; /** diff --git a/baselines/ts5.9/dom.generated.d.ts b/baselines/ts5.9/dom.generated.d.ts index 24a34aa36..769e447f2 100644 --- a/baselines/ts5.9/dom.generated.d.ts +++ b/baselines/ts5.9/dom.generated.d.ts @@ -2748,6 +2748,10 @@ interface SerialPortRequestOptions { filters?: SerialPortFilter[]; } +interface SetHTMLOptions { + sanitizer?: Sanitizer | SanitizerConfig | SanitizerPresets; +} + interface ShadowRootInit { clonable?: boolean; customElementRegistry?: CustomElementRegistry | null; @@ -14139,6 +14143,12 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, NonDocumentTyp * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) */ setAttributeNodeNS(attr: Attr): Attr | null; + /** + * The **`setHTML()`** method of the Element interface provides an XSS-safe method to parse and sanitize a string of HTML and insert it into the DOM as a subtree of the element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setHTML) + */ + setHTML(html: string, options?: SetHTMLOptions): void; /** * The **`setHTMLUnsafe()`** method of the Element interface is used to parse HTML input into a DocumentFragment, optionally filtering out unwanted elements and attributes, and those that don't belong in the context, and then using it to replace the element's subtree in the DOM. * @@ -17984,7 +17994,7 @@ interface HTMLElementEventMap extends ElementEventMap, GlobalEventHandlersEventM * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement) */ -interface HTMLElement extends Element, ElementCSSInlineStyle, ElementContentEditable, GlobalEventHandlers, HTMLOrSVGElement { +interface HTMLElement extends Element, ElementCSSInlineStyle, ElementContentEditable, GlobalEventHandlers, HTMLOrSVGElement, HTMLOrSVGOrMathMLElement { /** * The **`HTMLElement.accessKey`** property sets the keystroke which a user can press to jump to a given element. * @@ -20309,7 +20319,10 @@ declare var HTMLOptionsCollection: { new(): HTMLOptionsCollection; }; -interface HTMLOrSVGElement { +interface HTMLOrSVGElement extends HTMLOrSVGOrMathMLElement { +} + +interface HTMLOrSVGOrMathMLElement { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/autofocus) */ autofocus: boolean; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/dataset) */ @@ -24033,7 +24046,7 @@ interface MathMLElementEventMap extends ElementEventMap, GlobalEventHandlersEven * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MathMLElement) */ -interface MathMLElement extends Element, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGElement { +interface MathMLElement extends Element, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGOrMathMLElement { addEventListener(type: K, listener: (this: MathMLElement, ev: MathMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MathMLElement, ev: MathMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -26030,6 +26043,7 @@ declare var NavigationPreloadManager: { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition) */ interface NavigationTransition { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition/committed) */ readonly committed: Promise; /** * The **`finished`** read-only property of the NavigationTransition interface returns a Promise that fulfills at the same time the navigatesuccess event fires, or rejects at the same time the navigateerror event fires. @@ -31825,7 +31839,7 @@ interface SVGElementEventMap extends ElementEventMap, GlobalEventHandlersEventMa * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGElement) */ -interface SVGElement extends Element, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGElement { +interface SVGElement extends Element, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGElement, HTMLOrSVGOrMathMLElement { /** @deprecated */ readonly className: any; /** diff --git a/inputfiles/patches/html.kdl b/inputfiles/patches/html.kdl index 112f9ff15..5155f2030 100644 --- a/inputfiles/patches/html.kdl +++ b/inputfiles/patches/html.kdl @@ -197,6 +197,15 @@ interface SharedWorker { } } +// Hack to avoid breakage due to the mixin renaming to HTMLOrSVGOrMathMLElement +interface-mixin HTMLOrSVGElement extends=HTMLOrSVGOrMathMLElement +interface HTMLElement { + includes HTMLOrSVGElement +} +interface SVGElement { + includes HTMLOrSVGElement +} + removals { dictionary CanvasRenderingContext2DSettings { member colorType // Blink-only as of 2025-12, being tested in WebKit diff --git a/inputfiles/patches/webauthn.kdl b/inputfiles/patches/webauthn.kdl index d0f167b59..9e994354e 100644 --- a/inputfiles/patches/webauthn.kdl +++ b/inputfiles/patches/webauthn.kdl @@ -14,33 +14,41 @@ removals { // https://searchfox.org/mozilla-central/source/dom/webidl/WebAuthentication.webidl // https://searchfox.org/wubkat/source/Source/WebCore/Modules/webauthn/AuthenticationExtensionsClientInputs.idl // https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/credentialmanagement/authentication_extensions_client_inputs.idl - member appidExclude - member credBlob - member getCredBlob - member hmacGetSecret // No implementation as of 2025-05 - member payment + member appidExclude // Blink only as of 2026-05 + member credBlob // Blink only as of 2026-05 + member getCredBlob // Blink only as of 2026-05 + member hmacGetSecret // No implementation as of 2026-05 + member payment // Blink test only as of 2026-05 + member remoteClientDataJSON // No implementation as of 2026-05 } dictionary AuthenticationExtensionsClientInputsJSON { - member appidExclude + member appidExclude // Blink only as of 2026-05 + member remoteClientDataJSON // No implementation as of 2026-05 } dictionary AuthenticationExtensionsClientOutputs { // (same as *Inputs) - member appidExclude // No implementation as of 2025-05 - member hmacGetSecret // No implementation as of 2025-05 - member payment // Blink only as of 2025-06 + member appidExclude // No implementation as of 2026-05 + member hmacGetSecret // No implementation as of 2026-05 + member payment // Blink only as of 2026-05 + member remoteClientDataJson // No implementation as of 2026-05 + } + + dictionary AuthenticationExtensionsClientOutputsJSON { + member appidExclude // No implementation as of 2026-05 + member remoteClientDataJson // No implementation as of 2026-05 } dictionary PublicKeyCredentialCreationOptions { member attestationFormats // Blink only as of 2024-08 member hints // Blink only as of 2024-08 } - + dictionary PublicKeyCredentialCreationOptionsJSON { member attestationFormats // Gecko only as of 2024-08 } - + dictionary PublicKeyCredentialRequestOptions { member hints // Blink only as of 2024-08 } @@ -56,8 +64,4 @@ removals { member otp member password } - - dictionary AuthenticationExtensionsClientOutputsJSON { - member appidExclude // No implementation as of 2025-12 - } } diff --git a/inputfiles/removedTypes.jsonc b/inputfiles/removedTypes.jsonc index 8634c0968..291459ed9 100644 --- a/inputfiles/removedTypes.jsonc +++ b/inputfiles/removedTypes.jsonc @@ -200,11 +200,8 @@ "RequestInit": { "members": { "member": { - "adAuctionHeaders": null, // Blink only as of 2023-11 - "attributionReporting": null, // Blink only as of 2023-10 "duplex": null, // Blink only as of 2023-09 "privateToken": null, // Blink only as of 2023-09 - "sharedStorageWritable": null, // Blink only as of 2023-10 "targetAddressSpace": null // Blink only as of 2023-09 } } diff --git a/package-lock.json b/package-lock.json index 09f59ab7a..04d44388d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -331,9 +331,9 @@ } }, "node_modules/@mdn/browser-compat-data": { - "version": "7.3.14", - "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-7.3.14.tgz", - "integrity": "sha512-Mqll0z0todYcAOqr+2hnYZRFe7+CwyU14lj86vzAGDJVeqnp618ybGzwHTI7sxyhd/46FFtJAlZNUmL1YHSX+Q==", + "version": "7.3.15", + "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-7.3.15.tgz", + "integrity": "sha512-8YoG52J2ZsR+T4p0JsAuoWeztBgJsAtGY+LeGEAHvyJBojJzJtLb8o1fRsIbc0v6EHKRLIrCU3VoAIK1olntag==", "dev": true, "license": "CC0-1.0" }, @@ -1074,9 +1074,9 @@ ] }, "node_modules/@webref/css": { - "version": "8.5.4", - "resolved": "https://registry.npmjs.org/@webref/css/-/css-8.5.4.tgz", - "integrity": "sha512-3t4LuTww0lNpJRi3k/Obb74xWc9+YVGcO0DNoc5k3+dmqIklcj3KHKBk4GHMwj4+zMwJXLpK7F2R9r3qTZg2Ag==", + "version": "8.5.5", + "resolved": "https://registry.npmjs.org/@webref/css/-/css-8.5.5.tgz", + "integrity": "sha512-i6R7FkwHJTK74VwMvul3V9rYN9Dq3NzJinaKadtg7DkMtvOwTuB5ZR3zGGCWr+nh7jcftymoThr3gKbBnvo3Hg==", "dev": true, "license": "MIT", "peerDependencies": { @@ -1091,16 +1091,16 @@ "license": "MIT" }, "node_modules/@webref/events": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/@webref/events/-/events-1.22.1.tgz", - "integrity": "sha512-UUypBtgLviCHkPxkigj0vclgG+gYIoHpLSvk05nXBFDMSiDOwPJjK66OkCh0hjiDG/dMzzUz1D1ngzJTU9OEEQ==", + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/@webref/events/-/events-1.23.0.tgz", + "integrity": "sha512-q0R3pFzvfYuXW+GN8nJMzZL9NoS+cOb4G/s4qBzuWRceGhfMpYFdCsVr+i84X1/dkYslYpQ8qxhSCcbxk8PFew==", "dev": true, "license": "MIT" }, "node_modules/@webref/idl": { - "version": "3.76.0", - "resolved": "https://registry.npmjs.org/@webref/idl/-/idl-3.76.0.tgz", - "integrity": "sha512-3HPoiu2bN9UmfdIUi5+qH9oBBQmhfccOmoUXSlwEmv7LvDu1ifmGSzkUCRrYYsVubMeZCMSLRMXnWDFn2K6qBw==", + "version": "3.77.0", + "resolved": "https://registry.npmjs.org/@webref/idl/-/idl-3.77.0.tgz", + "integrity": "sha512-XpDJ471ryn5pq2Z8wXnOd10XxiT6Nnp0QTrxgcU1cdvHBLEvbsmSj/d5ldnp90e1vyxllKyt53Ztl0/0DnKuHw==", "dev": true, "license": "MIT", "peerDependencies": { diff --git a/src/build/emitter.ts b/src/build/emitter.ts index a05c088b3..6a92e4e0f 100644 --- a/src/build/emitter.ts +++ b/src/build/emitter.ts @@ -1516,7 +1516,7 @@ export function emitWebIdl( for (const i of allNonCallbackInterfaces.sort(compareName)) { if (i.legacyNamespace) { continue; - } else if (i.noInterfaceObject) { + } else if (i.noInterfaceObject || i.mixin) { emitInterface(i); } else { emitInterface(i); diff --git a/src/build/expose.ts b/src/build/expose.ts index 09c7d2345..4c0c023c0 100644 --- a/src/build/expose.ts +++ b/src/build/expose.ts @@ -288,6 +288,8 @@ function flattenType(type: Browser.Typed[]) { function isEmptyMixin(i?: Browser.Interface) { return ( !!i?.mixin && + // (extends can only happen by patches) + !i.extends && isEmptyRecord(i.properties?.property) && isEmptyRecord(i.methods?.method) && isEmptyRecord(i.constants?.constant) && diff --git a/src/build/helpers.ts b/src/build/helpers.ts index 4a211d4ae..bb3a476ea 100644 --- a/src/build/helpers.ts +++ b/src/build/helpers.ts @@ -148,7 +148,7 @@ export function merge( ) { target[k] = srcProp; } else { - if (targetProp === srcProp && k !== "name") { + if (targetProp === srcProp && !["name", "mixin"].includes(k)) { console.warn( `Redundant merge value ${targetProp} in ${JSON.stringify(src)}`, ); diff --git a/src/build/patches.ts b/src/build/patches.ts index 86a4a3af6..f779fafb1 100644 --- a/src/build/patches.ts +++ b/src/build/patches.ts @@ -281,6 +281,7 @@ function handleMixinAndInterfaces( }; return { name, + ...(type === "mixin" ? { mixin: true } : {}), ...optionalNestedMember("events", event, { event }), ...optionalNestedMember("properties", property, { property }), ...optionalNestedMember("methods", method, { method }), @@ -539,7 +540,7 @@ function convertForRemovals(obj: unknown): unknown { if (obj && typeof obj === "object") { const newObj: Record = {}; for (const [key, value] of Object.entries(obj)) { - if (key !== "name") { + if (!["name", "mixin"].includes(key)) { const cleaned = convertForRemovals(value); // (intentionally covers null too) if (typeof cleaned === "object") { diff --git a/src/build/widlprocess.ts b/src/build/widlprocess.ts index d8b5ddeb2..beed49ae0 100644 --- a/src/build/widlprocess.ts +++ b/src/build/widlprocess.ts @@ -119,7 +119,6 @@ function convertInterfaceMixin( ) { const result = convertInterfaceCommon(i, commentMap); result.mixin = true; - result.noInterfaceObject = true; return result; }