mirror of https://github.com/sveltejs/svelte
commit
12f4f6c457
@ -0,0 +1,31 @@
|
||||
export default {
|
||||
before_test() {
|
||||
Object.defineProperties(window.document, {
|
||||
fullscreenElement: {
|
||||
value: null,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// copied from window-binding
|
||||
// there's some kind of weird bug with this test... it compiles with the wrong require.extensions hook for some bizarre reason
|
||||
skip_if_ssr: true,
|
||||
|
||||
async test({ assert, target, window, component }) {
|
||||
const event = new window.Event('fullscreenchange');
|
||||
|
||||
const div = target.querySelector('div');
|
||||
|
||||
Object.defineProperties(window.document, {
|
||||
fullscreenElement: {
|
||||
value: div,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
|
||||
window.document.dispatchEvent(event);
|
||||
|
||||
assert.equal(component.fullscreen, div);
|
||||
}
|
||||
};
|
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
export let fullscreen;
|
||||
</script>
|
||||
|
||||
<svelte:document bind:fullscreenElement={fullscreen}/>
|
||||
|
||||
<div />
|
@ -1,8 +1,10 @@
|
||||
<script>
|
||||
export let width;
|
||||
export let height;
|
||||
export let devicePixelRatio;
|
||||
</script>
|
||||
|
||||
<svelte:window bind:innerWidth={width} bind:innerHeight={height}/>
|
||||
<svelte:window bind:innerWidth={width} bind:innerHeight={height} bind:devicePixelRatio={devicePixelRatio}/>
|
||||
|
||||
<div>{width}x{height}</div>
|
||||
<div>{width}x{height}</div>
|
||||
<div>{devicePixelRatio}</div>
|
||||
|
Loading…
Reference in new issue