Skip to content
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
10 changes: 5 additions & 5 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -947,12 +947,12 @@ interface KeySystemTrackConfiguration {
}

interface KeyboardEventInit extends EventModifierInit {
/** @deprecated */
/** @deprecated `charCode` is inconsistent across environments, consider using `key` instead. */
charCode?: number;
code?: string;
isComposing?: boolean;
key?: string;
/** @deprecated */
/** @deprecated `keyCode` is inconsistent across environments, consider using `key` instead. */
keyCode?: number;
location?: number;
repeat?: boolean;
Expand Down Expand Up @@ -9195,7 +9195,7 @@ interface CSSStyleProperties extends CSSStyleDeclarationBase {
*/
wordSpacing: string;
/**
* @deprecated
* @deprecated `word-wrap` is a legacy alias of `overflow-wrap`.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/overflow-wrap)
*/
Expand Down Expand Up @@ -39462,7 +39462,7 @@ interface WindowEventHandlers {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) */
onunhandledrejection: ((this: WindowEventHandlers, ev: PromiseRejectionEvent) => any) | null;
/**
* @deprecated
* @deprecated The unload event is not reliable, consider visibilitychange or pagehide events.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unload_event)
*/
Expand Down Expand Up @@ -41831,7 +41831,7 @@ declare var onstorage: ((this: Window, ev: StorageEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) */
declare var onunhandledrejection: ((this: Window, ev: PromiseRejectionEvent) => any) | null;
/**
* @deprecated
* @deprecated The unload event is not reliable, consider visibilitychange or pagehide events.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unload_event)
*/
Expand Down
10 changes: 5 additions & 5 deletions baselines/ts5.5/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -944,12 +944,12 @@ interface KeySystemTrackConfiguration {
}

interface KeyboardEventInit extends EventModifierInit {
/** @deprecated */
/** @deprecated `charCode` is inconsistent across environments, consider using `key` instead. */
charCode?: number;
code?: string;
isComposing?: boolean;
key?: string;
/** @deprecated */
/** @deprecated `keyCode` is inconsistent across environments, consider using `key` instead. */
keyCode?: number;
location?: number;
repeat?: boolean;
Expand Down Expand Up @@ -9185,7 +9185,7 @@ interface CSSStyleProperties extends CSSStyleDeclarationBase {
*/
wordSpacing: string;
/**
* @deprecated
* @deprecated `word-wrap` is a legacy alias of `overflow-wrap`.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/overflow-wrap)
*/
Expand Down Expand Up @@ -39436,7 +39436,7 @@ interface WindowEventHandlers {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) */
onunhandledrejection: ((this: WindowEventHandlers, ev: PromiseRejectionEvent) => any) | null;
/**
* @deprecated
* @deprecated The unload event is not reliable, consider visibilitychange or pagehide events.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unload_event)
*/
Expand Down Expand Up @@ -41805,7 +41805,7 @@ declare var onstorage: ((this: Window, ev: StorageEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) */
declare var onunhandledrejection: ((this: Window, ev: PromiseRejectionEvent) => any) | null;
/**
* @deprecated
* @deprecated The unload event is not reliable, consider visibilitychange or pagehide events.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unload_event)
*/
Expand Down
10 changes: 5 additions & 5 deletions baselines/ts5.6/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -944,12 +944,12 @@ interface KeySystemTrackConfiguration {
}

interface KeyboardEventInit extends EventModifierInit {
/** @deprecated */
/** @deprecated `charCode` is inconsistent across environments, consider using `key` instead. */
charCode?: number;
code?: string;
isComposing?: boolean;
key?: string;
/** @deprecated */
/** @deprecated `keyCode` is inconsistent across environments, consider using `key` instead. */
keyCode?: number;
location?: number;
repeat?: boolean;
Expand Down Expand Up @@ -9192,7 +9192,7 @@ interface CSSStyleProperties extends CSSStyleDeclarationBase {
*/
wordSpacing: string;
/**
* @deprecated
* @deprecated `word-wrap` is a legacy alias of `overflow-wrap`.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/overflow-wrap)
*/
Expand Down Expand Up @@ -39459,7 +39459,7 @@ interface WindowEventHandlers {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) */
onunhandledrejection: ((this: WindowEventHandlers, ev: PromiseRejectionEvent) => any) | null;
/**
* @deprecated
* @deprecated The unload event is not reliable, consider visibilitychange or pagehide events.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unload_event)
*/
Expand Down Expand Up @@ -41828,7 +41828,7 @@ declare var onstorage: ((this: Window, ev: StorageEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) */
declare var onunhandledrejection: ((this: Window, ev: PromiseRejectionEvent) => any) | null;
/**
* @deprecated
* @deprecated The unload event is not reliable, consider visibilitychange or pagehide events.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unload_event)
*/
Expand Down
10 changes: 5 additions & 5 deletions baselines/ts5.9/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -944,12 +944,12 @@ interface KeySystemTrackConfiguration {
}

interface KeyboardEventInit extends EventModifierInit {
/** @deprecated */
/** @deprecated `charCode` is inconsistent across environments, consider using `key` instead. */
charCode?: number;
code?: string;
isComposing?: boolean;
key?: string;
/** @deprecated */
/** @deprecated `keyCode` is inconsistent across environments, consider using `key` instead. */
keyCode?: number;
location?: number;
repeat?: boolean;
Expand Down Expand Up @@ -9192,7 +9192,7 @@ interface CSSStyleProperties extends CSSStyleDeclarationBase {
*/
wordSpacing: string;
/**
* @deprecated
* @deprecated `word-wrap` is a legacy alias of `overflow-wrap`.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/overflow-wrap)
*/
Expand Down Expand Up @@ -39459,7 +39459,7 @@ interface WindowEventHandlers {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) */
onunhandledrejection: ((this: WindowEventHandlers, ev: PromiseRejectionEvent) => any) | null;
/**
* @deprecated
* @deprecated The unload event is not reliable, consider visibilitychange or pagehide events.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unload_event)
*/
Expand Down Expand Up @@ -41828,7 +41828,7 @@ declare var onstorage: ((this: Window, ev: StorageEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) */
declare var onunhandledrejection: ((this: Window, ev: PromiseRejectionEvent) => any) | null;
/**
* @deprecated
* @deprecated The unload event is not reliable, consider visibilitychange or pagehide events.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unload_event)
*/
Expand Down
14 changes: 9 additions & 5 deletions inputfiles/patches/cssom.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ interface CSSStyleDeclaration \
forwardExtends=CSSStyleProperties

interface CSSStyleProperties replaceReference=CSSStyleDeclaration {
property wordWrap deprecated=#true

// The corresponding standardized property is not supported by
// anyone as of 2024-10.
property webkitLineClamp deprecated=#false
property wordWrap deprecated="`word-wrap` is a legacy alias of `overflow-wrap`."
}

removals {
interface CSSStyleProperties {
// The corresponding standardized property is not supported by
// anyone as of 2024-10.
property webkitLineClamp deprecated=""
}
}
4 changes: 1 addition & 3 deletions inputfiles/patches/html.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,5 @@ interface HTMLDocument extends=Document exposed=Window
interface-mixin MessageEventTarget overrideThis=T typeParameters=T

interface-mixin WindowEventHandlers {
// TODO: pass a string instead for deprecated
// The unload event is not reliable, consider visibilitychange or pagehide events
property onunload deprecated=#true
property onunload deprecated="The unload event is not reliable, consider visibilitychange or pagehide events."
}
7 changes: 2 additions & 5 deletions inputfiles/patches/uievents.kdl
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
dictionary KeyboardEventInit {
// TODO: pass a string instead for deprecated
// charCode is inconsistent across environments, consider using .key instead
member charCode deprecated=#true
// keyCode is inconsistent across environments, consider using .key instead
member keyCode deprecated=#true
member charCode deprecated="`charCode` is inconsistent across environments, consider using `key` instead."
member keyCode deprecated="`keyCode` is inconsistent across environments, consider using `key` instead."
}
28 changes: 16 additions & 12 deletions src/build/patches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ function handleTypeParameters(value: Value | Node) {
};
}

function undefinedIfEmpty(object: object, output: object) {
return Object.entries(object).length ? output : undefined;
function optionalNestedMember<T>(prop: string, object: object, output: T) {
return Object.entries(object).length ? { [prop]: output } : {};
}

/**
Expand Down Expand Up @@ -119,10 +119,12 @@ function convertKDLNodes(nodes: Node[]): DeepPartial<WebIdl> {
}

return {
enums: undefinedIfEmpty(enums, { enum: enums }),
mixins: undefinedIfEmpty(mixin, { mixin }),
interfaces: undefinedIfEmpty(interfaces, { interface: interfaces }),
dictionaries: undefinedIfEmpty(dictionary, { dictionary }),
...optionalNestedMember("enums", enums, { enum: enums }),
...optionalNestedMember("mixins", mixin, { mixin }),
...optionalNestedMember("interfaces", interfaces, {
interface: interfaces,
}),
...optionalNestedMember("dictionaries", dictionary, { dictionary }),
};
}

Expand Down Expand Up @@ -202,7 +204,7 @@ function handleMixinAndInterfaces(
};
return {
name,
events: { event },
...optionalNestedMember("events", event, { event }),
properties: { property },
methods: { method },
...optionalMember("extends", "string", node.properties?.extends),
Expand Down Expand Up @@ -256,7 +258,7 @@ function handleProperty(child: Node): Partial<Property> {
? handleTyped(typeNode)
: optionalMember("type", "string", child.properties?.type)),
...optionalMember("readonly", "boolean", child.properties?.readonly),
...optionalMember("deprecated", "boolean", child.properties?.deprecated),
...optionalMember("deprecated", "string", child.properties?.deprecated),
};
}

Expand Down Expand Up @@ -366,7 +368,7 @@ function handleMember(c: Node): Partial<Member> {
name,
...optionalMember("type", "string", c.properties?.type),
...optionalMember("required", "boolean", c.properties?.required),
...optionalMember("deprecated", "boolean", c.properties?.deprecated),
...optionalMember("deprecated", "string", c.properties?.deprecated),
...optionalMember("overrideType", "string", c.properties?.overrideType),
};
}
Expand Down Expand Up @@ -398,16 +400,18 @@ async function readPatchDocument(fileUrl: URL): Promise<Document> {
*/
function convertForRemovals(obj: unknown): unknown {
if (Array.isArray(obj)) {
const result = obj.map(convertForRemovals).filter((v) => v !== undefined);
return result.length === 0 ? null : result;
return obj.map(convertForRemovals).filter((v) => v !== undefined);
}
if (obj && typeof obj === "object") {
const newObj: Record<string, unknown> = {};
for (const [key, value] of Object.entries(obj)) {
if (key !== "name") {
const cleaned = convertForRemovals(value);
if (cleaned !== undefined) {
// (intentionally covers null too)
if (typeof cleaned === "object") {
newObj[key] = cleaned;
} else if (cleaned !== undefined) {
newObj[key] = null;
}
}
}
Expand Down