Skip to content

Commit

Permalink
Hardcode disableIEWorkarounds for www (#28811)
Browse files Browse the repository at this point in the history
This has landed and is true everywhere, but let's keep the flag until it
lands in the stable release.

DiffTrain build for [84cb3b4](84cb3b4)
  • Loading branch information
rickhanlonii committed Apr 10, 2024
1 parent 7ea7a3b commit a0cbdd5
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 493 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ed3c65caf042f75fe2fdc2a5e568a9624c6175fb
84cb3b4cb250bd592f4eb9495e66b50d33c8cd1e
80 changes: 7 additions & 73 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ if (__DEV__) {
// Re-export dynamic flags from the www version.
var dynamicFeatureFlags = require("ReactFeatureFlags");

var disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds,
enableTrustedTypesIntegration =
var enableTrustedTypesIntegration =
dynamicFeatureFlags.enableTrustedTypesIntegration,
enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
enableLazyContextPropagation =
Expand Down Expand Up @@ -153,6 +152,7 @@ if (__DEV__) {
var enableProfilerTimer = true;
var enableProfilerCommitHooks = true;
var enableProfilerNestedUpdatePhase = true;
var disableIEWorkarounds = true;
var enableAsyncActions = true;

var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler;
Expand Down Expand Up @@ -5299,68 +5299,7 @@ if (__DEV__) {
var MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
var SVG_NAMESPACE = "http://www.w3.org/2000/svg";

var reusableSVGContainer;

function setInnerHTMLImpl(node, html) {
if (node.namespaceURI === SVG_NAMESPACE) {
{
if (enableTrustedTypesIntegration) {
// TODO: reconsider the text of this warning and when it should show
// before enabling the feature flag.
if (typeof trustedTypes !== "undefined") {
error(
"Using 'dangerouslySetInnerHTML' in an svg element with " +
"Trusted Types enabled in an Internet Explorer will cause " +
"the trusted value to be converted to string. Assigning string " +
"to 'innerHTML' will throw an error if Trusted Types are enforced. " +
"You can try to wrap your svg element inside a div and use 'dangerouslySetInnerHTML' " +
"on the enclosing div instead."
);
}
}
}

if (!("innerHTML" in node)) {
// IE does not have innerHTML for SVG nodes, so instead we inject the
// new markup in a temp node and then move the child nodes across into
// the target node
reusableSVGContainer =
reusableSVGContainer || document.createElement("div");
reusableSVGContainer.innerHTML =
"<svg>" + html.valueOf().toString() + "</svg>";
var svgNode = reusableSVGContainer.firstChild;

while (node.firstChild) {
node.removeChild(node.firstChild);
} // $FlowFixMe[incompatible-use]
// $FlowFixMe[incompatible-type]

while (svgNode.firstChild) {
node.appendChild(svgNode.firstChild);
}

return;
}
}

node.innerHTML = html;
}

var setInnerHTML = setInnerHTMLImpl; // $FlowFixMe[cannot-resolve-name]

if (typeof MSApp !== "undefined" && MSApp.execUnsafeLocalFunction) {
/**
* Create a function which has 'unsafe' privileges (required by windows8 apps)
*/
setInnerHTML = function (node, html) {
// $FlowFixMe[cannot-resolve-name]
return MSApp.execUnsafeLocalFunction(function () {
return setInnerHTMLImpl(node, html);
});
};
}

var setInnerHTML$1 = setInnerHTML;
if (typeof MSApp !== "undefined" && MSApp.execUnsafeLocalFunction);

/**
* HTML nodeType values that represent the type of the node
Expand Down Expand Up @@ -36156,7 +36095,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "19.0.0-www-classic-87a9d756";
var ReactVersion = "19.0.0-www-classic-204bdccf";

function createPortal$1(
children,
Expand Down Expand Up @@ -40737,8 +40676,7 @@ if (__DEV__) {
// in that browser completely in favor of doing all that work.
// See https://github.com/facebook/react/issues/11807

canDiffStyleForHydrationWarning =
disableIEWorkarounds || (canUseDOM && !document.documentMode);
canDiffStyleForHydrationWarning = disableIEWorkarounds;
}

function validatePropertiesInDevelopment(type, props) {
Expand Down Expand Up @@ -41258,10 +41196,8 @@ if (__DEV__) {
);
}

if (disableIEWorkarounds) {
{
domElement.innerHTML = nextHtml;
} else {
setInnerHTML$1(domElement, nextHtml);
}
}
}
Expand Down Expand Up @@ -41647,10 +41583,8 @@ if (__DEV__) {
);
}

if (disableIEWorkarounds) {
{
domElement.innerHTML = nextHtml;
} else {
setInnerHTML$1(domElement, nextHtml);
}
}
}
Expand Down
80 changes: 7 additions & 73 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ if (__DEV__) {
// Re-export dynamic flags from the www version.
var dynamicFeatureFlags = require("ReactFeatureFlags");

var disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds,
enableTrustedTypesIntegration =
var enableTrustedTypesIntegration =
dynamicFeatureFlags.enableTrustedTypesIntegration,
enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
enableLazyContextPropagation =
Expand Down Expand Up @@ -129,6 +128,7 @@ if (__DEV__) {
var enableProfilerTimer = true;
var enableProfilerCommitHooks = true;
var enableProfilerNestedUpdatePhase = true;
var disableIEWorkarounds = true;
var enableAsyncActions = true;

var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler;
Expand Down Expand Up @@ -5446,68 +5446,7 @@ if (__DEV__) {
var MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
var SVG_NAMESPACE = "http://www.w3.org/2000/svg";

var reusableSVGContainer;

function setInnerHTMLImpl(node, html) {
if (node.namespaceURI === SVG_NAMESPACE) {
{
if (enableTrustedTypesIntegration) {
// TODO: reconsider the text of this warning and when it should show
// before enabling the feature flag.
if (typeof trustedTypes !== "undefined") {
error(
"Using 'dangerouslySetInnerHTML' in an svg element with " +
"Trusted Types enabled in an Internet Explorer will cause " +
"the trusted value to be converted to string. Assigning string " +
"to 'innerHTML' will throw an error if Trusted Types are enforced. " +
"You can try to wrap your svg element inside a div and use 'dangerouslySetInnerHTML' " +
"on the enclosing div instead."
);
}
}
}

if (!("innerHTML" in node)) {
// IE does not have innerHTML for SVG nodes, so instead we inject the
// new markup in a temp node and then move the child nodes across into
// the target node
reusableSVGContainer =
reusableSVGContainer || document.createElement("div");
reusableSVGContainer.innerHTML =
"<svg>" + html.valueOf().toString() + "</svg>";
var svgNode = reusableSVGContainer.firstChild;

while (node.firstChild) {
node.removeChild(node.firstChild);
} // $FlowFixMe[incompatible-use]
// $FlowFixMe[incompatible-type]

while (svgNode.firstChild) {
node.appendChild(svgNode.firstChild);
}

return;
}
}

node.innerHTML = html;
}

var setInnerHTML = setInnerHTMLImpl; // $FlowFixMe[cannot-resolve-name]

if (typeof MSApp !== "undefined" && MSApp.execUnsafeLocalFunction) {
/**
* Create a function which has 'unsafe' privileges (required by windows8 apps)
*/
setInnerHTML = function (node, html) {
// $FlowFixMe[cannot-resolve-name]
return MSApp.execUnsafeLocalFunction(function () {
return setInnerHTMLImpl(node, html);
});
};
}

var setInnerHTML$1 = setInnerHTML;
if (typeof MSApp !== "undefined" && MSApp.execUnsafeLocalFunction);

/**
* HTML nodeType values that represent the type of the node
Expand Down Expand Up @@ -11523,8 +11462,7 @@ if (__DEV__) {
// in that browser completely in favor of doing all that work.
// See https://github.com/facebook/react/issues/11807

canDiffStyleForHydrationWarning =
disableIEWorkarounds || (canUseDOM && !document.documentMode);
canDiffStyleForHydrationWarning = disableIEWorkarounds;
}

function validatePropertiesInDevelopment(type, props) {
Expand Down Expand Up @@ -12044,10 +11982,8 @@ if (__DEV__) {
);
}

if (disableIEWorkarounds) {
{
domElement.innerHTML = nextHtml;
} else {
setInnerHTML$1(domElement, nextHtml);
}
}
}
Expand Down Expand Up @@ -12433,10 +12369,8 @@ if (__DEV__) {
);
}

if (disableIEWorkarounds) {
{
domElement.innerHTML = nextHtml;
} else {
setInnerHTML$1(domElement, nextHtml);
}
}
}
Expand Down Expand Up @@ -45652,7 +45586,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "19.0.0-www-modern-1c3b0b72";
var ReactVersion = "19.0.0-www-modern-c1fa481b";

function createPortal$1(
children,
Expand Down
38 changes: 5 additions & 33 deletions compiled/facebook-www/ReactDOM-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ function formatProdErrorMessage(code) {
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
dynamicFeatureFlags = require("ReactFeatureFlags"),
disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds,
enableTrustedTypesIntegration =
dynamicFeatureFlags.enableTrustedTypesIntegration,
enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
Expand Down Expand Up @@ -1268,29 +1267,6 @@ function initTextarea(element, value, defaultValue, children) {
null !== children &&
(element.value = children);
}
var reusableSVGContainer;
function setInnerHTMLImpl(node, html) {
if ("http://www.w3.org/2000/svg" !== node.namespaceURI || "innerHTML" in node)
node.innerHTML = html;
else {
reusableSVGContainer =
reusableSVGContainer || document.createElement("div");
reusableSVGContainer.innerHTML =
"<svg>" + html.valueOf().toString() + "</svg>";
for (html = reusableSVGContainer.firstChild; node.firstChild; )
node.removeChild(node.firstChild);
for (; html.firstChild; ) node.appendChild(html.firstChild);
}
}
var setInnerHTML = setInnerHTMLImpl;
"undefined" !== typeof MSApp &&
MSApp.execUnsafeLocalFunction &&
(setInnerHTML = function (node, html) {
return MSApp.execUnsafeLocalFunction(function () {
return setInnerHTMLImpl(node, html);
});
});
var setInnerHTML$1 = setInnerHTML;
function setTextContent(node, text) {
if (text) {
var firstChild = node.firstChild;
Expand Down Expand Up @@ -14402,9 +14378,7 @@ function setProp(domElement, tag, key, value, props, prevValue) {
key = value.__html;
if (null != key) {
if (null != props.children) throw Error(formatProdErrorMessage(60));
disableIEWorkarounds
? (domElement.innerHTML = key)
: setInnerHTML$1(domElement, key);
domElement.innerHTML = key;
}
}
break;
Expand Down Expand Up @@ -14616,9 +14590,7 @@ function setPropOnCustomElement(domElement, tag, key, value, props, prevValue) {
key = value.__html;
if (null != key) {
if (null != props.children) throw Error(formatProdErrorMessage(60));
disableIEWorkarounds
? (domElement.innerHTML = key)
: setInnerHTML$1(domElement, key);
domElement.innerHTML = key;
}
}
break;
Expand Down Expand Up @@ -16996,7 +16968,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1727 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-www-classic-1ce9ab8c",
version: "19.0.0-www-classic-aa655557",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2155 = {
Expand Down Expand Up @@ -17026,7 +16998,7 @@ var internals$jscomp$inline_2155 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-classic-1ce9ab8c"
reconcilerVersion: "19.0.0-www-classic-aa655557"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2156 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -17489,4 +17461,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-1ce9ab8c";
exports.version = "19.0.0-www-classic-aa655557";

0 comments on commit a0cbdd5

Please sign in to comment.