Revert "fix(synthetic-shadow): retargeting does not correctly account for native shadow roots" #4047
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reverts #4018
Our event propagation polyfill does not account for DOM mutations and can only imitate the correct native behavior if the event target is connected. In cases where the actual target becomes disconnected during propagation, the retargeting logic incorrectly returns
null
because we can no longer compute the composed path correctly.We should preserve the existing behavior which is to always provide access to the actual target if it is disconnected. This means that we should also check that the root node of the disconnected target is not a native shadow root, in addition to the original check for synthetic shadow root.