fix(webaudio): preserve Gain processing guards and popup node interfaces

This commit is contained in:
ldm0
2026-11-21 20:03:28 +08:00
parent 7b68278418
commit f7325becd2
3 changed files with 9 additions and 5 deletions
@@ -5,7 +5,7 @@
try { await callback(); rows.push({name, pass: true}); }
catch (error) { rows.push({name, pass: false, message: String(error)}); }
};
for (const factory of ['createDelay', 'createStereoPanner']) {
for (const factory of ['createGain', 'createDelay', 'createStereoPanner']) {
for (const automaticPull of [false, true]) {
await check(factory + '/unsupported processing/' + automaticPull, async () => {
const context = new OfflineAudioContext(1, 32, 8000);
@@ -9,12 +9,13 @@
try { callback(); } catch (error) { return error; }
throw Error('expected exception');
};
const realms = [['main', window], ['child', document.getElementById('child').contentWindow]];
const popup = open();
const realms = [['main', window], ['child', document.getElementById('child').contentWindow], ['popup', popup]];
try {
for (const [label, w] of realms) {
const context = new w.AudioContext();
const types = [
['GainNode', 'createGain', 'gain', 1, -Math.fround(3.4028234663852886e38), Math.fround(3.4028234663852886e38), 'max'],
['DelayNode', 'createDelay', 'delayTime', 0, 0, 1, 'max'],
['StereoPannerNode', 'createStereoPanner', 'pan', 0, -1, 1, 'clamped-max']
];
@@ -144,7 +145,7 @@
});
} finally { await context.close(); }
}
} finally { popup.close(); }
globalThis.__nodeReplacementResults = {rows, rejectedModeStates, passed: rows.filter(row => row.pass).length, total: rows.length, failures: rows.filter(row => !row.pass)};
return rows.every(row => row.pass);
})()
+3
View File
@@ -105,6 +105,9 @@ fn initialize<'s>(
return false;
}
graph::initialize_node(scope, node, context);
// The legacy oscillator signal is not a Gain processor. Preserve the
// explicit unsupported-rendering boundary until PCM processing exists.
graph::mark_unsupported_processor(scope, node);
true
}