diff --git a/src/compiler/compile/render_dom/wrappers/Element/Attribute.ts b/src/compiler/compile/render_dom/wrappers/Element/Attribute.ts index 6cb3a0021811..64178030f612 100644 --- a/src/compiler/compile/render_dom/wrappers/Element/Attribute.ts +++ b/src/compiler/compile/render_dom/wrappers/Element/Attribute.ts @@ -364,7 +364,6 @@ const attribute_lookup: { [key in BooleanAttributes]: AttributeMetadata } & { [k indeterminate: { applies_to: ['input'] }, inert: {}, ismap: { property_name: 'isMap', applies_to: ['img'] }, - itemscope: {}, loop: { applies_to: ['audio', 'bgsound', 'video'] }, multiple: { applies_to: ['input', 'select'] }, muted: { applies_to: ['audio', 'video'] }, diff --git a/src/shared/boolean_attributes.ts b/src/shared/boolean_attributes.ts index 668dd9797508..10513ec7122b 100644 --- a/src/shared/boolean_attributes.ts +++ b/src/shared/boolean_attributes.ts @@ -13,7 +13,6 @@ const _boolean_attributes = [ 'hidden', 'inert', 'ismap', - 'itemscope', 'loop', 'multiple', 'muted', diff --git a/test/runtime/samples/attribute-boolean-hidden/_config.js b/test/runtime/samples/attribute-boolean-hidden/_config.js new file mode 100644 index 000000000000..cb38feb93d51 --- /dev/null +++ b/test/runtime/samples/attribute-boolean-hidden/_config.js @@ -0,0 +1,10 @@ +export default { + props: { + hidden: true + }, + html: '
', + test({ assert, component, target }) { + component.hidden = false; + assert.htmlEqual(target.innerHTML, ''); + } +}; diff --git a/test/runtime/samples/attribute-boolean-hidden/main.svelte b/test/runtime/samples/attribute-boolean-hidden/main.svelte new file mode 100644 index 000000000000..f8d7a26910dd --- /dev/null +++ b/test/runtime/samples/attribute-boolean-hidden/main.svelte @@ -0,0 +1,5 @@ + + + diff --git a/test/runtime/samples/attribute-boolean-itemscope/_config.js b/test/runtime/samples/attribute-boolean-itemscope/_config.js deleted file mode 100644 index b5b21cfc470b..000000000000 --- a/test/runtime/samples/attribute-boolean-itemscope/_config.js +++ /dev/null @@ -1,11 +0,0 @@ -export default { - props: { - itemscope: true - }, - test({ assert, target, component }) { - const div = target.querySelector('div'); - assert.ok(div.itemscope); - component.itemscope = false; - assert.ok(!div.itemscope); - } -}; diff --git a/test/runtime/samples/attribute-boolean-itemscope/main.svelte b/test/runtime/samples/attribute-boolean-itemscope/main.svelte deleted file mode 100644 index 83265a983c70..000000000000 --- a/test/runtime/samples/attribute-boolean-itemscope/main.svelte +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/test/runtime/samples/attribute-microdata/_config.js b/test/runtime/samples/attribute-microdata/_config.js new file mode 100644 index 000000000000..8c6a7765ea99 --- /dev/null +++ b/test/runtime/samples/attribute-microdata/_config.js @@ -0,0 +1,25 @@ +// There is no relationship between the attribute and the dom node with regards to microdata attributes https://developer.mozilla.org/en-US/docs/Web/HTML/Microdata +export default { + html: `