Skip to content

Commit a4e2d3c

Browse files
committed
Workaround against display: inline bug in Safari (#32822)
Safari has a bug where if you put a block element inside an inline element and the inline element has a `view-transition-name` assigned it finds it as duplicate names. https://bugs.webkit.org/show_bug.cgi?id=290923 This adds a warning if we detect this scenario in dev mode. For the case where it renders into a single block, we can model this by making the parent either `block` or `inline-block` automatically to fix the issue. So we do that to automatically cover simple cases like `<a><div>...</div></a>`. This unfortunately causes layout/styling thrash so we might want to delete it once the bug has been fixed in enough Safari versions. DiffTrain build for [365c031](365c031)
1 parent dc32e7c commit a4e2d3c

23 files changed

+606
-606
lines changed

compiled-rn/VERSION_NATIVE_FB

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19.2.0-native-fb-6a7650c7-20250405
1+
19.2.0-native-fb-365c031f-20250407

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-dev.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<ea8e5d8de6f333cf51feb72e49979c05>>
10+
* @generated SignedSource<<52edf16a687c4b18d61926b8b19f781f>>
1111
*/
1212

1313
"use strict";
@@ -404,5 +404,5 @@ __DEV__ &&
404404
exports.useFormStatus = function () {
405405
return resolveDispatcher().useHostTransitionStatus();
406406
};
407-
exports.version = "19.2.0-native-fb-6a7650c7-20250405";
407+
exports.version = "19.2.0-native-fb-365c031f-20250407";
408408
})();

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<3837e61bda649f4f83575a3fa138f9bc>>
10+
* @generated SignedSource<<482aa6006d06f863c931cecf924f85f2>>
1111
*/
1212

1313
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
203203
exports.useFormStatus = function () {
204204
return ReactSharedInternals.H.useHostTransitionStatus();
205205
};
206-
exports.version = "19.2.0-native-fb-6a7650c7-20250405";
206+
exports.version = "19.2.0-native-fb-365c031f-20250407";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<3837e61bda649f4f83575a3fa138f9bc>>
10+
* @generated SignedSource<<482aa6006d06f863c931cecf924f85f2>>
1111
*/
1212

1313
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
203203
exports.useFormStatus = function () {
204204
return ReactSharedInternals.H.useHostTransitionStatus();
205205
};
206-
exports.version = "19.2.0-native-fb-6a7650c7-20250405";
206+
exports.version = "19.2.0-native-fb-365c031f-20250407";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-dev.js

Lines changed: 167 additions & 167 deletions
Large diffs are not rendered by default.

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-prod.js

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<18d0107213b347f0b8d51a335717da4f>>
10+
* @generated SignedSource<<3d3a073564d0e01acb06ca8aa9d3f083>>
1111
*/
1212

1313
/*
@@ -12399,20 +12399,20 @@ function debounceScrollEnd(targetInst, nativeEvent, nativeEventTarget) {
1239912399
(nativeEventTarget[internalScrollTimer] = targetInst));
1240012400
}
1240112401
for (
12402-
var i$jscomp$inline_1535 = 0;
12403-
i$jscomp$inline_1535 < simpleEventPluginEvents.length;
12404-
i$jscomp$inline_1535++
12402+
var i$jscomp$inline_1544 = 0;
12403+
i$jscomp$inline_1544 < simpleEventPluginEvents.length;
12404+
i$jscomp$inline_1544++
1240512405
) {
12406-
var eventName$jscomp$inline_1536 =
12407-
simpleEventPluginEvents[i$jscomp$inline_1535],
12408-
domEventName$jscomp$inline_1537 =
12409-
eventName$jscomp$inline_1536.toLowerCase(),
12410-
capitalizedEvent$jscomp$inline_1538 =
12411-
eventName$jscomp$inline_1536[0].toUpperCase() +
12412-
eventName$jscomp$inline_1536.slice(1);
12406+
var eventName$jscomp$inline_1545 =
12407+
simpleEventPluginEvents[i$jscomp$inline_1544],
12408+
domEventName$jscomp$inline_1546 =
12409+
eventName$jscomp$inline_1545.toLowerCase(),
12410+
capitalizedEvent$jscomp$inline_1547 =
12411+
eventName$jscomp$inline_1545[0].toUpperCase() +
12412+
eventName$jscomp$inline_1545.slice(1);
1241312413
registerSimpleEvent(
12414-
domEventName$jscomp$inline_1537,
12415-
"on" + capitalizedEvent$jscomp$inline_1538
12414+
domEventName$jscomp$inline_1546,
12415+
"on" + capitalizedEvent$jscomp$inline_1547
1241612416
);
1241712417
}
1241812418
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
@@ -14776,26 +14776,26 @@ function getResource(type, currentProps, pendingProps, currentResource) {
1477614776
"string" === typeof pendingProps.precedence
1477714777
) {
1477814778
type = getStyleKey(pendingProps.href);
14779-
var styles$256 = getResourcesFromRoot(
14779+
var styles$257 = getResourcesFromRoot(
1478014780
JSCompiler_inline_result
1478114781
).hoistableStyles,
14782-
resource$257 = styles$256.get(type);
14783-
resource$257 ||
14782+
resource$258 = styles$257.get(type);
14783+
resource$258 ||
1478414784
((JSCompiler_inline_result =
1478514785
JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result),
14786-
(resource$257 = {
14786+
(resource$258 = {
1478714787
type: "stylesheet",
1478814788
instance: null,
1478914789
count: 0,
1479014790
state: { loading: 0, preload: null }
1479114791
}),
14792-
styles$256.set(type, resource$257),
14793-
(styles$256 = JSCompiler_inline_result.querySelector(
14792+
styles$257.set(type, resource$258),
14793+
(styles$257 = JSCompiler_inline_result.querySelector(
1479414794
getStylesheetSelectorFromKey(type)
1479514795
)) &&
14796-
!styles$256._p &&
14797-
((resource$257.instance = styles$256),
14798-
(resource$257.state.loading = 5)),
14796+
!styles$257._p &&
14797+
((resource$258.instance = styles$257),
14798+
(resource$258.state.loading = 5)),
1479914799
preloadPropsMap.has(type) ||
1480014800
((pendingProps = {
1480114801
rel: "preload",
@@ -14808,16 +14808,16 @@ function getResource(type, currentProps, pendingProps, currentResource) {
1480814808
referrerPolicy: pendingProps.referrerPolicy
1480914809
}),
1481014810
preloadPropsMap.set(type, pendingProps),
14811-
styles$256 ||
14811+
styles$257 ||
1481214812
preloadStylesheet(
1481314813
JSCompiler_inline_result,
1481414814
type,
1481514815
pendingProps,
14816-
resource$257.state
14816+
resource$258.state
1481714817
)));
1481814818
if (currentProps && null === currentResource)
1481914819
throw Error(formatProdErrorMessage(528, ""));
14820-
return resource$257;
14820+
return resource$258;
1482114821
}
1482214822
if (currentProps && null !== currentResource)
1482314823
throw Error(formatProdErrorMessage(529, ""));
@@ -14914,37 +14914,37 @@ function acquireResource(hoistableRoot, resource, props) {
1491414914
return (resource.instance = instance);
1491514915
case "stylesheet":
1491614916
styleProps = getStyleKey(props.href);
14917-
var instance$262 = hoistableRoot.querySelector(
14917+
var instance$263 = hoistableRoot.querySelector(
1491814918
getStylesheetSelectorFromKey(styleProps)
1491914919
);
14920-
if (instance$262)
14920+
if (instance$263)
1492114921
return (
1492214922
(resource.state.loading |= 4),
14923-
(resource.instance = instance$262),
14924-
markNodeAsHoistable(instance$262),
14925-
instance$262
14923+
(resource.instance = instance$263),
14924+
markNodeAsHoistable(instance$263),
14925+
instance$263
1492614926
);
1492714927
instance = stylesheetPropsFromRawProps(props);
1492814928
(styleProps = preloadPropsMap.get(styleProps)) &&
1492914929
adoptPreloadPropsForStylesheet(instance, styleProps);
14930-
instance$262 = (
14930+
instance$263 = (
1493114931
hoistableRoot.ownerDocument || hoistableRoot
1493214932
).createElement("link");
14933-
markNodeAsHoistable(instance$262);
14934-
var linkInstance = instance$262;
14933+
markNodeAsHoistable(instance$263);
14934+
var linkInstance = instance$263;
1493514935
linkInstance._p = new Promise(function (resolve, reject) {
1493614936
linkInstance.onload = resolve;
1493714937
linkInstance.onerror = reject;
1493814938
});
14939-
setInitialProperties(instance$262, "link", instance);
14939+
setInitialProperties(instance$263, "link", instance);
1494014940
resource.state.loading |= 4;
14941-
insertStylesheet(instance$262, props.precedence, hoistableRoot);
14942-
return (resource.instance = instance$262);
14941+
insertStylesheet(instance$263, props.precedence, hoistableRoot);
14942+
return (resource.instance = instance$263);
1494314943
case "script":
14944-
instance$262 = getScriptKey(props.src);
14944+
instance$263 = getScriptKey(props.src);
1494514945
if (
1494614946
(styleProps = hoistableRoot.querySelector(
14947-
getScriptSelectorFromKey(instance$262)
14947+
getScriptSelectorFromKey(instance$263)
1494814948
))
1494914949
)
1495014950
return (
@@ -14953,7 +14953,7 @@ function acquireResource(hoistableRoot, resource, props) {
1495314953
styleProps
1495414954
);
1495514955
instance = props;
14956-
if ((styleProps = preloadPropsMap.get(instance$262)))
14956+
if ((styleProps = preloadPropsMap.get(instance$263)))
1495714957
(instance = assign({}, props)),
1495814958
adoptPreloadPropsForScript(instance, styleProps);
1495914959
hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
@@ -16002,16 +16002,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1600216002
0 === i && attemptExplicitHydrationTarget(target);
1600316003
}
1600416004
};
16005-
var isomorphicReactPackageVersion$jscomp$inline_1789 = React.version;
16005+
var isomorphicReactPackageVersion$jscomp$inline_1798 = React.version;
1600616006
if (
16007-
"19.2.0-native-fb-6a7650c7-20250405" !==
16008-
isomorphicReactPackageVersion$jscomp$inline_1789
16007+
"19.2.0-native-fb-365c031f-20250407" !==
16008+
isomorphicReactPackageVersion$jscomp$inline_1798
1600916009
)
1601016010
throw Error(
1601116011
formatProdErrorMessage(
1601216012
527,
16013-
isomorphicReactPackageVersion$jscomp$inline_1789,
16014-
"19.2.0-native-fb-6a7650c7-20250405"
16013+
isomorphicReactPackageVersion$jscomp$inline_1798,
16014+
"19.2.0-native-fb-365c031f-20250407"
1601516015
)
1601616016
);
1601716017
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -16031,24 +16031,24 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1603116031
null === componentOrElement ? null : componentOrElement.stateNode;
1603216032
return componentOrElement;
1603316033
};
16034-
var internals$jscomp$inline_2239 = {
16034+
var internals$jscomp$inline_2254 = {
1603516035
bundleType: 0,
16036-
version: "19.2.0-native-fb-6a7650c7-20250405",
16036+
version: "19.2.0-native-fb-365c031f-20250407",
1603716037
rendererPackageName: "react-dom",
1603816038
currentDispatcherRef: ReactSharedInternals,
16039-
reconcilerVersion: "19.2.0-native-fb-6a7650c7-20250405"
16039+
reconcilerVersion: "19.2.0-native-fb-365c031f-20250407"
1604016040
};
1604116041
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
16042-
var hook$jscomp$inline_2240 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
16042+
var hook$jscomp$inline_2255 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
1604316043
if (
16044-
!hook$jscomp$inline_2240.isDisabled &&
16045-
hook$jscomp$inline_2240.supportsFiber
16044+
!hook$jscomp$inline_2255.isDisabled &&
16045+
hook$jscomp$inline_2255.supportsFiber
1604616046
)
1604716047
try {
16048-
(rendererID = hook$jscomp$inline_2240.inject(
16049-
internals$jscomp$inline_2239
16048+
(rendererID = hook$jscomp$inline_2255.inject(
16049+
internals$jscomp$inline_2254
1605016050
)),
16051-
(injectedHook = hook$jscomp$inline_2240);
16051+
(injectedHook = hook$jscomp$inline_2255);
1605216052
} catch (err) {}
1605316053
}
1605416054
exports.createRoot = function (container, options) {
@@ -16140,4 +16140,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1614016140
listenToAllSupportedEvents(container);
1614116141
return new ReactDOMHydrationRoot(initialChildren);
1614216142
};
16143-
exports.version = "19.2.0-native-fb-6a7650c7-20250405";
16143+
exports.version = "19.2.0-native-fb-365c031f-20250407";

0 commit comments

Comments
 (0)