Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend attribute-behavior fixture #24947

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 71 additions & 21 deletions fixtures/attribute-behavior/AttributeTableSnapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,31 @@
| `aria-=(null)`| (initial, warning)| `<null>` |
| `aria-=(undefined)`| (initial, warning)| `<null>` |

## `aria-hidden` (on `<div>` inside `<div>`)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shows why you should currently use <div aria-hidden={ariaHidden ? true : undefined} /> since aria-hidden="false" is currently not recommended due to browser inconsistencies.

| Test Case | Flags | Result |
| --- | --- | --- |
| `aria-hidden=(string)`| (changed)| `"a string"` |
| `aria-hidden=(empty string)`| (changed)| `<empty string>` |
| `aria-hidden=(array with string)`| (changed)| `"string"` |
| `aria-hidden=(empty array)`| (changed)| `<empty string>` |
| `aria-hidden=(object)`| (changed)| `"result of toString()"` |
| `aria-hidden=(numeric string)`| (changed)| `"42"` |
| `aria-hidden=(-1)`| (changed)| `"-1"` |
| `aria-hidden=(0)`| (changed)| `"0"` |
| `aria-hidden=(integer)`| (changed)| `"1"` |
| `aria-hidden=(NaN)`| (changed)| `"NaN"` |
| `aria-hidden=(float)`| (changed)| `"99.99"` |
| `aria-hidden=(true)`| (changed)| `"true"` |
| `aria-hidden=(false)`| (changed)| `"false"` |
| `aria-hidden=(string 'true')`| (changed)| `"true"` |
| `aria-hidden=(string 'false')`| (changed)| `"false"` |
| `aria-hidden=(string 'on')`| (changed)| `"on"` |
| `aria-hidden=(string 'off')`| (changed)| `"off"` |
| `aria-hidden=(symbol)`| (initial)| `<null>` |
| `aria-hidden=(function)`| (initial)| `<null>` |
| `aria-hidden=(null)`| (initial)| `<null>` |
| `aria-hidden=(undefined)`| (initial)| `<null>` |

## `aria-invalidattribute` (on `<div>` inside `<div>`)
| Test Case | Flags | Result |
| --- | --- | --- |
Expand Down Expand Up @@ -5398,6 +5423,31 @@
| `in=(null)`| (initial)| `<null>` |
| `in=(undefined)`| (initial)| `<null>` |

## `inert` (on `<div>` inside `<div>`)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shows that you should use inert={insert ? "true" ? false} at the moment to ensure forwards compatibility at the cost of having a warning in current and future versions.

| Test Case | Flags | Result |
| --- | --- | --- |
| `inert=(string)`| (changed)| `<boolean: true>` |
| `inert=(empty string)`| (changed)| `<boolean: true>` |
| `inert=(array with string)`| (changed)| `<boolean: true>` |
| `inert=(empty array)`| (changed)| `<boolean: true>` |
| `inert=(object)`| (changed)| `<boolean: true>` |
| `inert=(numeric string)`| (changed)| `<boolean: true>` |
| `inert=(-1)`| (changed)| `<boolean: true>` |
| `inert=(0)`| (changed)| `<boolean: true>` |
| `inert=(integer)`| (changed)| `<boolean: true>` |
| `inert=(NaN)`| (changed, warning)| `<boolean: true>` |
| `inert=(float)`| (changed)| `<boolean: true>` |
| `inert=(true)`| (initial, warning)| `<boolean: false>` |
| `inert=(false)`| (initial, warning)| `<boolean: false>` |
| `inert=(string 'true')`| (changed)| `<boolean: true>` |
| `inert=(string 'false')`| (changed)| `<boolean: true>` |
| `inert=(string 'on')`| (changed)| `<boolean: true>` |
| `inert=(string 'off')`| (changed)| `<boolean: true>` |
| `inert=(symbol)`| (initial, warning)| `<boolean: false>` |
| `inert=(function)`| (initial, warning)| `<boolean: false>` |
| `inert=(null)`| (initial)| `<boolean: false>` |
| `inert=(undefined)`| (initial)| `<boolean: false>` |

## `in2` (on `<feBlend>` inside `<svg>`)
| Test Case | Flags | Result |
| --- | --- | --- |
Expand Down Expand Up @@ -5501,27 +5551,27 @@
## `inputMode` (on `<input>` inside `<div>`)
| Test Case | Flags | Result |
| --- | --- | --- |
| `inputMode=(string)`| (changed)| `"a string"` |
| `inputMode=(empty string)`| (changed)| `<empty string>` |
| `inputMode=(array with string)`| (changed)| `"string"` |
| `inputMode=(empty array)`| (changed)| `<empty string>` |
| `inputMode=(object)`| (changed)| `"result of toString()"` |
| `inputMode=(numeric string)`| (changed)| `"42"` |
| `inputMode=(-1)`| (changed)| `"-1"` |
| `inputMode=(0)`| (changed)| `"0"` |
| `inputMode=(integer)`| (changed)| `"1"` |
| `inputMode=(NaN)`| (changed, warning)| `"NaN"` |
| `inputMode=(float)`| (changed)| `"99.99"` |
| `inputMode=(true)`| (initial, warning)| `<null>` |
| `inputMode=(false)`| (initial, warning)| `<null>` |
| `inputMode=(string 'true')`| (changed)| `"true"` |
| `inputMode=(string 'false')`| (changed)| `"false"` |
| `inputMode=(string 'on')`| (changed)| `"on"` |
| `inputMode=(string 'off')`| (changed)| `"off"` |
| `inputMode=(symbol)`| (initial, warning)| `<null>` |
| `inputMode=(function)`| (initial, warning)| `<null>` |
| `inputMode=(null)`| (initial)| `<null>` |
| `inputMode=(undefined)`| (initial)| `<null>` |
| `inputMode=(string)`| (changed)| `"numeric"` |
| `inputMode=(empty string)`| (initial)| `<empty string>` |
| `inputMode=(array with string)`| (changed)| `"numeric"` |
| `inputMode=(empty array)`| (initial)| `<empty string>` |
| `inputMode=(object)`| (initial)| `<empty string>` |
| `inputMode=(numeric string)`| (initial)| `<empty string>` |
| `inputMode=(-1)`| (initial)| `<empty string>` |
| `inputMode=(0)`| (initial)| `<empty string>` |
| `inputMode=(integer)`| (initial)| `<empty string>` |
| `inputMode=(NaN)`| (initial, warning)| `<empty string>` |
| `inputMode=(float)`| (initial)| `<empty string>` |
| `inputMode=(true)`| (initial, warning)| `<empty string>` |
| `inputMode=(false)`| (initial, warning)| `<empty string>` |
| `inputMode=(string 'true')`| (initial)| `<empty string>` |
| `inputMode=(string 'false')`| (initial)| `<empty string>` |
| `inputMode=(string 'on')`| (initial)| `<empty string>` |
| `inputMode=(string 'off')`| (initial)| `<empty string>` |
| `inputMode=(symbol)`| (initial, warning)| `<empty string>` |
| `inputMode=(function)`| (initial, warning)| `<empty string>` |
| `inputMode=(null)`| (initial)| `<empty string>` |
| `inputMode=(undefined)`| (initial)| `<empty string>` |

## `integrity` (on `<script>` inside `<div>`)
| Test Case | Flags | Result |
Expand Down
6 changes: 4 additions & 2 deletions fixtures/attribute-behavior/src/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const attributes = [
},
{name: 'aria', read: getAttribute('aria')},
{name: 'aria-', read: getAttribute('aria-')},
{name: 'aria-hidden', read: getProperty('ariaHidden')},
{name: 'aria-invalidattribute', read: getAttribute('aria-invalidattribute')},
{name: 'as', tagName: 'link'},
{
Expand Down Expand Up @@ -905,7 +906,7 @@ const attributes = [
read: getSVGProperty('height'),
overrideStringValue: '100%',
},
{name: 'hidden'},
{name: 'hidden', overrideStringValue: 'until-found'},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shows that hidden="until-found" is currently not supported.

{name: 'high', tagName: 'meter'},
{
name: 'horiz-adv-x',
Expand Down Expand Up @@ -968,6 +969,7 @@ const attributes = [
containerTagName: 'svg',
tagName: 'feBlend',
},
{name: 'inert'},
{
name: 'in2',
read: getSVGProperty('in2'),
Expand All @@ -977,7 +979,7 @@ const attributes = [
{name: 'initialChecked', read: getAttribute('initialchecked')},
{name: 'initialValue', read: getAttribute('initialvalue')},
{name: 'inlist', read: getAttribute('inlist')},
{name: 'inputMode', tagName: 'input', read: getAttribute('inputmode')}, // TODO: Should use property but it's not implemented in Chrome
{name: 'inputMode', tagName: 'input', overrideStringValue: 'numeric'},
{name: 'integrity', tagName: 'script'},
{
name: 'intercept',
Expand Down