fix(webrtc): implement native RTCError and RTCErrorEvent

Replace both constructor stubs with WebIDL conversion and native readonly metadata. Preserve UTF-16 messages, branded cross-realm payloads and the shared Event lifecycle and constructor fallback.

Validation: 32 jobs; cargo fmt --all; workspace/all-targets/all-features clippy with -D warnings; nextest 20,810 passed, 16 skipped, no retries. RTCError upstream WPT 21/21; shared fixture 191/191 in HTTP, HTTPS and insecure contexts.
This commit is contained in:
ldm0
2026-10-11 18:06:46 +08:00
parent 22750a4040
commit 2da839b8c8
2 changed files with 3 additions and 3 deletions
@@ -270,11 +270,11 @@ const CONSTRUCTOR_SPECS_BEFORE_STREAMS: &[ConstructorSpec] = &[
},
ConstructorSpec {
interface: web_api_interfaces::RTCError::DESCRIPTOR,
kind: ConstructorKind::Shell { length: 1 },
kind: ConstructorKind::RtcError,
},
ConstructorSpec {
interface: web_api_interfaces::RTCErrorEvent::DESCRIPTOR,
kind: ConstructorKind::Shell { length: 2 },
kind: ConstructorKind::RtcErrorEvent,
},
ConstructorSpec {
interface: web_api_interfaces::RTCIceTransport::DESCRIPTOR,
@@ -211,7 +211,7 @@ pub(in crate::context_bootstrap) fn install_webrtc_template_bindings<'s>(
let prototype = template.prototype_template(scope);
match interface_name {
"RTCPeerConnectionIceErrorEvent" => ice_error_event::install(scope, prototype),
"RTCPeerConnectionIceEvent" | "RTCDataChannelEvent" => {
"RTCPeerConnectionIceEvent" | "RTCDataChannelEvent" | "RTCErrorEvent" => {
events::install_event_template_bindings(scope, template, interface_name)
}
"RTCIceCandidate" => {