@samitouri / QOS-React-2 / commits / de7d1c9071

Add `fetchPriority` to `<img>` and `<link>` (#25927)

<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory. Before submitting a pull request, please make sure the following is done: 1. Fork [the repository](https://github.com/facebook/react) and create your branch from `main`. 2. Run `yarn` in the repository root. 3. If you've fixed a bug or added code that should be tested, add tests! 4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development. 5. Run `yarn test --prod` to test in the production environment. It supports the same options as `yarn test`. 6. If you need a debugger, run `yarn debug-test --watch TestName`, open `chrome://inspect`, and press "Inspect". 7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`). 8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files. 9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`). 10. If you haven't already, complete the CLA. Learn more about contributing: https://reactjs.org/docs/how-to-contribute.html --> ## Summary - Fixes https://github.com/facebook/react/issues/25682 ## How did you test this change? I tried this but it didn't work ``` yarn build --type=UMD_DEV react/index,react-dom && cd fixtures/attribute-behavior && yarn install && yarn start ``` Co-authored-by: eps1lon <silbermann.sebastian@gmail.com>

Steven committed Dec 23, 2022 at 14:31 UTC de7d1c90718ea8f4844a2219991f7115ef2bd2c5
3 files changed +94
fixtures/attribute-behavior/AttributeTableSnapshot.md
+75
@@ -3348,6 +3348,81 @@
3348 | `externalResourcesRequired=(null)`| (initial)| `<null>` |
3349 | `externalResourcesRequired=(undefined)`| (initial)| `<null>` |
3350
3351 +## `fetchPriority` (on `<img>` inside `<div>`)
3352 +| Test Case | Flags | Result |
3353 +| --- | --- | --- |
3354 +| `fetchPriority=(string)`| (changed)| `"high"` |
3355 +| `fetchPriority=(empty string)`| (initial)| `"auto"` |
3356 +| `fetchPriority=(array with string)`| (changed)| `"high"` |
3357 +| `fetchPriority=(empty array)`| (initial)| `"auto"` |
3358 +| `fetchPriority=(object)`| (initial)| `"auto"` |
3359 +| `fetchPriority=(numeric string)`| (initial)| `"auto"` |
3360 +| `fetchPriority=(-1)`| (initial)| `"auto"` |
3361 +| `fetchPriority=(0)`| (initial)| `"auto"` |
3362 +| `fetchPriority=(integer)`| (initial)| `"auto"` |
3363 +| `fetchPriority=(NaN)`| (initial, warning)| `"auto"` |
3364 +| `fetchPriority=(float)`| (initial)| `"auto"` |
3365 +| `fetchPriority=(true)`| (initial, warning)| `"auto"` |
3366 +| `fetchPriority=(false)`| (initial, warning)| `"auto"` |
3367 +| `fetchPriority=(string 'true')`| (initial)| `"auto"` |
3368 +| `fetchPriority=(string 'false')`| (initial)| `"auto"` |
3369 +| `fetchPriority=(string 'on')`| (initial)| `"auto"` |
3370 +| `fetchPriority=(string 'off')`| (initial)| `"auto"` |
3371 +| `fetchPriority=(symbol)`| (initial, warning)| `"auto"` |
3372 +| `fetchPriority=(function)`| (initial, warning)| `"auto"` |
3373 +| `fetchPriority=(null)`| (initial)| `"auto"` |
3374 +| `fetchPriority=(undefined)`| (initial)| `"auto"` |
3375 +
3376 +## `fetchpriority` (on `<img>` inside `<div>`)
3377 +| Test Case | Flags | Result |
3378 +| --- | --- | --- |
3379 +| `fetchpriority=(string)`| (changed, warning)| `"high"` |
3380 +| `fetchpriority=(empty string)`| (initial, warning)| `"auto"` |
3381 +| `fetchpriority=(array with string)`| (changed, warning)| `"high"` |
3382 +| `fetchpriority=(empty array)`| (initial, warning)| `"auto"` |
3383 +| `fetchpriority=(object)`| (initial, warning)| `"auto"` |
3384 +| `fetchpriority=(numeric string)`| (initial, warning)| `"auto"` |
3385 +| `fetchpriority=(-1)`| (initial, warning)| `"auto"` |
3386 +| `fetchpriority=(0)`| (initial, warning)| `"auto"` |
3387 +| `fetchpriority=(integer)`| (initial, warning)| `"auto"` |
3388 +| `fetchpriority=(NaN)`| (initial, warning)| `"auto"` |
3389 +| `fetchpriority=(float)`| (initial, warning)| `"auto"` |
3390 +| `fetchpriority=(true)`| (initial, warning)| `"auto"` |
3391 +| `fetchpriority=(false)`| (initial, warning)| `"auto"` |
3392 +| `fetchpriority=(string 'true')`| (initial, warning)| `"auto"` |
3393 +| `fetchpriority=(string 'false')`| (initial, warning)| `"auto"` |
3394 +| `fetchpriority=(string 'on')`| (initial, warning)| `"auto"` |
3395 +| `fetchpriority=(string 'off')`| (initial, warning)| `"auto"` |
3396 +| `fetchpriority=(symbol)`| (initial, warning)| `"auto"` |
3397 +| `fetchpriority=(function)`| (initial, warning)| `"auto"` |
3398 +| `fetchpriority=(null)`| (initial, warning)| `"auto"` |
3399 +| `fetchpriority=(undefined)`| (initial, warning)| `"auto"` |
3400 +
3401 +## `fetchPriority` (on `<link>` inside `<div>`)
3402 +| Test Case | Flags | Result |
3403 +| --- | --- | --- |
3404 +| `fetchPriority=(string)`| (changed)| `"high"` |
3405 +| `fetchPriority=(empty string)`| (initial)| `"auto"` |
3406 +| `fetchPriority=(array with string)`| (changed)| `"high"` |
3407 +| `fetchPriority=(empty array)`| (initial)| `"auto"` |
3408 +| `fetchPriority=(object)`| (initial)| `"auto"` |
3409 +| `fetchPriority=(numeric string)`| (initial)| `"auto"` |
3410 +| `fetchPriority=(-1)`| (initial)| `"auto"` |
3411 +| `fetchPriority=(0)`| (initial)| `"auto"` |
3412 +| `fetchPriority=(integer)`| (initial)| `"auto"` |
3413 +| `fetchPriority=(NaN)`| (initial, warning)| `"auto"` |
3414 +| `fetchPriority=(float)`| (initial)| `"auto"` |
3415 +| `fetchPriority=(true)`| (initial, warning)| `"auto"` |
3416 +| `fetchPriority=(false)`| (initial, warning)| `"auto"` |
3417 +| `fetchPriority=(string 'true')`| (initial)| `"auto"` |
3418 +| `fetchPriority=(string 'false')`| (initial)| `"auto"` |
3419 +| `fetchPriority=(string 'on')`| (initial)| `"auto"` |
3420 +| `fetchPriority=(string 'off')`| (initial)| `"auto"` |
3421 +| `fetchPriority=(symbol)`| (initial, warning)| `"auto"` |
3422 +| `fetchPriority=(function)`| (initial, warning)| `"auto"` |
3423 +| `fetchPriority=(null)`| (initial)| `"auto"` |
3424 +| `fetchPriority=(undefined)`| (initial)| `"auto"` |
3425 +
3426 ## `fill` (on `<path>` inside `<svg>`)
3427 | Test Case | Flags | Result |
3428 | --- | --- | --- |
fixtures/attribute-behavior/src/attributes.js
+18
@@ -573,6 +573,24 @@ const attributes = [
573 tagName: 'path',
574 read: getSVGAttribute('externalResourcesRequired'),
575 },
576 + {
577 + name: 'fetchPriority',
578 + overrideStringValue: 'high',
579 + tagName: 'img',
580 + read: getProperty('fetchPriority'),
581 + },
582 + {
583 + name: 'fetchpriority',
584 + overrideStringValue: 'high',
585 + tagName: 'img',
586 + read: getProperty('fetchPriority'),
587 + },
588 + {
589 + name: 'fetchPriority',
590 + overrideStringValue: 'high',
591 + tagName: 'link',
592 + read: getProperty('fetchPriority'),
593 + },
594 {
595 name: 'fill',
596 containerTagName: 'svg',
packages/react-dom-bindings/src/shared/possibleStandardNames.js
+1
@@ -60,6 +60,7 @@ const possibleStandardNames = {
60 draggable: 'draggable',
61 enctype: 'encType',
62 enterkeyhint: 'enterKeyHint',
63 + fetchpriority: 'fetchPriority',
64 for: 'htmlFor',
65 form: 'form',
66 formmethod: 'formMethod',