From ae25547462ba9f20d661195f1475606dc2478f2a Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 22 Dec 2022 16:19:45 -0500 Subject: [PATCH 1/2] Add `fetchPriority` to `` and `` --- .../AttributeTableSnapshot.md | 50 +++++++++++++++++++ fixtures/attribute-behavior/src/attributes.js | 3 ++ .../src/shared/possibleStandardNames.js | 1 + 3 files changed, 54 insertions(+) diff --git a/fixtures/attribute-behavior/AttributeTableSnapshot.md b/fixtures/attribute-behavior/AttributeTableSnapshot.md index 52a6bc31ab319..722172943b8f1 100644 --- a/fixtures/attribute-behavior/AttributeTableSnapshot.md +++ b/fixtures/attribute-behavior/AttributeTableSnapshot.md @@ -3348,6 +3348,56 @@ | `externalResourcesRequired=(null)`| (initial)| `` | | `externalResourcesRequired=(undefined)`| (initial)| `` | +## `fetchPriority` (on `` inside `
`) +| Test Case | Flags | Result | +| --- | --- | --- | +| `fetchPriority=(string)`| (changed)| `"a string"` | +| `fetchPriority=(empty string)`| (initial)| `` | +| `fetchPriority=(array with string)`| (changed)| `"string"` | +| `fetchPriority=(empty array)`| (initial)| `` | +| `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)| `` | +| `fetchPriority=(false)`| (initial, warning)| `` | +| `fetchPriority=(string 'true')`| (changed)| `"true"` | +| `fetchPriority=(string 'false')`| (changed)| `"false"` | +| `fetchPriority=(string 'on')`| (changed)| `"on"` | +| `fetchPriority=(string 'off')`| (changed)| `"off"` | +| `fetchPriority=(symbol)`| (initial, warning)| `` | +| `fetchPriority=(function)`| (initial, warning)| `` | +| `fetchPriority=(null)`| (initial)| `` | +| `fetchPriority=(undefined)`| (initial)| `` | + +## `fetchPriority` (on `` inside `
`) +| Test Case | Flags | Result | +| --- | --- | --- | +| `fetchPriority=(string)`| (changed)| `"a string"` | +| `fetchPriority=(empty string)`| (initial)| `` | +| `fetchPriority=(array with string)`| (changed)| `"string"` | +| `fetchPriority=(empty array)`| (initial)| `` | +| `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)| `` | +| `fetchPriority=(false)`| (initial, warning)| `` | +| `fetchPriority=(string 'true')`| (changed)| `"true"` | +| `fetchPriority=(string 'false')`| (changed)| `"false"` | +| `fetchPriority=(string 'on')`| (changed)| `"on"` | +| `fetchPriority=(string 'off')`| (changed)| `"off"` | +| `fetchPriority=(symbol)`| (initial, warning)| `` | +| `fetchPriority=(function)`| (initial, warning)| `` | +| `fetchPriority=(null)`| (initial)| `` | +| `fetchPriority=(undefined)`| (initial)| `` | + ## `fill` (on `` inside ``) | Test Case | Flags | Result | | --- | --- | --- | diff --git a/fixtures/attribute-behavior/src/attributes.js b/fixtures/attribute-behavior/src/attributes.js index 6fc61700d3a4e..dd2b6e3f6bb5c 100644 --- a/fixtures/attribute-behavior/src/attributes.js +++ b/fixtures/attribute-behavior/src/attributes.js @@ -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', diff --git a/packages/react-dom-bindings/src/shared/possibleStandardNames.js b/packages/react-dom-bindings/src/shared/possibleStandardNames.js index 6a6029fbcbb68..e1b76a0978baa 100644 --- a/packages/react-dom-bindings/src/shared/possibleStandardNames.js +++ b/packages/react-dom-bindings/src/shared/possibleStandardNames.js @@ -60,6 +60,7 @@ const possibleStandardNames = { draggable: 'draggable', enctype: 'encType', enterkeyhint: 'enterKeyHint', + fetchpriority: 'fetchPriority', for: 'htmlFor', form: 'form', formmethod: 'formMethod', From dcccbe92f55190377e4425e003ed12760378e72c Mon Sep 17 00:00:00 2001 From: eps1lon Date: Fri, 23 Dec 2022 12:06:03 +0100 Subject: [PATCH 2/2] Polish fixture 1. always read correct property (to test compat with lowercase prop name) 1. use a known string value to test read/write parity Ran fixture with meta tags enabled in Chrome Version 107.0.5304.110 (Official Build) (64-bit) on Ubuntu 22.04 --- .../AttributeTableSnapshot.md | 109 +++++++++++------- fixtures/attribute-behavior/src/attributes.js | 21 +++- 2 files changed, 85 insertions(+), 45 deletions(-) diff --git a/fixtures/attribute-behavior/AttributeTableSnapshot.md b/fixtures/attribute-behavior/AttributeTableSnapshot.md index 722172943b8f1..93ae5b010bc90 100644 --- a/fixtures/attribute-behavior/AttributeTableSnapshot.md +++ b/fixtures/attribute-behavior/AttributeTableSnapshot.md @@ -3351,52 +3351,77 @@ ## `fetchPriority` (on `` inside `
`) | Test Case | Flags | Result | | --- | --- | --- | -| `fetchPriority=(string)`| (changed)| `"a string"` | -| `fetchPriority=(empty string)`| (initial)| `` | -| `fetchPriority=(array with string)`| (changed)| `"string"` | -| `fetchPriority=(empty array)`| (initial)| `` | -| `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)| `` | -| `fetchPriority=(false)`| (initial, warning)| `` | -| `fetchPriority=(string 'true')`| (changed)| `"true"` | -| `fetchPriority=(string 'false')`| (changed)| `"false"` | -| `fetchPriority=(string 'on')`| (changed)| `"on"` | -| `fetchPriority=(string 'off')`| (changed)| `"off"` | -| `fetchPriority=(symbol)`| (initial, warning)| `` | -| `fetchPriority=(function)`| (initial, warning)| `` | -| `fetchPriority=(null)`| (initial)| `` | -| `fetchPriority=(undefined)`| (initial)| `` | +| `fetchPriority=(string)`| (changed)| `"high"` | +| `fetchPriority=(empty string)`| (initial)| `"auto"` | +| `fetchPriority=(array with string)`| (changed)| `"high"` | +| `fetchPriority=(empty array)`| (initial)| `"auto"` | +| `fetchPriority=(object)`| (initial)| `"auto"` | +| `fetchPriority=(numeric string)`| (initial)| `"auto"` | +| `fetchPriority=(-1)`| (initial)| `"auto"` | +| `fetchPriority=(0)`| (initial)| `"auto"` | +| `fetchPriority=(integer)`| (initial)| `"auto"` | +| `fetchPriority=(NaN)`| (initial, warning)| `"auto"` | +| `fetchPriority=(float)`| (initial)| `"auto"` | +| `fetchPriority=(true)`| (initial, warning)| `"auto"` | +| `fetchPriority=(false)`| (initial, warning)| `"auto"` | +| `fetchPriority=(string 'true')`| (initial)| `"auto"` | +| `fetchPriority=(string 'false')`| (initial)| `"auto"` | +| `fetchPriority=(string 'on')`| (initial)| `"auto"` | +| `fetchPriority=(string 'off')`| (initial)| `"auto"` | +| `fetchPriority=(symbol)`| (initial, warning)| `"auto"` | +| `fetchPriority=(function)`| (initial, warning)| `"auto"` | +| `fetchPriority=(null)`| (initial)| `"auto"` | +| `fetchPriority=(undefined)`| (initial)| `"auto"` | + +## `fetchpriority` (on `` inside `
`) +| Test Case | Flags | Result | +| --- | --- | --- | +| `fetchpriority=(string)`| (changed, warning)| `"high"` | +| `fetchpriority=(empty string)`| (initial, warning)| `"auto"` | +| `fetchpriority=(array with string)`| (changed, warning)| `"high"` | +| `fetchpriority=(empty array)`| (initial, warning)| `"auto"` | +| `fetchpriority=(object)`| (initial, warning)| `"auto"` | +| `fetchpriority=(numeric string)`| (initial, warning)| `"auto"` | +| `fetchpriority=(-1)`| (initial, warning)| `"auto"` | +| `fetchpriority=(0)`| (initial, warning)| `"auto"` | +| `fetchpriority=(integer)`| (initial, warning)| `"auto"` | +| `fetchpriority=(NaN)`| (initial, warning)| `"auto"` | +| `fetchpriority=(float)`| (initial, warning)| `"auto"` | +| `fetchpriority=(true)`| (initial, warning)| `"auto"` | +| `fetchpriority=(false)`| (initial, warning)| `"auto"` | +| `fetchpriority=(string 'true')`| (initial, warning)| `"auto"` | +| `fetchpriority=(string 'false')`| (initial, warning)| `"auto"` | +| `fetchpriority=(string 'on')`| (initial, warning)| `"auto"` | +| `fetchpriority=(string 'off')`| (initial, warning)| `"auto"` | +| `fetchpriority=(symbol)`| (initial, warning)| `"auto"` | +| `fetchpriority=(function)`| (initial, warning)| `"auto"` | +| `fetchpriority=(null)`| (initial, warning)| `"auto"` | +| `fetchpriority=(undefined)`| (initial, warning)| `"auto"` | ## `fetchPriority` (on `` inside `
`) | Test Case | Flags | Result | | --- | --- | --- | -| `fetchPriority=(string)`| (changed)| `"a string"` | -| `fetchPriority=(empty string)`| (initial)| `` | -| `fetchPriority=(array with string)`| (changed)| `"string"` | -| `fetchPriority=(empty array)`| (initial)| `` | -| `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)| `` | -| `fetchPriority=(false)`| (initial, warning)| `` | -| `fetchPriority=(string 'true')`| (changed)| `"true"` | -| `fetchPriority=(string 'false')`| (changed)| `"false"` | -| `fetchPriority=(string 'on')`| (changed)| `"on"` | -| `fetchPriority=(string 'off')`| (changed)| `"off"` | -| `fetchPriority=(symbol)`| (initial, warning)| `` | -| `fetchPriority=(function)`| (initial, warning)| `` | -| `fetchPriority=(null)`| (initial)| `` | -| `fetchPriority=(undefined)`| (initial)| `` | +| `fetchPriority=(string)`| (changed)| `"high"` | +| `fetchPriority=(empty string)`| (initial)| `"auto"` | +| `fetchPriority=(array with string)`| (changed)| `"high"` | +| `fetchPriority=(empty array)`| (initial)| `"auto"` | +| `fetchPriority=(object)`| (initial)| `"auto"` | +| `fetchPriority=(numeric string)`| (initial)| `"auto"` | +| `fetchPriority=(-1)`| (initial)| `"auto"` | +| `fetchPriority=(0)`| (initial)| `"auto"` | +| `fetchPriority=(integer)`| (initial)| `"auto"` | +| `fetchPriority=(NaN)`| (initial, warning)| `"auto"` | +| `fetchPriority=(float)`| (initial)| `"auto"` | +| `fetchPriority=(true)`| (initial, warning)| `"auto"` | +| `fetchPriority=(false)`| (initial, warning)| `"auto"` | +| `fetchPriority=(string 'true')`| (initial)| `"auto"` | +| `fetchPriority=(string 'false')`| (initial)| `"auto"` | +| `fetchPriority=(string 'on')`| (initial)| `"auto"` | +| `fetchPriority=(string 'off')`| (initial)| `"auto"` | +| `fetchPriority=(symbol)`| (initial, warning)| `"auto"` | +| `fetchPriority=(function)`| (initial, warning)| `"auto"` | +| `fetchPriority=(null)`| (initial)| `"auto"` | +| `fetchPriority=(undefined)`| (initial)| `"auto"` | ## `fill` (on `` inside ``) | Test Case | Flags | Result | diff --git a/fixtures/attribute-behavior/src/attributes.js b/fixtures/attribute-behavior/src/attributes.js index dd2b6e3f6bb5c..b84a0d11da3b8 100644 --- a/fixtures/attribute-behavior/src/attributes.js +++ b/fixtures/attribute-behavior/src/attributes.js @@ -573,9 +573,24 @@ const attributes = [ tagName: 'path', read: getSVGAttribute('externalResourcesRequired'), }, - {name: 'fetchPriority', tagName: 'img'}, - {name: 'fetchpriority', tagName: 'img'}, - {name: 'fetchPriority', tagName: 'link', read: getProperty('fetchPriority')}, + { + name: 'fetchPriority', + overrideStringValue: 'high', + tagName: 'img', + read: getProperty('fetchPriority'), + }, + { + name: 'fetchpriority', + overrideStringValue: 'high', + tagName: 'img', + read: getProperty('fetchPriority'), + }, + { + name: 'fetchPriority', + overrideStringValue: 'high', + tagName: 'link', + read: getProperty('fetchPriority'), + }, { name: 'fill', containerTagName: 'svg',