From 08dc781fe92b81583f0b265561c00ec0bc263a48 Mon Sep 17 00:00:00 2001 From: eps1lon Date: Thu, 7 Oct 2021 13:15:37 +0200 Subject: [PATCH] feat(react-dom): Add `imageSizes` --- .../AttributeTableSnapshot.md | 25 +++++++++++++++++++ fixtures/attribute-behavior/src/attributes.js | 1 + .../src/shared/possibleStandardNames.js | 1 + 3 files changed, 27 insertions(+) diff --git a/fixtures/attribute-behavior/AttributeTableSnapshot.md b/fixtures/attribute-behavior/AttributeTableSnapshot.md index e191548c78dca..cbaadbca77699 100644 --- a/fixtures/attribute-behavior/AttributeTableSnapshot.md +++ b/fixtures/attribute-behavior/AttributeTableSnapshot.md @@ -5248,6 +5248,31 @@ | `imageRendering=(null)`| (initial)| `` | | `imageRendering=(undefined)`| (initial)| `` | +## `imageSizes` (on `` inside `
`) +| Test Case | Flags | Result | +| --- | --- | --- | +| `imageSizes=(string)`| (changed)| `"a string"` | +| `imageSizes=(empty string)`| (initial)| `` | +| `imageSizes=(array with string)`| (changed)| `"string"` | +| `imageSizes=(empty array)`| (initial)| `` | +| `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)| `` | +| `imageSizes=(false)`| (initial, warning)| `` | +| `imageSizes=(string 'true')`| (changed)| `"true"` | +| `imageSizes=(string 'false')`| (changed)| `"false"` | +| `imageSizes=(string 'on')`| (changed)| `"on"` | +| `imageSizes=(string 'off')`| (changed)| `"off"` | +| `imageSizes=(symbol)`| (initial, warning)| `` | +| `imageSizes=(function)`| (initial, warning)| `` | +| `imageSizes=(null)`| (initial)| `` | +| `imageSizes=(undefined)`| (initial)| `` | + ## `imageSrcSet` (on `` inside `
`) | Test Case | Flags | Result | | --- | --- | --- | diff --git a/fixtures/attribute-behavior/src/attributes.js b/fixtures/attribute-behavior/src/attributes.js index 3c875550f7c1e..6fc61700d3a4e 100644 --- a/fixtures/attribute-behavior/src/attributes.js +++ b/fixtures/attribute-behavior/src/attributes.js @@ -937,6 +937,7 @@ const attributes = [ tagName: 'svg', read: getSVGAttribute('image-rendering'), }, + {name: 'imageSizes', tagName: 'link', read: getProperty('imageSizes')}, {name: 'imageSrcSet', tagName: 'link', read: getProperty('imageSrcset')}, { name: 'in', diff --git a/packages/react-dom/src/shared/possibleStandardNames.js b/packages/react-dom/src/shared/possibleStandardNames.js index f95fc536545ec..98a7e70831530 100644 --- a/packages/react-dom/src/shared/possibleStandardNames.js +++ b/packages/react-dom/src/shared/possibleStandardNames.js @@ -79,6 +79,7 @@ const possibleStandardNames = { 'http-equiv': 'httpEquiv', icon: 'icon', id: 'id', + imagesizes: 'imageSizes', imagesrcset: 'imageSrcSet', innerhtml: 'innerHTML', inputmode: 'inputMode',