mirror of https://github.com/sveltejs/svelte
fix: expand boolean attribute support (#15095)
* Adding test for expected boolean attribute support * Improving support for more boolean attributes: Added: - `defer` - `disablepictureinpicture` - `disableremoteplayback` Improved: - `allowfullscreen` - `novalidate` * Skipping JSDOM version of boolean attribute test JSDOM lacks support for some attributes, so we'll skip it for now. See: - `async`: https://github.com/jsdom/jsdom/issues/1564 - `nomodule`: https://github.com/jsdom/jsdom/issues/2475 - `autofocus`: https://github.com/jsdom/jsdom/issues/3041 - `inert`: https://github.com/jsdom/jsdom/issues/3605 - etc...: https://github.com/jestjs/jest/issues/139#issuecomment-592673550 * Adding changesetpull/15108/head
parent
d17f5c748d
commit
d47f4f5908
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: expand boolean attribute support
|
@ -0,0 +1,60 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
// JSDOM lacks support for some of these attributes, so we'll skip it for now.
|
||||
//
|
||||
// See:
|
||||
// - `async`: https://github.com/jsdom/jsdom/issues/1564
|
||||
// - `nomodule`: https://github.com/jsdom/jsdom/issues/2475
|
||||
// - `autofocus`: https://github.com/jsdom/jsdom/issues/3041
|
||||
// - `inert`: https://github.com/jsdom/jsdom/issues/3605
|
||||
// - etc...: https://github.com/jestjs/jest/issues/139#issuecomment-592673550
|
||||
skip_mode: ['client'],
|
||||
|
||||
html: `
|
||||
<script nomodule async defer></script>
|
||||
<form novalidate></form>
|
||||
<input readonly required checked webkitdirectory>
|
||||
<select multiple disabled></select>
|
||||
<button formnovalidate></button>
|
||||
<img ismap>
|
||||
<video autoplay controls loop muted playsinline disablepictureinpicture disableremoteplayback></video>
|
||||
<audio disableremoteplayback></audio>
|
||||
<track default>
|
||||
<iframe allowfullscreen></iframe>
|
||||
<details open></details>
|
||||
<ol reversed></ol>
|
||||
<div autofocus></div>
|
||||
<span inert></span>
|
||||
|
||||
<script nomodule async defer></script>
|
||||
<form novalidate></form>
|
||||
<input readonly required checked webkitdirectory>
|
||||
<select multiple disabled></select>
|
||||
<button formnovalidate></button>
|
||||
<img ismap>
|
||||
<video autoplay controls loop muted playsinline disablepictureinpicture disableremoteplayback></video>
|
||||
<audio disableremoteplayback></audio>
|
||||
<track default>
|
||||
<iframe allowfullscreen></iframe>
|
||||
<details open></details>
|
||||
<ol reversed></ol>
|
||||
<div autofocus></div>
|
||||
<span inert></span>
|
||||
|
||||
<script></script>
|
||||
<form></form>
|
||||
<input>
|
||||
<select></select>
|
||||
<button></button>
|
||||
<img>
|
||||
<video></video>
|
||||
<audio></audio>
|
||||
<track>
|
||||
<iframe></iframe>
|
||||
<details></details>
|
||||
<ol></ol>
|
||||
<div></div>
|
||||
<span></span>
|
||||
`
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
<script>
|
||||
let runesMode = $state('using a rune so that we trigger runes mode');
|
||||
|
||||
const attributeValues = [true, 'test', false];
|
||||
</script>
|
||||
|
||||
{#each attributeValues as val}
|
||||
<script NOMODULE={val} ASYNC={val} DEFER={val}></script>
|
||||
<form NOVALIDATE={val}></form>
|
||||
<input READONLY={val} REQUIRED={val} CHECKED={val} WEBKITDIRECTORY={val} />
|
||||
<select MULTIPLE={val} DISABLED={val}></select>
|
||||
<button FORMNOVALIDATE={val}></button>
|
||||
<img ISMAP={val} />
|
||||
<video AUTOPLAY={val} CONTROLS={val} LOOP={val} MUTED={val} PLAYSINLINE={val} DISABLEPICTUREINPICTURE={val} DISABLEREMOTEPLAYBACK={val}></video>
|
||||
<audio DISABLEREMOTEPLAYBACK={val}></audio>
|
||||
<track DEFAULT={val} />
|
||||
<iframe ALLOWFULLSCREEN={val}></iframe>
|
||||
<details OPEN={val}></details>
|
||||
<ol REVERSED={val}></ol>
|
||||
<div AUTOFOCUS={val}></div>
|
||||
<span INERT={val}></span>
|
||||
{/each}
|
Loading…
Reference in new issue