fix: correctly handle srcObject attribute on video elements (#14369)

* fix: correctly handle srcObject attribute on video elements

* remove side-effect

* side-effects agin

* side-effects agin

* better fix
pull/14366/head
Dominic Gannaway 2 months ago committed by GitHub
parent 7bd1cdf427
commit 811c8d32eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: correctly handle srcObject attribute on video elements

@ -192,7 +192,8 @@ const ATTRIBUTE_ALIASES = {
ismap: 'isMap', ismap: 'isMap',
nomodule: 'noModule', nomodule: 'noModule',
playsinline: 'playsInline', playsinline: 'playsInline',
readonly: 'readOnly' readonly: 'readOnly',
srcobject: 'srcObject'
}; };
/** /**
@ -212,7 +213,8 @@ const DOM_PROPERTIES = [
'readOnly', 'readOnly',
'value', 'value',
'inert', 'inert',
'volume' 'volume',
'srcObject'
]; ];
/** /**

@ -0,0 +1,12 @@
import { test } from '../../test';
export default test({
html: `<video></video>`,
test({ assert, target }) {
const video = target.querySelector('video');
// @ts-ignore
assert.deepEqual(video?.srcObject, {});
}
});

@ -0,0 +1,10 @@
<script>
let srcObject = $state();
$effect(() => {
srcObject = {};
})
</script>
<video {srcObject}></video>
Loading…
Cancel
Save