From 6f903651283861af4e5a8838b3b74d2a953a0acc Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 20 May 2024 13:01:39 -0700 Subject: [PATCH] React DOM: Add support for Popover API (#27981) --- .../AttributeTableSnapshot.md | 75 +++++++++++ fixtures/attribute-behavior/public/index.html | 1 + fixtures/attribute-behavior/src/attributes.js | 16 +++ .../src/client/ReactDOMComponent.js | 27 ++++ .../src/events/DOMEventNames.js | 1 + .../src/events/DOMEventProperties.js | 1 + .../src/events/DOMPluginEventSystem.js | 1 + .../src/events/ReactDOMEventListener.js | 1 + .../src/events/SyntheticEvent.js | 8 ++ .../src/events/plugins/SimpleEventPlugin.js | 6 + .../src/shared/possibleStandardNames.js | 3 + .../__tests__/DOMPropertyOperations-test.js | 30 ++++- .../ReactDOMEventPropagation-test.js | 46 ++++++- .../src/__tests__/ReactTestUtils-test.js | 1 + .../__tests__/SimpleEventPlugin-test.js | 120 ++++++++++++++++++ .../src/test-utils/ReactTestUtilsFB.js | 1 + 16 files changed, 332 insertions(+), 6 deletions(-) diff --git a/fixtures/attribute-behavior/AttributeTableSnapshot.md b/fixtures/attribute-behavior/AttributeTableSnapshot.md index 8db00f818fbb3..004a35db8d405 100644 --- a/fixtures/attribute-behavior/AttributeTableSnapshot.md +++ b/fixtures/attribute-behavior/AttributeTableSnapshot.md @@ -8448,6 +8448,81 @@ | `pointsAtZ=(null)`| (initial)| `` | | `pointsAtZ=(undefined)`| (initial)| `` | +## `popover` (on `
` inside `
`) +| Test Case | Flags | Result | +| --- | --- | --- | +| `popover=(string)`| (changed)| `"manual"` | +| `popover=(empty string)`| (changed)| `"auto"` | +| `popover=(array with string)`| (changed)| `"manual"` | +| `popover=(empty array)`| (changed)| `"auto"` | +| `popover=(object)`| (changed)| `"manual"` | +| `popover=(numeric string)`| (changed)| `"manual"` | +| `popover=(-1)`| (changed)| `"manual"` | +| `popover=(0)`| (changed)| `"manual"` | +| `popover=(integer)`| (changed)| `"manual"` | +| `popover=(NaN)`| (changed, warning)| `"manual"` | +| `popover=(float)`| (changed)| `"manual"` | +| `popover=(true)`| (initial, warning)| `` | +| `popover=(false)`| (initial, warning)| `` | +| `popover=(string 'true')`| (changed)| `"manual"` | +| `popover=(string 'false')`| (changed)| `"manual"` | +| `popover=(string 'on')`| (changed)| `"manual"` | +| `popover=(string 'off')`| (changed)| `"manual"` | +| `popover=(symbol)`| (initial, warning)| `` | +| `popover=(function)`| (initial, warning)| `` | +| `popover=(null)`| (initial)| `` | +| `popover=(undefined)`| (initial)| `` | + +## `popoverTarget` (on `