Skip to content

Convert all enums to KDL format in addedTypes #2099

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 6 commits into from
Aug 3, 2025
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
2 changes: 1 addition & 1 deletion baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40070,7 +40070,7 @@ type RTCRtpTransceiverDirection = "inactive" | "recvonly" | "sendonly" | "sendre
type RTCSctpTransportState = "closed" | "connected" | "connecting";
type RTCSdpType = "answer" | "offer" | "pranswer" | "rollback";
type RTCSignalingState = "closed" | "have-local-offer" | "have-local-pranswer" | "have-remote-offer" | "have-remote-pranswer" | "stable";
type RTCStatsIceCandidatePairState = "failed" | "frozen" | "in-progress" | "inprogress" | "succeeded" | "waiting";
type RTCStatsIceCandidatePairState = "failed" | "frozen" | "in-progress" | "succeeded" | "waiting";
type RTCStatsType = "candidate-pair" | "certificate" | "codec" | "data-channel" | "inbound-rtp" | "local-candidate" | "media-playout" | "media-source" | "outbound-rtp" | "peer-connection" | "remote-candidate" | "remote-inbound-rtp" | "remote-outbound-rtp" | "transport";
type ReadableStreamReaderMode = "byob";
type ReadableStreamType = "bytes";
Expand Down
2 changes: 1 addition & 1 deletion baselines/ts5.5/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40047,7 +40047,7 @@ type RTCRtpTransceiverDirection = "inactive" | "recvonly" | "sendonly" | "sendre
type RTCSctpTransportState = "closed" | "connected" | "connecting";
type RTCSdpType = "answer" | "offer" | "pranswer" | "rollback";
type RTCSignalingState = "closed" | "have-local-offer" | "have-local-pranswer" | "have-remote-offer" | "have-remote-pranswer" | "stable";
type RTCStatsIceCandidatePairState = "failed" | "frozen" | "in-progress" | "inprogress" | "succeeded" | "waiting";
type RTCStatsIceCandidatePairState = "failed" | "frozen" | "in-progress" | "succeeded" | "waiting";
type RTCStatsType = "candidate-pair" | "certificate" | "codec" | "data-channel" | "inbound-rtp" | "local-candidate" | "media-playout" | "media-source" | "outbound-rtp" | "peer-connection" | "remote-candidate" | "remote-inbound-rtp" | "remote-outbound-rtp" | "transport";
type ReadableStreamReaderMode = "byob";
type ReadableStreamType = "bytes";
Expand Down
2 changes: 1 addition & 1 deletion baselines/ts5.6/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40070,7 +40070,7 @@ type RTCRtpTransceiverDirection = "inactive" | "recvonly" | "sendonly" | "sendre
type RTCSctpTransportState = "closed" | "connected" | "connecting";
type RTCSdpType = "answer" | "offer" | "pranswer" | "rollback";
type RTCSignalingState = "closed" | "have-local-offer" | "have-local-pranswer" | "have-remote-offer" | "have-remote-pranswer" | "stable";
type RTCStatsIceCandidatePairState = "failed" | "frozen" | "in-progress" | "inprogress" | "succeeded" | "waiting";
type RTCStatsIceCandidatePairState = "failed" | "frozen" | "in-progress" | "succeeded" | "waiting";
type RTCStatsType = "candidate-pair" | "certificate" | "codec" | "data-channel" | "inbound-rtp" | "local-candidate" | "media-playout" | "media-source" | "outbound-rtp" | "peer-connection" | "remote-candidate" | "remote-inbound-rtp" | "remote-outbound-rtp" | "transport";
type ReadableStreamReaderMode = "byob";
type ReadableStreamType = "bytes";
Expand Down
89 changes: 0 additions & 89 deletions inputfiles/addedTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -23,95 +23,6 @@
}
}
},
"callbackInterfaces": {
"interface": {}
},
"enums": {
"enum": {
"InsertPosition": {
"name": "InsertPosition",
"value": [
"beforebegin",
"beforeend",
"afterbegin",
"afterend"
]
},
"FontDisplay": {
"name": "FontDisplay",
// https://w3c.github.io/csswg-drafts/css-fonts-4/#font-display-desc
"value": [
"auto",
"block",
"swap",
"fallback",
"optional"
]
},
"RTCStatsIceCandidatePairState": {
"value": [
"inprogress"
]
},
"GlobalCompositeOperation": {
"name": "GlobalCompositeOperation",
"value": [
"source-over",
"source-in",
"source-out",
"source-atop",
"destination-over",
"destination-in",
"destination-out",
"destination-atop",
"lighter",
"copy",
"xor",
"multiply",
"screen",
"overlay",
"darken",
"lighten",
"color-dodge",
"color-burn",
"hard-light",
"soft-light",
"difference",
"exclusion",
"hue",
"saturation",
"color",
"luminosity"
]
},
"PermissionName": {
"name": "PermissionName",
// This is a subset of the permissions defined in the spec:
// https://w3c.github.io/powerful-features-registry/#registry-table-of-powerful-features
// Please add a feature only when it's supported by multiple engines.
"value": [
// Full support: https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API#browser_compatibility
"camera",
// Full support: https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API#browser_compatibility
"geolocation",
// Full support: https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API#browser_compatibility
"microphone",
// Gecko and Blink: https://developer.mozilla.org/en-US/docs/Web/API/Web_MIDI_API#browser_compatibility
"midi",
// Full support: https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API#browser_compatibility
"notifications",
// Gecko and Blink: https://developer.mozilla.org/en-US/docs/Web/API/Storage_API#browser_compatibility
"persistent-storage",
// Full support: https://developer.mozilla.org/en-US/docs/Web/API/Push_API#browser_compatibility
"push",
// Full support: https://developer.mozilla.org/en-US/docs/Web/API/Screen_Wake_Lock_API#browser_compatibility
"screen-wake-lock",
// Full support: https://developer.mozilla.org/en-US/docs/Web/API/Storage_Access_API#browser_compatibility
"storage-access"
]
}
}
},
"interfaces": {
"interface": {
// ImportMeta is not a true DOM interface, but we are forced to declare it as one in order to emit method definitions.
Expand Down
8 changes: 8 additions & 0 deletions inputfiles/patches/css-font.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
enum FontDisplay {
// https://w3c.github.io/csswg-drafts/css-fonts-4/#font-display-desc
auto
block
swap
fallback
optional
}
6 changes: 6 additions & 0 deletions inputfiles/patches/dom.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
enum InsertPosition {
beforebegin
beforeend
afterbegin
afterend
}
28 changes: 28 additions & 0 deletions inputfiles/patches/html-canvas.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
enum GlobalCompositeOperation {
source-over
source-in
source-out
source-atop
destination-over
destination-in
destination-out
destination-atop
lighter
copy
xor
multiply
screen
overlay
darken
lighten
color-dodge
color-burn
hard-light
soft-light
difference
exclusion
hue
saturation
color
luminosity
}
23 changes: 23 additions & 0 deletions inputfiles/patches/permissions.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// This is a subset of the permissions defined in the spec:
// https://w3c.github.io/powerful-features-registry/#registry-table-of-powerful-features
// Please add a feature only when it's supported by multiple engines.
enum PermissionName {
// Full support: https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API#browser_compatibility
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep other comments too from jsonc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhm no, the same link is just repeating, we should reflect the original comments.

Copy link
Contributor Author

@Bashamega Bashamega Aug 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @saschanaz
I have fixed it.
I only read the first and last parts and it was the same for me. I didn't see the difference 😄
It should be working now

camera
// Full support: https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API#browser_compatibility
geolocation
// Full support: https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API#browser_compatibility
microphone
// Gecko and Blink: https://developer.mozilla.org/en-US/docs/Web/API/Web_MIDI_API#browser_compatibility
midi
// Full support: https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API#browser_compatibility
notifications
// Gecko and Blink: https://developer.mozilla.org/en-US/docs/Web/API/Storage_API#browser_compatibility
persistent-storage
// Full support: https://developer.mozilla.org/en-US/docs/Web/API/Push_API#browser_compatibility
push
// Full support: https://developer.mozilla.org/en-US/docs/Web/API/Screen_Wake_Lock_API#browser_compatibility
screen-wake-lock
// Full support: https://developer.mozilla.org/en-US/docs/Web/API/Storage_Access_API#browser_compatibility
storage-access
}