Commit beccfdaf authored by David Sveningsson's avatar David Sveningsson Committed by David Sveningsson
Browse files

feat: add special `templateRoot` meta property for `<template>` element

parent 773b6cf8
Loading
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -48,6 +48,9 @@ export interface MetaElement {
  formAssociated?: FormAssociated;
  labelable?: boolean | MetaLabelableCallback;

  /* ignore DOM ancestry */
  templateRoot?: boolean;

  /* WAI-ARIA attributes */
  aria?: MetaAria;

@@ -217,6 +220,13 @@ This is typically elements input elements such as `<input>`.

[whatwg-labelable]: https://html.spec.whatwg.org/multipage/forms.html#category-label

### `templateRoot`

When set to `true`, this element has no impact on DOM ancestry.
I.e., the `<template>` element (where allowed) can contain anything, as it does not directly affect the DOM tree.

If unset, defaults to `false`.

### `aria.implicitRole`

- type: `string | ((node: HtmlElementLike) => string | null)`
+2 −0
Original line number Diff line number Diff line
@@ -782,6 +782,7 @@ export interface MetaData {
    scriptSupporting?: boolean;
    // (undocumented)
    sectioning?: boolean | MetaCategoryCallback;
    templateRoot?: boolean;
    // (undocumented)
    textContent?: TextContent | `${TextContent}`;
    // (undocumented)
@@ -819,6 +820,7 @@ export interface MetaElement extends Omit<MetaData, "deprecatedAttributes" | "re
    implicitRole: MetaImplicitRoleCallback;
    // (undocumented)
    tagName: string;
    templateRoot: boolean;
    // (undocumented)
    textContent?: TextContent;
}
+2 −0
Original line number Diff line number Diff line
@@ -879,6 +879,7 @@ export interface MetaData {
    scriptSupporting?: boolean;
    // (undocumented)
    sectioning?: boolean | MetaCategoryCallback;
    templateRoot?: boolean;
    // (undocumented)
    textContent?: TextContent | `${TextContent}`;
    // (undocumented)
@@ -916,6 +917,7 @@ export interface MetaElement extends Omit<MetaData, "deprecatedAttributes" | "re
    implicitRole: MetaImplicitRoleCallback;
    // (undocumented)
    tagName: string;
    templateRoot: boolean;
    // (undocumented)
    textContent?: TextContent;
}
+1 −1
Original line number Diff line number Diff line
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`configuration smoketest test-files/config/cjs-config/file.html: config 1`] = `
{
+1 −1
Original line number Diff line number Diff line
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`should match results: test-files/config/cjs-config/file.html config 1`] = `
{
Loading