Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor DOMProperty and CSSProperty #26513

Merged
merged 7 commits into from
Mar 30, 2023

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented Mar 30, 2023

This is a step towards getting rid of the meta programming in DOMProperty and CSSProperty.

This moves isAttributeNameSafe and isUnitlessNumber to a separate shared modules.

isUnitlessNumber is now a single switch instead of meta-programming. There is a slight behavior change here in that I hard code a specific set of vendor-prefixed attributes instead of prefixing all the unitless properties. I based this list on what getComputedStyle returns in current browsers. I removed Opera prefixes because they were removed in Opera itself. I included the ms ones mentioned in the original PR. These shouldn't really be used anymore anyway so should be pretty safe. Worst case, they'll fallback to the other property if you specify both.

Finally I inline the mustUseProperty special cases - which are also the only thing that uses propertyName. These are really all controlled components and all booleans.

I'm making a small breaking change here by treating checked and selected specially only on the input and option tags instead of all tags. That's because those are the only DOM nodes that actually have those properties but we used to set them as expandos instead of attributes before. That's why one of the tests is updated to now use input instead of testing an expando on a div which isn't a real use case. Interestingly this also uncovered that we update checked twice for some reason but keeping that logic for now.

Ideally multiple and muted should move into select and audio/video respectively for the same reason.

No change to the attribute-behavior fixture.

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Mar 30, 2023
@react-sizebot
Copy link

react-sizebot commented Mar 30, 2023

Comparing: 29a3be7...6b2bc31

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js +0.47% 162.20 kB 162.96 kB +0.11% 51.29 kB 51.35 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js +0.47% 163.85 kB 164.61 kB +0.09% 51.79 kB 51.84 kB
facebook-www/ReactDOM-prod.classic.js +0.31% 556.25 kB 557.99 kB +0.10% 98.33 kB 98.43 kB
facebook-www/ReactDOM-prod.modern.js +0.32% 539.97 kB 541.69 kB +0.06% 95.88 kB 95.94 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js = 100.03 kB 97.93 kB = 24.64 kB 23.95 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js = 100.03 kB 97.93 kB = 24.64 kB 23.95 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js = 100.03 kB 97.93 kB = 24.64 kB 23.95 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js = 98.64 kB 96.54 kB = 24.26 kB 23.57 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js = 98.64 kB 96.54 kB = 24.26 kB 23.57 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js = 98.64 kB 96.54 kB = 24.26 kB 23.57 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js = 97.50 kB 95.39 kB = 24.28 kB 23.59 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js = 97.50 kB 95.39 kB = 24.28 kB 23.59 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js = 97.50 kB 95.39 kB = 24.28 kB 23.59 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js = 97.01 kB 94.90 kB = 24.13 kB 23.44 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js = 97.01 kB 94.90 kB = 24.13 kB 23.44 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js = 97.01 kB 94.90 kB = 24.13 kB 23.44 kB
oss-experimental/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.development.js = 102.20 kB 99.95 kB = 24.42 kB 23.74 kB
oss-stable-semver/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.development.js = 102.20 kB 99.95 kB = 24.42 kB 23.74 kB
oss-stable/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.development.js = 102.20 kB 99.95 kB = 24.42 kB 23.74 kB
facebook-www/ReactFlightDOMRelayServer-dev.classic.js = 70.22 kB 68.08 kB = 17.50 kB 16.84 kB
facebook-www/ReactFlightDOMRelayServer-dev.modern.js = 70.22 kB 68.08 kB = 17.50 kB 16.84 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.min.js = 28.32 kB 27.44 kB = 9.74 kB 9.39 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.min.js = 28.32 kB 27.44 kB = 9.74 kB 9.39 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.min.js = 28.32 kB 27.44 kB = 9.74 kB 9.39 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js = 28.08 kB 27.20 kB = 9.63 kB 9.28 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js = 28.08 kB 27.20 kB = 9.63 kB 9.28 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js = 28.08 kB 27.20 kB = 9.63 kB 9.28 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.min.js = 27.44 kB 26.56 kB = 9.45 kB 9.10 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.min.js = 27.44 kB 26.56 kB = 9.45 kB 9.10 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.min.js = 27.44 kB 26.56 kB = 9.45 kB 9.10 kB
oss-experimental/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.production.min.js = 27.37 kB 26.49 kB = 9.44 kB 9.11 kB
oss-stable-semver/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.production.min.js = 27.37 kB 26.49 kB = 9.44 kB 9.11 kB
oss-stable/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.production.min.js = 27.37 kB 26.49 kB = 9.44 kB 9.11 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.min.js = 27.16 kB 26.28 kB = 9.34 kB 9.00 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.min.js = 27.16 kB 26.28 kB = 9.34 kB 9.00 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.min.js = 27.16 kB 26.28 kB = 9.34 kB 9.00 kB
facebook-www/ReactFlightDOMRelayServer-prod.classic.js = 35.62 kB 34.17 kB = 8.91 kB 8.49 kB
facebook-www/ReactFlightDOMRelayServer-prod.modern.js = 35.62 kB 34.17 kB = 8.91 kB 8.49 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +1.04% 55.03 kB 55.60 kB +0.37% 16.37 kB 16.43 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +1.04% 55.05 kB 55.63 kB +0.37% 16.39 kB 16.45 kB
oss-stable-semver/react-dom/umd/react-dom-server-legacy.browser.production.min.js +1.04% 55.20 kB 55.77 kB +0.37% 16.65 kB 16.71 kB
oss-stable/react-dom/umd/react-dom-server-legacy.browser.production.min.js +1.04% 55.22 kB 55.79 kB +0.36% 16.67 kB 16.73 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +1.04% 55.38 kB 55.95 kB +0.30% 16.50 kB 16.55 kB
oss-experimental/react-dom/umd/react-dom-server-legacy.browser.production.min.js +1.03% 55.55 kB 56.12 kB +0.29% 16.78 kB 16.83 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.production.min.js +1.03% 55.73 kB 56.30 kB +0.45% 17.23 kB 17.31 kB
oss-stable/react-dom/cjs/react-dom-server.browser.production.min.js +1.03% 55.75 kB 56.32 kB +0.45% 17.25 kB 17.33 kB
oss-stable-semver/react-dom/umd/react-dom-server.browser.production.min.js +1.02% 55.89 kB 56.47 kB +0.44% 17.51 kB 17.58 kB
oss-stable/react-dom/umd/react-dom-server.browser.production.min.js +1.02% 55.92 kB 56.49 kB +0.45% 17.53 kB 17.61 kB
oss-experimental/react-dom/cjs/react-dom-static.browser.production.min.js +1.02% 55.96 kB 56.53 kB +0.37% 17.31 kB 17.37 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.production.min.js +1.02% 56.08 kB 56.65 kB +0.37% 17.36 kB 17.42 kB
oss-experimental/react-dom/cjs/react-dom-static.edge.production.min.js +1.02% 56.14 kB 56.71 kB +0.39% 17.36 kB 17.43 kB
oss-experimental/react-dom/umd/react-dom-server.browser.production.min.js +1.02% 56.24 kB 56.82 kB +0.46% 17.62 kB 17.70 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.production.min.js +0.98% 58.58 kB 59.15 kB +0.35% 17.79 kB 17.85 kB
oss-stable/react-dom/cjs/react-dom-server.bun.production.min.js +0.98% 58.60 kB 59.17 kB +0.35% 17.81 kB 17.88 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.production.min.js +0.97% 58.99 kB 59.56 kB +0.31% 17.95 kB 18.00 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.production.min.js +0.96% 59.60 kB 60.17 kB +0.34% 17.84 kB 17.90 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.production.min.js +0.96% 59.62 kB 60.20 kB +0.33% 17.86 kB 17.92 kB
oss-stable-semver/react-dom/cjs/react-dom-server.edge.production.min.js +0.96% 59.68 kB 60.25 kB +0.34% 18.54 kB 18.60 kB
oss-stable/react-dom/cjs/react-dom-server.edge.production.min.js +0.96% 59.71 kB 60.28 kB +0.33% 18.56 kB 18.62 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.production.min.js +0.95% 60.01 kB 60.59 kB +0.31% 18.00 kB 18.05 kB
oss-experimental/react-dom/cjs/react-dom-server.edge.production.min.js +0.95% 60.10 kB 60.67 kB +0.39% 18.68 kB 18.75 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.production.min.js +0.95% 59.94 kB 60.51 kB +0.38% 18.60 kB 18.67 kB
oss-stable/react-dom/cjs/react-dom-server.node.production.min.js +0.95% 59.97 kB 60.53 kB +0.38% 18.62 kB 18.69 kB
oss-experimental/react-dom/cjs/react-dom-static.node.production.min.js +0.94% 60.32 kB 60.89 kB +0.36% 18.74 kB 18.81 kB
oss-experimental/react-dom/cjs/react-dom-server.node.production.min.js +0.94% 60.36 kB 60.93 kB +0.30% 18.75 kB 18.81 kB
facebook-www/ReactDOMServer-prod.modern.js +0.94% 127.30 kB 128.50 kB +0.24% 24.20 kB 24.26 kB
facebook-www/ReactDOMServer-prod.classic.js +0.91% 130.87 kB 132.07 kB +0.24% 24.90 kB 24.96 kB
facebook-www/ReactDOMServerStreaming-prod.modern.js +0.90% 132.19 kB 133.38 kB +0.21% 25.45 kB 25.51 kB
oss-stable-semver/react-dom/cjs/react-dom.production.min.js +0.47% 162.13 kB 162.89 kB +0.11% 51.27 kB 51.33 kB
oss-stable/react-dom/cjs/react-dom.production.min.js +0.47% 162.20 kB 162.96 kB +0.11% 51.29 kB 51.35 kB
oss-stable-semver/react-dom/umd/react-dom.production.min.js +0.47% 162.03 kB 162.79 kB +0.17% 51.63 kB 51.71 kB
oss-stable/react-dom/umd/react-dom.production.min.js +0.47% 162.11 kB 162.86 kB +0.16% 51.65 kB 51.74 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js +0.47% 163.85 kB 164.61 kB +0.09% 51.79 kB 51.84 kB
oss-experimental/react-dom/umd/react-dom.production.min.js +0.46% 163.76 kB 164.52 kB +0.19% 52.18 kB 52.28 kB
oss-experimental/react-dom/cjs/react-dom-unstable_testing.production.min.js +0.45% 170.06 kB 170.82 kB +0.12% 54.13 kB 54.20 kB
oss-stable-semver/react-dom/cjs/react-dom.profiling.min.js +0.44% 171.74 kB 172.50 kB +0.14% 53.71 kB 53.78 kB
oss-stable/react-dom/cjs/react-dom.profiling.min.js +0.44% 171.81 kB 172.58 kB +0.13% 53.73 kB 53.80 kB
oss-stable-semver/react-dom/umd/react-dom.profiling.min.js +0.44% 171.00 kB 171.76 kB +0.03% 53.97 kB 53.99 kB
oss-stable/react-dom/umd/react-dom.profiling.min.js +0.44% 171.08 kB 171.83 kB +0.03% 53.99 kB 54.01 kB
oss-experimental/react-dom/umd/react-dom.profiling.min.js +0.44% 172.73 kB 173.49 kB +0.05% 54.54 kB 54.56 kB
oss-experimental/react-dom/cjs/react-dom.profiling.min.js +0.44% 173.46 kB 174.23 kB +0.12% 54.23 kB 54.29 kB
facebook-www/ReactDOM-prod.modern.js +0.32% 539.97 kB 541.69 kB +0.06% 95.88 kB 95.94 kB
facebook-www/ReactDOM-prod.classic.js +0.31% 556.25 kB 557.99 kB +0.10% 98.33 kB 98.43 kB
facebook-www/ReactDOMTesting-prod.modern.js +0.31% 556.51 kB 558.23 kB +0.04% 100.00 kB 100.05 kB
facebook-www/ReactDOM-profiling.modern.js +0.30% 570.29 kB 572.02 kB +0.05% 100.32 kB 100.37 kB
facebook-www/ReactDOMTesting-prod.classic.js +0.30% 570.80 kB 572.52 kB +0.10% 101.95 kB 102.05 kB
facebook-www/ReactDOM-profiling.classic.js +0.30% 586.64 kB 588.37 kB +0.09% 102.83 kB 102.93 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js = 100.03 kB 97.93 kB = 24.64 kB 23.95 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js = 100.03 kB 97.93 kB = 24.64 kB 23.95 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js = 100.03 kB 97.93 kB = 24.64 kB 23.95 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js = 98.64 kB 96.54 kB = 24.26 kB 23.57 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js = 98.64 kB 96.54 kB = 24.26 kB 23.57 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js = 98.64 kB 96.54 kB = 24.26 kB 23.57 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js = 97.50 kB 95.39 kB = 24.28 kB 23.59 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js = 97.50 kB 95.39 kB = 24.28 kB 23.59 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js = 97.50 kB 95.39 kB = 24.28 kB 23.59 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js = 97.01 kB 94.90 kB = 24.13 kB 23.44 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js = 97.01 kB 94.90 kB = 24.13 kB 23.44 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js = 97.01 kB 94.90 kB = 24.13 kB 23.44 kB
oss-experimental/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.development.js = 102.20 kB 99.95 kB = 24.42 kB 23.74 kB
oss-stable-semver/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.development.js = 102.20 kB 99.95 kB = 24.42 kB 23.74 kB
oss-stable/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.development.js = 102.20 kB 99.95 kB = 24.42 kB 23.74 kB
facebook-www/ReactFlightDOMRelayServer-dev.classic.js = 70.22 kB 68.08 kB = 17.50 kB 16.84 kB
facebook-www/ReactFlightDOMRelayServer-dev.modern.js = 70.22 kB 68.08 kB = 17.50 kB 16.84 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.min.js = 28.32 kB 27.44 kB = 9.74 kB 9.39 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.min.js = 28.32 kB 27.44 kB = 9.74 kB 9.39 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.min.js = 28.32 kB 27.44 kB = 9.74 kB 9.39 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js = 28.08 kB 27.20 kB = 9.63 kB 9.28 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js = 28.08 kB 27.20 kB = 9.63 kB 9.28 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js = 28.08 kB 27.20 kB = 9.63 kB 9.28 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.min.js = 27.44 kB 26.56 kB = 9.45 kB 9.10 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.min.js = 27.44 kB 26.56 kB = 9.45 kB 9.10 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.min.js = 27.44 kB 26.56 kB = 9.45 kB 9.10 kB
oss-experimental/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.production.min.js = 27.37 kB 26.49 kB = 9.44 kB 9.11 kB
oss-stable-semver/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.production.min.js = 27.37 kB 26.49 kB = 9.44 kB 9.11 kB
oss-stable/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.production.min.js = 27.37 kB 26.49 kB = 9.44 kB 9.11 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.min.js = 27.16 kB 26.28 kB = 9.34 kB 9.00 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.min.js = 27.16 kB 26.28 kB = 9.34 kB 9.00 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.min.js = 27.16 kB 26.28 kB = 9.34 kB 9.00 kB
facebook-www/ReactFlightDOMRelayServer-prod.classic.js = 35.62 kB 34.17 kB = 8.91 kB 8.49 kB
facebook-www/ReactFlightDOMRelayServer-prod.modern.js = 35.62 kB 34.17 kB = 8.91 kB 8.49 kB

Generated by 🚫 dangerJS against 6b2bc31

This changes behavior for prefixes. I checked for which prefixes are still
returned by getComputedStyle in browsers. I also added the ones mentioned
in the original PR, whether used or not.

I removed Opera prefixes since they have since been removed in the browser
itself.

We should ideally just remove all prefixes.
<input type="checkbox" onChange={onChange} checked={false} />,
container,
);
// TODO: Non-null values are updated twice on inputs. This is should ideally be fixed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did this change?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh because we have generic logic and specific logic for input, got it.
I don't think we need the generic one, just the specific one: the generic one doesn't re-set the value if it shouldn't have changed, but we need to do that for the controlled components. that's why it sets it unconditionally in updateChecked

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is that the test now uses <input> but that behavior was already there.

The issue is that updateChecked is only updating the value if the value is not null. Which doesn't seem right to me because it leaves the current state instead of resetting to defaultValue but maybe that's correct. I don't know what the intended semantics are here. I suspect maybe it's a bug but I'm scared to change it.

case 'MozBoxFlexGroup':
case 'MozLineClamp':
case 'msFlexGrow':
case 'msLineClamp':
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

found this bootleg list of css properties which suggests that -ms-line-clamp is not a thing but that you do want these:

-ms-animation-iteration-count
-ms-flex
-ms-flex-grow
-ms-flex-negative
-ms-flex-order
-ms-flex-positive
-ms-flex-shrink
-ms-grid-column
-ms-grid-column-span
-ms-grid-row
-ms-grid-row-span
-ms-zoom

https://jas-chen.github.io/jsty/api/interfaces/_types_.cssproperties.html

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm kind of tempted to drop the ms prefixes. Does Edge even support them post-chromium? Even if people still specify them, it seems likely that they'd also specify one of the other ones.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found uses of all of them except -ms-animation-iteration-count on github. That's probably enough reason to support them for now.

I'm not sure what the mechanics for deprecating these should be though since just letting them write might let them take precedence with the wrong value if it's a valid value. Special casing them some other way doesn't really help us. It's better in the Opera case where they stop working and can't have that effect.

So maybe if they're not supported in Edge, we can just remove them?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're probably not supported in Edge given that I can't find real matches at cs.chromium.org for them so yeah it's probably safe to drop.

@sebmarkbage sebmarkbage merged commit 73deff0 into facebook:main Mar 30, 2023
github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
This is a step towards getting rid of the meta programming in
DOMProperty and CSSProperty.

This moves isAttributeNameSafe and isUnitlessNumber to a separate shared
modules.

isUnitlessNumber is now a single switch instead of meta-programming.
There is a slight behavior change here in that I hard code a specific
set of vendor-prefixed attributes instead of prefixing all the unitless
properties. I based this list on what getComputedStyle returns in
current browsers. I removed Opera prefixes because they were [removed in
Opera](https://dev.opera.com/blog/css-vendor-prefixes-in-opera-12-50-snapshots/)
itself. I included the ms ones mentioned [in the original
PR](5abcce5).
These shouldn't really be used anymore anyway so should be pretty safe.
Worst case, they'll fallback to the other property if you specify both.

Finally I inline the mustUseProperty special cases - which are also the
only thing that uses propertyName. These are really all controlled
components and all booleans.

I'm making a small breaking change here by treating `checked` and
`selected` specially only on the `input` and `option` tags instead of
all tags. That's because those are the only DOM nodes that actually have
those properties but we used to set them as expandos instead of
attributes before. That's why one of the tests is updated to now use
`input` instead of testing an expando on a `div` which isn't a real use
case. Interestingly this also uncovered that we update checked twice for
some reason but keeping that logic for now.

Ideally `multiple` and `muted` should move into `select` and
`audio`/`video` respectively for the same reason.

No change to the attribute-behavior fixture.

DiffTrain build for [73deff0](73deff0)
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Apr 11, 2023
Summary:
This sync includes the following changes:
- **[ca01f359b](facebook/react@ca01f359b )**: Remove skipUnmountedBoundaries ([#26489](facebook/react#26489)) //<Ricky>//
- **[43a70a610](facebook/react@43a70a610 )**: Limit the meaning of "custom element" to not include `is` ([#26524](facebook/react#26524)) //<Sebastian Markbåge>//
- **[1308e49a6](facebook/react@1308e49a6 )**: [Flight Plugin] Scan for "use client" ([#26474](facebook/react#26474)) //<dan>//
- **[1a1d61fed](facebook/react@1a1d61fed )**: Warn for ARIA typos on custom elements ([#26523](facebook/react#26523)) //<Sebastian Markbåge>//
- **[73deff0d5](facebook/react@73deff0d5 )**: Refactor DOMProperty and CSSProperty ([#26513](facebook/react#26513)) //<Sebastian Markbåge>//
- **[2d51251e6](facebook/react@2d51251e6 )**: Clean up deferRenderPhaseUpdateToNextBatch ([#26511](facebook/react#26511)) //<Andrew Clark>//
- **[0ffc7f632](facebook/react@0ffc7f632 )**: Update useMemoCache test to confirm that cache persists across errors ([#26510](facebook/react#26510)) //<Joseph Savona>//
- **[29a3be78b](facebook/react@29a3be78b )**: Move ReactDOMFloat to react-dom/src/ ([#26514](facebook/react#26514)) //<Sebastian Markbåge>//
- **[4c2fc0190](facebook/react@4c2fc0190 )**: Generate safe javascript url instead of throwing with disableJavaScriptURLs is on ([#26507](facebook/react#26507)) //<Sebastian Markbåge>//
- **[f0aafa1a7](facebook/react@f0aafa1a7 )**: Convert a few more tests to waitFor test helpers ([#26509](facebook/react#26509)) //<Andrew Clark>//
- **[90995ef8b](facebook/react@90995ef8b )**: Delete "triangle" resuming fuzz tester ([#26508](facebook/react#26508)) //<Andrew Clark>//
- **[f118b7ceb](facebook/react@f118b7ceb )**: [Flight] Gated test for dropped transport of undefined object values ([#26478](facebook/react#26478)) //<Sebastian Silbermann>//
- **[fd0511c72](facebook/react@fd0511c72 )**: [Flight] Add support BigInt support ([#26479](facebook/react#26479)) //<Sebastian Silbermann>//
- **[85de6fde5](facebook/react@85de6fde5 )**: Refactor DOM special cases per tags including controlled fields ([#26501](facebook/react#26501)) //<Sebastian Markbåge>//
- **[1f5cdf8c7](facebook/react@1f5cdf8c7 )**: Update Suspense fuzz tests to use `act` ([#26498](facebook/react#26498)) //<Andrew Clark>//
- **[f62cb39ee](facebook/react@f62cb39ee )**: Make disableSchedulerTimeoutInWorkLoop a static ff ([#26497](facebook/react#26497)) //<Ricky>//
- **[41b4714f1](facebook/react@41b4714f1 )**: Remove disableNativeComponentFrames ([#26490](facebook/react#26490)) //<Ricky>//
- **[fc90eb636](facebook/react@fc90eb636 )**: Codemod more tests to waitFor pattern ([#26494](facebook/react#26494)) //<Andrew Clark>//
- **[e0bbc2662](facebook/react@e0bbc2662 )**: Improve tests that deal with microtasks ([#26493](facebook/react#26493)) //<Andrew Clark>//
- **[8faf75193](facebook/react@8faf75193 )**: Codemod some expiration tests to waitForExpired ([#26491](facebook/react#26491)) //<Andrew Clark>//
- **[8342a0992](facebook/react@8342a0992 )**: Remove unused feature flag disableSchedulerTimeoutBasedOnReactExpirationTime ([#26488](facebook/react#26488)) //<Jan Kassens>//
- **[afea1d0c5](facebook/react@afea1d0c5 )**: [flow] make Flow suppressions explicit on the error ([#26487](facebook/react#26487)) //<Jan Kassens>//
- **[768f965de](facebook/react@768f965de )**: Suspensily committing a prerendered tree ([#26434](facebook/react#26434)) //<Andrew Clark>//
- **[d12bdcda6](facebook/react@d12bdcda6 )**: Fix Flow types of useEffectEvent ([#26468](facebook/react#26468)) //<Sebastian Silbermann>//
- **[73b6435ca](facebook/react@73b6435ca )**: [Float][Fiber] Implement waitForCommitToBeReady for stylesheet resources ([#26450](facebook/react#26450)) //<Josh Story>//
- **[175962c10](facebook/react@175962c10 )**: Fix remaining CommonJS imports after Rollup upgrade ([#26473](facebook/react#26473)) //<dan>//
- **[909c6dacf](facebook/react@909c6dacf )**: Update Rollup to 3.x ([#26442](facebook/react#26442)) //<Mark Erikson>//
- **[9c54b29b4](facebook/react@9c54b29b4 )**: Remove ReactFabricPublicInstance and used definition from ReactNativePrivateInterface ([#26437](facebook/react#26437)) //<Rubén Norte>//
- **[f77099b6f](facebook/react@f77099b6f )**: Remove layout effect warning on the server ([#26395](facebook/react#26395)) //<Ricky>//
- **[51a7c45f8](facebook/react@51a7c45f8 )**: Bugfix: SuspenseList incorrectly forces a fallback ([#26453](facebook/react#26453)) //<Andrew Clark>//
- **[afb3d51dc](facebook/react@afb3d51dc )**: Fix enableClientRenderFallbackOnTextMismatch flag ([#26457](facebook/react#26457)) //<Sebastian Markbåge>//
- **[8e17bfd14](facebook/react@8e17bfd14 )**: Make InternalInstanceHandle type opaque in ReactNativeTypes ([#26461](facebook/react#26461)) //<Rubén Norte>//
- **[b93b4f074](facebook/react@b93b4f074 )**: Should not throw for children of iframe or object ([#26458](facebook/react#26458)) //<Sebastian Markbåge>//
- **[c0b34bc5f](facebook/react@c0b34bc5f )**: chore: update links of docs and api ([#26455](facebook/react#26455)) //<Leedom>//
- **[ffb6733ee](facebook/react@ffb6733ee )**: fix docs link for useSyncExternalStore ([#26452](facebook/react#26452)) //<Valor(华洛)>//
- **[12a1d140e](facebook/react@12a1d140e )**: Don't prerender siblings of suspended component  ([#26380](facebook/react#26380)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 77ba161...ca01f35

jest_e2e[run_all_tests]

bypass-github-export-checks

Reviewed By: sammy-SC

Differential Revision: D44669450

fbshipit-source-id: f160aad4719a00df3ceeca78d5f3fcd0aa0f8437
jeongshin pushed a commit to jeongshin/react-native that referenced this pull request May 7, 2023
Summary:
This sync includes the following changes:
- **[ca01f359b](facebook/react@ca01f359b )**: Remove skipUnmountedBoundaries ([facebook#26489](facebook/react#26489)) //<Ricky>//
- **[43a70a610](facebook/react@43a70a610 )**: Limit the meaning of "custom element" to not include `is` ([facebook#26524](facebook/react#26524)) //<Sebastian Markbåge>//
- **[1308e49a6](facebook/react@1308e49a6 )**: [Flight Plugin] Scan for "use client" ([facebook#26474](facebook/react#26474)) //<dan>//
- **[1a1d61fed](facebook/react@1a1d61fed )**: Warn for ARIA typos on custom elements ([facebook#26523](facebook/react#26523)) //<Sebastian Markbåge>//
- **[73deff0d5](facebook/react@73deff0d5 )**: Refactor DOMProperty and CSSProperty ([facebook#26513](facebook/react#26513)) //<Sebastian Markbåge>//
- **[2d51251e6](facebook/react@2d51251e6 )**: Clean up deferRenderPhaseUpdateToNextBatch ([facebook#26511](facebook/react#26511)) //<Andrew Clark>//
- **[0ffc7f632](facebook/react@0ffc7f632 )**: Update useMemoCache test to confirm that cache persists across errors ([facebook#26510](facebook/react#26510)) //<Joseph Savona>//
- **[29a3be78b](facebook/react@29a3be78b )**: Move ReactDOMFloat to react-dom/src/ ([facebook#26514](facebook/react#26514)) //<Sebastian Markbåge>//
- **[4c2fc0190](facebook/react@4c2fc0190 )**: Generate safe javascript url instead of throwing with disableJavaScriptURLs is on ([facebook#26507](facebook/react#26507)) //<Sebastian Markbåge>//
- **[f0aafa1a7](facebook/react@f0aafa1a7 )**: Convert a few more tests to waitFor test helpers ([facebook#26509](facebook/react#26509)) //<Andrew Clark>//
- **[90995ef8b](facebook/react@90995ef8b )**: Delete "triangle" resuming fuzz tester ([facebook#26508](facebook/react#26508)) //<Andrew Clark>//
- **[f118b7ceb](facebook/react@f118b7ceb )**: [Flight] Gated test for dropped transport of undefined object values ([facebook#26478](facebook/react#26478)) //<Sebastian Silbermann>//
- **[fd0511c72](facebook/react@fd0511c72 )**: [Flight] Add support BigInt support ([facebook#26479](facebook/react#26479)) //<Sebastian Silbermann>//
- **[85de6fde5](facebook/react@85de6fde5 )**: Refactor DOM special cases per tags including controlled fields ([facebook#26501](facebook/react#26501)) //<Sebastian Markbåge>//
- **[1f5cdf8c7](facebook/react@1f5cdf8c7 )**: Update Suspense fuzz tests to use `act` ([facebook#26498](facebook/react#26498)) //<Andrew Clark>//
- **[f62cb39ee](facebook/react@f62cb39ee )**: Make disableSchedulerTimeoutInWorkLoop a static ff ([facebook#26497](facebook/react#26497)) //<Ricky>//
- **[41b4714f1](facebook/react@41b4714f1 )**: Remove disableNativeComponentFrames ([facebook#26490](facebook/react#26490)) //<Ricky>//
- **[fc90eb636](facebook/react@fc90eb636 )**: Codemod more tests to waitFor pattern ([facebook#26494](facebook/react#26494)) //<Andrew Clark>//
- **[e0bbc2662](facebook/react@e0bbc2662 )**: Improve tests that deal with microtasks ([facebook#26493](facebook/react#26493)) //<Andrew Clark>//
- **[8faf75193](facebook/react@8faf75193 )**: Codemod some expiration tests to waitForExpired ([facebook#26491](facebook/react#26491)) //<Andrew Clark>//
- **[8342a0992](facebook/react@8342a0992 )**: Remove unused feature flag disableSchedulerTimeoutBasedOnReactExpirationTime ([facebook#26488](facebook/react#26488)) //<Jan Kassens>//
- **[afea1d0c5](facebook/react@afea1d0c5 )**: [flow] make Flow suppressions explicit on the error ([facebook#26487](facebook/react#26487)) //<Jan Kassens>//
- **[768f965de](facebook/react@768f965de )**: Suspensily committing a prerendered tree ([facebook#26434](facebook/react#26434)) //<Andrew Clark>//
- **[d12bdcda6](facebook/react@d12bdcda6 )**: Fix Flow types of useEffectEvent ([facebook#26468](facebook/react#26468)) //<Sebastian Silbermann>//
- **[73b6435ca](facebook/react@73b6435ca )**: [Float][Fiber] Implement waitForCommitToBeReady for stylesheet resources ([facebook#26450](facebook/react#26450)) //<Josh Story>//
- **[175962c10](facebook/react@175962c10 )**: Fix remaining CommonJS imports after Rollup upgrade ([facebook#26473](facebook/react#26473)) //<dan>//
- **[909c6dacf](facebook/react@909c6dacf )**: Update Rollup to 3.x ([facebook#26442](facebook/react#26442)) //<Mark Erikson>//
- **[9c54b29b4](facebook/react@9c54b29b4 )**: Remove ReactFabricPublicInstance and used definition from ReactNativePrivateInterface ([facebook#26437](facebook/react#26437)) //<Rubén Norte>//
- **[f77099b6f](facebook/react@f77099b6f )**: Remove layout effect warning on the server ([facebook#26395](facebook/react#26395)) //<Ricky>//
- **[51a7c45f8](facebook/react@51a7c45f8 )**: Bugfix: SuspenseList incorrectly forces a fallback ([facebook#26453](facebook/react#26453)) //<Andrew Clark>//
- **[afb3d51dc](facebook/react@afb3d51dc )**: Fix enableClientRenderFallbackOnTextMismatch flag ([facebook#26457](facebook/react#26457)) //<Sebastian Markbåge>//
- **[8e17bfd14](facebook/react@8e17bfd14 )**: Make InternalInstanceHandle type opaque in ReactNativeTypes ([facebook#26461](facebook/react#26461)) //<Rubén Norte>//
- **[b93b4f074](facebook/react@b93b4f074 )**: Should not throw for children of iframe or object ([facebook#26458](facebook/react#26458)) //<Sebastian Markbåge>//
- **[c0b34bc5f](facebook/react@c0b34bc5f )**: chore: update links of docs and api ([facebook#26455](facebook/react#26455)) //<Leedom>//
- **[ffb6733ee](facebook/react@ffb6733ee )**: fix docs link for useSyncExternalStore ([facebook#26452](facebook/react#26452)) //<Valor(华洛)>//
- **[12a1d140e](facebook/react@12a1d140e )**: Don't prerender siblings of suspended component  ([facebook#26380](facebook/react#26380)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 77ba161...ca01f35

jest_e2e[run_all_tests]

bypass-github-export-checks

Reviewed By: sammy-SC

Differential Revision: D44669450

fbshipit-source-id: f160aad4719a00df3ceeca78d5f3fcd0aa0f8437
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
This sync includes the following changes:
- **[ca01f359b](facebook/react@ca01f359b )**: Remove skipUnmountedBoundaries ([facebook#26489](facebook/react#26489)) //<Ricky>//
- **[43a70a610](facebook/react@43a70a610 )**: Limit the meaning of "custom element" to not include `is` ([facebook#26524](facebook/react#26524)) //<Sebastian Markbåge>//
- **[1308e49a6](facebook/react@1308e49a6 )**: [Flight Plugin] Scan for "use client" ([facebook#26474](facebook/react#26474)) //<dan>//
- **[1a1d61fed](facebook/react@1a1d61fed )**: Warn for ARIA typos on custom elements ([facebook#26523](facebook/react#26523)) //<Sebastian Markbåge>//
- **[73deff0d5](facebook/react@73deff0d5 )**: Refactor DOMProperty and CSSProperty ([facebook#26513](facebook/react#26513)) //<Sebastian Markbåge>//
- **[2d51251e6](facebook/react@2d51251e6 )**: Clean up deferRenderPhaseUpdateToNextBatch ([facebook#26511](facebook/react#26511)) //<Andrew Clark>//
- **[0ffc7f632](facebook/react@0ffc7f632 )**: Update useMemoCache test to confirm that cache persists across errors ([facebook#26510](facebook/react#26510)) //<Joseph Savona>//
- **[29a3be78b](facebook/react@29a3be78b )**: Move ReactDOMFloat to react-dom/src/ ([facebook#26514](facebook/react#26514)) //<Sebastian Markbåge>//
- **[4c2fc0190](facebook/react@4c2fc0190 )**: Generate safe javascript url instead of throwing with disableJavaScriptURLs is on ([facebook#26507](facebook/react#26507)) //<Sebastian Markbåge>//
- **[f0aafa1a7](facebook/react@f0aafa1a7 )**: Convert a few more tests to waitFor test helpers ([facebook#26509](facebook/react#26509)) //<Andrew Clark>//
- **[90995ef8b](facebook/react@90995ef8b )**: Delete "triangle" resuming fuzz tester ([facebook#26508](facebook/react#26508)) //<Andrew Clark>//
- **[f118b7ceb](facebook/react@f118b7ceb )**: [Flight] Gated test for dropped transport of undefined object values ([facebook#26478](facebook/react#26478)) //<Sebastian Silbermann>//
- **[fd0511c72](facebook/react@fd0511c72 )**: [Flight] Add support BigInt support ([facebook#26479](facebook/react#26479)) //<Sebastian Silbermann>//
- **[85de6fde5](facebook/react@85de6fde5 )**: Refactor DOM special cases per tags including controlled fields ([facebook#26501](facebook/react#26501)) //<Sebastian Markbåge>//
- **[1f5cdf8c7](facebook/react@1f5cdf8c7 )**: Update Suspense fuzz tests to use `act` ([facebook#26498](facebook/react#26498)) //<Andrew Clark>//
- **[f62cb39ee](facebook/react@f62cb39ee )**: Make disableSchedulerTimeoutInWorkLoop a static ff ([facebook#26497](facebook/react#26497)) //<Ricky>//
- **[41b4714f1](facebook/react@41b4714f1 )**: Remove disableNativeComponentFrames ([facebook#26490](facebook/react#26490)) //<Ricky>//
- **[fc90eb636](facebook/react@fc90eb636 )**: Codemod more tests to waitFor pattern ([facebook#26494](facebook/react#26494)) //<Andrew Clark>//
- **[e0bbc2662](facebook/react@e0bbc2662 )**: Improve tests that deal with microtasks ([facebook#26493](facebook/react#26493)) //<Andrew Clark>//
- **[8faf75193](facebook/react@8faf75193 )**: Codemod some expiration tests to waitForExpired ([facebook#26491](facebook/react#26491)) //<Andrew Clark>//
- **[8342a0992](facebook/react@8342a0992 )**: Remove unused feature flag disableSchedulerTimeoutBasedOnReactExpirationTime ([facebook#26488](facebook/react#26488)) //<Jan Kassens>//
- **[afea1d0c5](facebook/react@afea1d0c5 )**: [flow] make Flow suppressions explicit on the error ([facebook#26487](facebook/react#26487)) //<Jan Kassens>//
- **[768f965de](facebook/react@768f965de )**: Suspensily committing a prerendered tree ([facebook#26434](facebook/react#26434)) //<Andrew Clark>//
- **[d12bdcda6](facebook/react@d12bdcda6 )**: Fix Flow types of useEffectEvent ([facebook#26468](facebook/react#26468)) //<Sebastian Silbermann>//
- **[73b6435ca](facebook/react@73b6435ca )**: [Float][Fiber] Implement waitForCommitToBeReady for stylesheet resources ([facebook#26450](facebook/react#26450)) //<Josh Story>//
- **[175962c10](facebook/react@175962c10 )**: Fix remaining CommonJS imports after Rollup upgrade ([facebook#26473](facebook/react#26473)) //<dan>//
- **[909c6dacf](facebook/react@909c6dacf )**: Update Rollup to 3.x ([facebook#26442](facebook/react#26442)) //<Mark Erikson>//
- **[9c54b29b4](facebook/react@9c54b29b4 )**: Remove ReactFabricPublicInstance and used definition from ReactNativePrivateInterface ([facebook#26437](facebook/react#26437)) //<Rubén Norte>//
- **[f77099b6f](facebook/react@f77099b6f )**: Remove layout effect warning on the server ([facebook#26395](facebook/react#26395)) //<Ricky>//
- **[51a7c45f8](facebook/react@51a7c45f8 )**: Bugfix: SuspenseList incorrectly forces a fallback ([facebook#26453](facebook/react#26453)) //<Andrew Clark>//
- **[afb3d51dc](facebook/react@afb3d51dc )**: Fix enableClientRenderFallbackOnTextMismatch flag ([facebook#26457](facebook/react#26457)) //<Sebastian Markbåge>//
- **[8e17bfd14](facebook/react@8e17bfd14 )**: Make InternalInstanceHandle type opaque in ReactNativeTypes ([facebook#26461](facebook/react#26461)) //<Rubén Norte>//
- **[b93b4f074](facebook/react@b93b4f074 )**: Should not throw for children of iframe or object ([facebook#26458](facebook/react#26458)) //<Sebastian Markbåge>//
- **[c0b34bc5f](facebook/react@c0b34bc5f )**: chore: update links of docs and api ([facebook#26455](facebook/react#26455)) //<Leedom>//
- **[ffb6733ee](facebook/react@ffb6733ee )**: fix docs link for useSyncExternalStore ([facebook#26452](facebook/react#26452)) //<Valor(华洛)>//
- **[12a1d140e](facebook/react@12a1d140e )**: Don't prerender siblings of suspended component  ([facebook#26380](facebook/react#26380)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 77ba161...ca01f35

jest_e2e[run_all_tests]

bypass-github-export-checks

Reviewed By: sammy-SC

Differential Revision: D44669450

fbshipit-source-id: f160aad4719a00df3ceeca78d5f3fcd0aa0f8437
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
This is a step towards getting rid of the meta programming in
DOMProperty and CSSProperty.

This moves isAttributeNameSafe and isUnitlessNumber to a separate shared
modules.

isUnitlessNumber is now a single switch instead of meta-programming.
There is a slight behavior change here in that I hard code a specific
set of vendor-prefixed attributes instead of prefixing all the unitless
properties. I based this list on what getComputedStyle returns in
current browsers. I removed Opera prefixes because they were [removed in
Opera](https://dev.opera.com/blog/css-vendor-prefixes-in-opera-12-50-snapshots/)
itself. I included the ms ones mentioned [in the original
PR](facebook@5abcce5).
These shouldn't really be used anymore anyway so should be pretty safe.
Worst case, they'll fallback to the other property if you specify both.

Finally I inline the mustUseProperty special cases - which are also the
only thing that uses propertyName. These are really all controlled
components and all booleans.

I'm making a small breaking change here by treating `checked` and
`selected` specially only on the `input` and `option` tags instead of
all tags. That's because those are the only DOM nodes that actually have
those properties but we used to set them as expandos instead of
attributes before. That's why one of the tests is updated to now use
`input` instead of testing an expando on a `div` which isn't a real use
case. Interestingly this also uncovered that we update checked twice for
some reason but keeping that logic for now.

Ideally `multiple` and `muted` should move into `select` and
`audio`/`video` respectively for the same reason.

No change to the attribute-behavior fixture.
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
This is a step towards getting rid of the meta programming in
DOMProperty and CSSProperty.

This moves isAttributeNameSafe and isUnitlessNumber to a separate shared
modules.

isUnitlessNumber is now a single switch instead of meta-programming.
There is a slight behavior change here in that I hard code a specific
set of vendor-prefixed attributes instead of prefixing all the unitless
properties. I based this list on what getComputedStyle returns in
current browsers. I removed Opera prefixes because they were [removed in
Opera](https://dev.opera.com/blog/css-vendor-prefixes-in-opera-12-50-snapshots/)
itself. I included the ms ones mentioned [in the original
PR](5abcce5).
These shouldn't really be used anymore anyway so should be pretty safe.
Worst case, they'll fallback to the other property if you specify both.

Finally I inline the mustUseProperty special cases - which are also the
only thing that uses propertyName. These are really all controlled
components and all booleans.

I'm making a small breaking change here by treating `checked` and
`selected` specially only on the `input` and `option` tags instead of
all tags. That's because those are the only DOM nodes that actually have
those properties but we used to set them as expandos instead of
attributes before. That's why one of the tests is updated to now use
`input` instead of testing an expando on a `div` which isn't a real use
case. Interestingly this also uncovered that we update checked twice for
some reason but keeping that logic for now.

Ideally `multiple` and `muted` should move into `select` and
`audio`/`video` respectively for the same reason.

No change to the attribute-behavior fixture.

DiffTrain build for commit 73deff0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants