Skip to content

Commit

Permalink
Fix nodeName to UPPERCASE in insertStylesheetIntoRoot (#28255)
Browse files Browse the repository at this point in the history
## Summary

<!--
Explain the **motivation** for making this change. What existing problem
does the pull request solve?
-->

<img width="518" alt="image"
src="https://github.com/facebook/react/assets/18693190/6d12df76-7dae-403b-b486-4940992abe8d">

The condition `node.nodeName === 'link'` is always `false`, because
`node.nodeName` is Uppercase in specification. And the condition
`node.nodeName === 'LINK'` is unnecessary, because Fizz hoists tags when
it's `media` attribute is `"not all"`, whether it is a `link` or a
`style` (line 36):

https://github.com/facebook/react/blob/18cbcbf783377c5a22277a63ae41af54504502e0/packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetExternalRuntime.js#L30-L44

https://github.com/facebook/react/blob/18cbcbf783377c5a22277a63ae41af54504502e0/packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetInlineSource.js#L30-L44

DiffTrain build for [b75cc07](b75cc07)
  • Loading branch information
gnoff committed Sep 14, 2024
1 parent a2485b7 commit 36ded71
Show file tree
Hide file tree
Showing 34 changed files with 190 additions and 201 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3d95c43b8967d4dda1ec9a22f0d9ea4999fee8b8
b75cc078c5fda0d57135523a7a2f4e8d1536472f
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3d95c43b8967d4dda1ec9a22f0d9ea4999fee8b8
b75cc078c5fda0d57135523a7a2f4e8d1536472f
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -2001,7 +2001,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-classic-3d95c43b-20240913";
exports.version = "19.0.0-www-classic-b75cc078-20240914";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -1981,7 +1981,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-modern-3d95c43b-20240913";
exports.version = "19.0.0-www-modern-b75cc078-20240914";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,4 +665,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-3d95c43b-20240913";
exports.version = "19.0.0-www-classic-b75cc078-20240914";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,4 +665,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-3d95c43b-20240913";
exports.version = "19.0.0-www-modern-b75cc078-20240914";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-3d95c43b-20240913";
exports.version = "19.0.0-www-classic-b75cc078-20240914";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-3d95c43b-20240913";
exports.version = "19.0.0-www-modern-b75cc078-20240914";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17121,11 +17121,11 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-classic-3d95c43b-20240913",
version: "19.0.0-www-classic-b75cc078-20240914",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getInstanceFromNode,
reconcilerVersion: "19.0.0-www-classic-3d95c43b-20240913"
reconcilerVersion: "19.0.0-www-classic-b75cc078-20240914"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -17159,7 +17159,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-classic-3d95c43b-20240913";
exports.version = "19.0.0-www-classic-b75cc078-20240914";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -16567,11 +16567,11 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-modern-3d95c43b-20240913",
version: "19.0.0-www-modern-b75cc078-20240914",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getInstanceFromNode,
reconcilerVersion: "19.0.0-www-modern-3d95c43b-20240913"
reconcilerVersion: "19.0.0-www-modern-b75cc078-20240914"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -16605,7 +16605,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-modern-3d95c43b-20240913";
exports.version = "19.0.0-www-modern-b75cc078-20240914";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -10883,13 +10883,13 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1424 = {
bundleType: 0,
version: "19.0.0-www-classic-3d95c43b-20240913",
version: "19.0.0-www-classic-b75cc078-20240914",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: function () {
return null;
},
reconcilerVersion: "19.0.0-www-classic-3d95c43b-20240913"
reconcilerVersion: "19.0.0-www-classic-b75cc078-20240914"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1425 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -10915,4 +10915,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-classic-3d95c43b-20240913";
exports.version = "19.0.0-www-classic-b75cc078-20240914";
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -10397,13 +10397,13 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1416 = {
bundleType: 0,
version: "19.0.0-www-modern-3d95c43b-20240913",
version: "19.0.0-www-modern-b75cc078-20240914",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: function () {
return null;
},
reconcilerVersion: "19.0.0-www-modern-3d95c43b-20240913"
reconcilerVersion: "19.0.0-www-modern-b75cc078-20240914"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1417 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -10429,4 +10429,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-modern-3d95c43b-20240913";
exports.version = "19.0.0-www-modern-b75cc078-20240914";
32 changes: 17 additions & 15 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -18675,41 +18675,43 @@ __DEV__ &&
: !1;
}
function getActiveElementDeep(containerInfo) {
var $jscomp$optchain$tmpm180540846$1, $jscomp$nullish$tmp0;
var $jscomp$optchain$tmpm1084463550$1, $jscomp$nullish$tmp0;
containerInfo =
null !=
($jscomp$nullish$tmp0 =
null == containerInfo
? void 0
: null ==
($jscomp$optchain$tmpm180540846$1 = containerInfo.ownerDocument)
($jscomp$optchain$tmpm1084463550$1 =
containerInfo.ownerDocument)
? void 0
: $jscomp$optchain$tmpm180540846$1.defaultView)
: $jscomp$optchain$tmpm1084463550$1.defaultView)
? $jscomp$nullish$tmp0
: window;
for (
$jscomp$optchain$tmpm180540846$1 = getActiveElement(
$jscomp$optchain$tmpm1084463550$1 = getActiveElement(
containerInfo.document
);
$jscomp$optchain$tmpm180540846$1 instanceof
$jscomp$optchain$tmpm1084463550$1 instanceof
containerInfo.HTMLIFrameElement;

) {
try {
var JSCompiler_inline_result =
"string" ===
typeof $jscomp$optchain$tmpm180540846$1.contentWindow.location.href;
typeof $jscomp$optchain$tmpm1084463550$1.contentWindow.location
.href;
} catch (err) {
JSCompiler_inline_result = !1;
}
if (JSCompiler_inline_result)
containerInfo = $jscomp$optchain$tmpm180540846$1.contentWindow;
containerInfo = $jscomp$optchain$tmpm1084463550$1.contentWindow;
else break;
$jscomp$optchain$tmpm180540846$1 = getActiveElement(
$jscomp$optchain$tmpm1084463550$1 = getActiveElement(
containerInfo.document
);
}
return $jscomp$optchain$tmpm180540846$1;
return $jscomp$optchain$tmpm1084463550$1;
}
function hasSelectionCapabilities(elem) {
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
Expand Down Expand Up @@ -23134,7 +23136,7 @@ __DEV__ &&
) {
var node = nodes[i];
if (
"link" === node.nodeName ||
"LINK" === node.nodeName ||
"not all" !== node.getAttribute("media")
)
precedences.set(node.dataset.precedence, node), (last = node);
Expand Down Expand Up @@ -27875,11 +27877,11 @@ __DEV__ &&
: flushSyncErrorInBuildsThatSupportLegacyMode;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-www-classic-3d95c43b-20240913" !== isomorphicReactPackageVersion)
if ("19.0.0-www-classic-b75cc078-20240914" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-www-classic-3d95c43b-20240913\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-www-classic-b75cc078-20240914\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -27923,11 +27925,11 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-classic-3d95c43b-20240913",
version: "19.0.0-www-classic-b75cc078-20240914",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-www-classic-3d95c43b-20240913"
reconcilerVersion: "19.0.0-www-classic-b75cc078-20240914"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -28580,7 +28582,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-3d95c43b-20240913";
exports.version = "19.0.0-www-classic-b75cc078-20240914";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
30 changes: 15 additions & 15 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -18009,41 +18009,41 @@ __DEV__ &&
: !1;
}
function getActiveElementDeep(containerInfo) {
var $jscomp$optchain$tmpm468437908$1, $jscomp$nullish$tmp0;
var $jscomp$optchain$tmp1906584142$1, $jscomp$nullish$tmp0;
containerInfo =
null !=
($jscomp$nullish$tmp0 =
null == containerInfo
? void 0
: null ==
($jscomp$optchain$tmpm468437908$1 = containerInfo.ownerDocument)
($jscomp$optchain$tmp1906584142$1 = containerInfo.ownerDocument)
? void 0
: $jscomp$optchain$tmpm468437908$1.defaultView)
: $jscomp$optchain$tmp1906584142$1.defaultView)
? $jscomp$nullish$tmp0
: window;
for (
$jscomp$optchain$tmpm468437908$1 = getActiveElement(
$jscomp$optchain$tmp1906584142$1 = getActiveElement(
containerInfo.document
);
$jscomp$optchain$tmpm468437908$1 instanceof
$jscomp$optchain$tmp1906584142$1 instanceof
containerInfo.HTMLIFrameElement;

) {
try {
var JSCompiler_inline_result =
"string" ===
typeof $jscomp$optchain$tmpm468437908$1.contentWindow.location.href;
typeof $jscomp$optchain$tmp1906584142$1.contentWindow.location.href;
} catch (err) {
JSCompiler_inline_result = !1;
}
if (JSCompiler_inline_result)
containerInfo = $jscomp$optchain$tmpm468437908$1.contentWindow;
containerInfo = $jscomp$optchain$tmp1906584142$1.contentWindow;
else break;
$jscomp$optchain$tmpm468437908$1 = getActiveElement(
$jscomp$optchain$tmp1906584142$1 = getActiveElement(
containerInfo.document
);
}
return $jscomp$optchain$tmpm468437908$1;
return $jscomp$optchain$tmp1906584142$1;
}
function hasSelectionCapabilities(elem) {
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
Expand Down Expand Up @@ -22440,7 +22440,7 @@ __DEV__ &&
) {
var node = nodes[i];
if (
"link" === node.nodeName ||
"LINK" === node.nodeName ||
"not all" !== node.getAttribute("media")
)
precedences.set(node.dataset.precedence, node), (last = node);
Expand Down Expand Up @@ -26992,11 +26992,11 @@ __DEV__ &&
return_targetInst = null;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-www-modern-3d95c43b-20240913" !== isomorphicReactPackageVersion)
if ("19.0.0-www-modern-b75cc078-20240914" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-www-modern-3d95c43b-20240913\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-www-modern-b75cc078-20240914\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -27039,11 +27039,11 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-modern-3d95c43b-20240913",
version: "19.0.0-www-modern-b75cc078-20240914",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-www-modern-3d95c43b-20240913"
reconcilerVersion: "19.0.0-www-modern-b75cc078-20240914"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -27648,7 +27648,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-www-modern-3d95c43b-20240913";
exports.version = "19.0.0-www-modern-b75cc078-20240914";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Loading

0 comments on commit 36ded71

Please sign in to comment.