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

Add imageSizes and imageSrcSet to know props #22550

Merged
merged 2 commits into from
Nov 25, 2021
Merged
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
50 changes: 50 additions & 0 deletions fixtures/attribute-behavior/AttributeTableSnapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -5248,6 +5248,56 @@
| `imageRendering=(null)`| (initial)| `<null>` |
| `imageRendering=(undefined)`| (initial)| `<null>` |

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

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

## `in` (on `<feBlend>` inside `<svg>`)
| Test Case | Flags | Result |
| --- | --- | --- |
Expand Down
2 changes: 2 additions & 0 deletions fixtures/attribute-behavior/src/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,8 @@ const attributes = [
tagName: 'svg',
read: getSVGAttribute('image-rendering'),
},
{name: 'imageSizes', tagName: 'link', read: getProperty('imageSizes')},
{name: 'imageSrcSet', tagName: 'link', read: getProperty('imageSrcset')},
{
name: 'in',
read: getSVGAttribute('in'),
Expand Down
2 changes: 2 additions & 0 deletions packages/react-dom/src/shared/possibleStandardNames.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ const possibleStandardNames = {
'http-equiv': 'httpEquiv',
icon: 'icon',
id: 'id',
imagesizes: 'imageSizes',
imagesrcset: 'imageSrcSet',
innerhtml: 'innerHTML',
inputmode: 'inputMode',
integrity: 'integrity',
Expand Down