Skip to content

Commit

Permalink
Add fetchPriority to <img> and <link>
Browse files Browse the repository at this point in the history
  • Loading branch information
styfle committed Dec 22, 2022
1 parent 5fcf1a4 commit ae25547
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
50 changes: 50 additions & 0 deletions fixtures/attribute-behavior/AttributeTableSnapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -3348,6 +3348,56 @@
| `externalResourcesRequired=(null)`| (initial)| `<null>` |
| `externalResourcesRequired=(undefined)`| (initial)| `<null>` |

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

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

## `fill` (on `<path>` inside `<svg>`)
| Test Case | Flags | Result |
| --- | --- | --- |
Expand Down
3 changes: 3 additions & 0 deletions fixtures/attribute-behavior/src/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,9 @@ const attributes = [
tagName: 'path',
read: getSVGAttribute('externalResourcesRequired'),
},
{name: 'fetchPriority', tagName: 'img'},
{name: 'fetchpriority', tagName: 'img'},
{name: 'fetchPriority', tagName: 'link', read: getProperty('fetchPriority')},
{
name: 'fill',
containerTagName: 'svg',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const possibleStandardNames = {
draggable: 'draggable',
enctype: 'encType',
enterkeyhint: 'enterKeyHint',
fetchpriority: 'fetchPriority',
for: 'htmlFor',
form: 'form',
formmethod: 'formMethod',
Expand Down

0 comments on commit ae25547

Please sign in to comment.