Revert SVG passthrough and expand whitelist #6243
Merged
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.
Based on some discussions, this reverts a few commits that changed our SVG behavior to pass through all attributes to the node directly. After a lot of discussion that came in after the RC (see #6211), we mostly agree that while the move to pass through was a great effort and ultimately might be where we should go with attributes, it left us in an inconsistent state for our HTML and SVG behaviors. That's not awesome as there are already a number of things that must be learned for React and throwing in another inconsitency doesn't help. So we'll backpedal for now but still continue to provide full SVG support by going back to our previous whitelist and expanding it.
The list here was compiled with (a version of) https://gist.github.com/zpao/4f5ce1d96b11b8a70e07 which scrapes MDN for all of its SVG attributes.
Some additional changes in here as an effort to reduce bytesize. Specifically, since there are a lot of things in SVG that need to be mapped, we're duplicating the keys a lot. We can take some shortcuts to build the config with code so I did that. I also replaced all the
null
s in our config with a zero.null
was a placeholder value that we weren't using (only using it to check masks and it's 0 anyway for that).