Add `imageSizes` and `imageSrcSet` to know props (#22550)
* feat(react-dom): Add `imageSrcSet` * feat(react-dom): Add `imageSizes`
Sebastian Silbermann committed
Nov 25, 2021 at 01:49 UTC
ca106a02d1648f4f0048b07c6b88f69aac175d3c
3 files changed
+54
fixtures/attribute-behavior/AttributeTableSnapshot.md
+50
@@ -5248,6 +5248,56 @@
5248
| `imageRendering=(null)`| (initial)| `<null>` |
5249
| `imageRendering=(undefined)`| (initial)| `<null>` |
5250
5251
+## `imageSizes` (on `<link>` inside `<div>`)
5252
+| Test Case | Flags | Result |
5253
+| --- | --- | --- |
5254
+| `imageSizes=(string)`| (changed)| `"a string"` |
5255
+| `imageSizes=(empty string)`| (initial)| `<empty string>` |
5256
+| `imageSizes=(array with string)`| (changed)| `"string"` |
5257
+| `imageSizes=(empty array)`| (initial)| `<empty string>` |
5258
+| `imageSizes=(object)`| (changed)| `"result of toString()"` |
5259
+| `imageSizes=(numeric string)`| (changed)| `"42"` |
5260
+| `imageSizes=(-1)`| (changed)| `"-1"` |
5261
+| `imageSizes=(0)`| (changed)| `"0"` |
5262
+| `imageSizes=(integer)`| (changed)| `"1"` |
5263
+| `imageSizes=(NaN)`| (changed, warning)| `"NaN"` |
5264
+| `imageSizes=(float)`| (changed)| `"99.99"` |
5265
+| `imageSizes=(true)`| (initial, warning)| `<empty string>` |
5266
+| `imageSizes=(false)`| (initial, warning)| `<empty string>` |
5267
+| `imageSizes=(string 'true')`| (changed)| `"true"` |
5268
+| `imageSizes=(string 'false')`| (changed)| `"false"` |
5269
+| `imageSizes=(string 'on')`| (changed)| `"on"` |
5270
+| `imageSizes=(string 'off')`| (changed)| `"off"` |
5271
+| `imageSizes=(symbol)`| (initial, warning)| `<empty string>` |
5272
+| `imageSizes=(function)`| (initial, warning)| `<empty string>` |
5273
+| `imageSizes=(null)`| (initial)| `<empty string>` |
5274
+| `imageSizes=(undefined)`| (initial)| `<empty string>` |
5275
+
5276
+## `imageSrcSet` (on `<link>` inside `<div>`)
5277
+| Test Case | Flags | Result |
5278
+| --- | --- | --- |
5279
+| `imageSrcSet=(string)`| (changed)| `"a string"` |
5280
+| `imageSrcSet=(empty string)`| (initial)| `<empty string>` |
5281
+| `imageSrcSet=(array with string)`| (changed)| `"string"` |
5282
+| `imageSrcSet=(empty array)`| (initial)| `<empty string>` |
5283
+| `imageSrcSet=(object)`| (changed)| `"result of toString()"` |
5284
+| `imageSrcSet=(numeric string)`| (changed)| `"42"` |
5285
+| `imageSrcSet=(-1)`| (changed)| `"-1"` |
5286
+| `imageSrcSet=(0)`| (changed)| `"0"` |
5287
+| `imageSrcSet=(integer)`| (changed)| `"1"` |
5288
+| `imageSrcSet=(NaN)`| (changed, warning)| `"NaN"` |
5289
+| `imageSrcSet=(float)`| (changed)| `"99.99"` |
5290
+| `imageSrcSet=(true)`| (initial, warning)| `<empty string>` |
5291
+| `imageSrcSet=(false)`| (initial, warning)| `<empty string>` |
5292
+| `imageSrcSet=(string 'true')`| (changed)| `"true"` |
5293
+| `imageSrcSet=(string 'false')`| (changed)| `"false"` |
5294
+| `imageSrcSet=(string 'on')`| (changed)| `"on"` |
5295
+| `imageSrcSet=(string 'off')`| (changed)| `"off"` |
5296
+| `imageSrcSet=(symbol)`| (initial, warning)| `<empty string>` |
5297
+| `imageSrcSet=(function)`| (initial, warning)| `<empty string>` |
5298
+| `imageSrcSet=(null)`| (initial)| `<empty string>` |
5299
+| `imageSrcSet=(undefined)`| (initial)| `<empty string>` |
5300
+
5301
## `in` (on `<feBlend>` inside `<svg>`)
5302
| Test Case | Flags | Result |
5303
| --- | --- | --- |
fixtures/attribute-behavior/src/attributes.js
+2
@@ -937,6 +937,8 @@ const attributes = [
937
tagName: 'svg',
938
read: getSVGAttribute('image-rendering'),
939
},
940
+ {name: 'imageSizes', tagName: 'link', read: getProperty('imageSizes')},
941
+ {name: 'imageSrcSet', tagName: 'link', read: getProperty('imageSrcset')},
942
{
943
name: 'in',
944
read: getSVGAttribute('in'),
packages/react-dom/src/shared/possibleStandardNames.js
+2
@@ -79,6 +79,8 @@ const possibleStandardNames = {
79
'http-equiv': 'httpEquiv',
80
icon: 'icon',
81
id: 'id',
82
+ imagesizes: 'imageSizes',
83
+ imagesrcset: 'imageSrcSet',
84
innerhtml: 'innerHTML',
85
inputmode: 'inputMode',
86
integrity: 'integrity',