diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index b2df9a6217dca..d4364b2c63e69 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -953cb02f6de2a9f3eb52456b263e11f839584bc6 +3566de59e2046e7e8478462375aaa71716f1095b diff --git a/compiled/facebook-www/ReactDOMServer-dev.classic.js b/compiled/facebook-www/ReactDOMServer-dev.classic.js index f28a33490c6b1..f65bcded1be1a 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.classic.js +++ b/compiled/facebook-www/ReactDOMServer-dev.classic.js @@ -19,7 +19,7 @@ if (__DEV__) { var React = require("react"); var ReactDOM = require("react-dom"); -var ReactVersion = "18.3.0-www-classic-12c31f96"; +var ReactVersion = "18.3.0-www-classic-605a9ce6"; // This refers to a WWW module. var warningWWW = require("warning"); @@ -2189,13 +2189,22 @@ var HTML_TABLE_BODY_MODE = 6; var HTML_TABLE_ROW_MODE = 7; var HTML_COLGROUP_MODE = 8; // We have a greater than HTML_TABLE_MODE check elsewhere. If you add more cases here, make sure it // still makes sense -// Lets us keep track of contextual state and pick it back up after suspending. -function createFormatContext(insertionMode, selectedValue, noscriptTagInScope) { +var NO_SCOPE = + /* */ + 0; +var NOSCRIPT_SCOPE = + /* */ + 1; +var PICTURE_SCOPE = + /* */ + 2; // Lets us keep track of contextual state and pick it back up after suspending. + +function createFormatContext(insertionMode, selectedValue, tagScope) { return { insertionMode: insertionMode, selectedValue: selectedValue, - noscriptTagInScope: noscriptTagInScope + tagScope: tagScope }; } @@ -2206,49 +2215,44 @@ function createRootFormatContext(namespaceURI) { : namespaceURI === "http://www.w3.org/1998/Math/MathML" ? MATHML_MODE : ROOT_HTML_MODE; - return createFormatContext(insertionMode, null, false); + return createFormatContext(insertionMode, null, NO_SCOPE); } function getChildFormatContext(parentContext, type, props) { switch (type) { case "noscript": - return createFormatContext(HTML_MODE, null, true); + return createFormatContext( + HTML_MODE, + null, + parentContext.tagScope | NOSCRIPT_SCOPE + ); case "select": return createFormatContext( HTML_MODE, props.value != null ? props.value : props.defaultValue, - parentContext.noscriptTagInScope + parentContext.tagScope ); case "svg": + return createFormatContext(SVG_MODE, null, parentContext.tagScope); + + case "picture": return createFormatContext( - SVG_MODE, + HTML_MODE, null, - parentContext.noscriptTagInScope + parentContext.tagScope | PICTURE_SCOPE ); case "math": - return createFormatContext( - MATHML_MODE, - null, - parentContext.noscriptTagInScope - ); + return createFormatContext(MATHML_MODE, null, parentContext.tagScope); case "foreignObject": - return createFormatContext( - HTML_MODE, - null, - parentContext.noscriptTagInScope - ); + return createFormatContext(HTML_MODE, null, parentContext.tagScope); // Table parents are special in that their children can only be created at all if they're // wrapped in a table parent. So we need to encode that we're entering this mode. case "table": - return createFormatContext( - HTML_TABLE_MODE, - null, - parentContext.noscriptTagInScope - ); + return createFormatContext(HTML_TABLE_MODE, null, parentContext.tagScope); case "thead": case "tbody": @@ -2256,45 +2260,41 @@ function getChildFormatContext(parentContext, type, props) { return createFormatContext( HTML_TABLE_BODY_MODE, null, - parentContext.noscriptTagInScope + parentContext.tagScope ); case "colgroup": return createFormatContext( HTML_COLGROUP_MODE, null, - parentContext.noscriptTagInScope + parentContext.tagScope ); case "tr": return createFormatContext( HTML_TABLE_ROW_MODE, null, - parentContext.noscriptTagInScope + parentContext.tagScope ); } if (parentContext.insertionMode >= HTML_TABLE_MODE) { // Whatever tag this was, it wasn't a table parent or other special parent, so we must have // entered plain HTML again. - return createFormatContext( - HTML_MODE, - null, - parentContext.noscriptTagInScope - ); + return createFormatContext(HTML_MODE, null, parentContext.tagScope); } if (parentContext.insertionMode === ROOT_HTML_MODE) { if (type === "html") { // We've emitted the root and is now in mode. - return createFormatContext(HTML_HTML_MODE, null, false); + return createFormatContext(HTML_HTML_MODE, null, parentContext.tagScope); } else { // We've emitted the root and is now in plain HTML mode. - return createFormatContext(HTML_MODE, null, false); + return createFormatContext(HTML_MODE, null, parentContext.tagScope); } } else if (parentContext.insertionMode === HTML_HTML_MODE) { // We've emitted the document element and is now in plain HTML mode. - return createFormatContext(HTML_MODE, null, false); + return createFormatContext(HTML_MODE, null, parentContext.tagScope); } return parentContext; @@ -4070,14 +4070,15 @@ function getImagePreloadKey(href, imageSrcSet, imageSizes) { return getResourceKey("image", uniquePart); } -function pushImg(target, props, resumableState) { +function pushImg(target, props, resumableState, pictureTagInScope) { var src = props.src, srcSet = props.srcSet; if ( props.loading !== "lazy" && (typeof src === "string" || typeof srcSet === "string") && - props.fetchPriority !== "low" && // We exclude data URIs in src and srcSet since these should not be preloaded + props.fetchPriority !== "low" && + pictureTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded !( typeof src === "string" && src[4] === ":" && @@ -4778,7 +4779,7 @@ function pushStartInstance( props, renderState, formatContext.insertionMode, - formatContext.noscriptTagInScope + !!(formatContext.tagScope & NOSCRIPT_SCOPE) ); case "link": @@ -4789,7 +4790,7 @@ function pushStartInstance( renderState, textEmbedded, formatContext.insertionMode, - formatContext.noscriptTagInScope + !!(formatContext.tagScope & NOSCRIPT_SCOPE) ); case "script": @@ -4799,7 +4800,7 @@ function pushStartInstance( resumableState, textEmbedded, formatContext.insertionMode, - formatContext.noscriptTagInScope + !!(formatContext.tagScope & NOSCRIPT_SCOPE) ); case "style": @@ -4810,7 +4811,7 @@ function pushStartInstance( renderState, textEmbedded, formatContext.insertionMode, - formatContext.noscriptTagInScope + !!(formatContext.tagScope & NOSCRIPT_SCOPE) ); case "meta": @@ -4820,7 +4821,7 @@ function pushStartInstance( renderState, textEmbedded, formatContext.insertionMode, - formatContext.noscriptTagInScope + !!(formatContext.tagScope & NOSCRIPT_SCOPE) ); // Newline eating tags @@ -4830,7 +4831,12 @@ function pushStartInstance( } case "img": { - return pushImg(target, props, resumableState); + return pushImg( + target, + props, + resumableState, + !!(formatContext.tagScope & PICTURE_SCOPE) + ); } // Omitted close tags diff --git a/compiled/facebook-www/ReactDOMServer-dev.modern.js b/compiled/facebook-www/ReactDOMServer-dev.modern.js index ae0d15e90d5ef..09c116641630c 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServer-dev.modern.js @@ -19,7 +19,7 @@ if (__DEV__) { var React = require("react"); var ReactDOM = require("react-dom"); -var ReactVersion = "18.3.0-www-modern-f69016b7"; +var ReactVersion = "18.3.0-www-modern-4a509011"; // This refers to a WWW module. var warningWWW = require("warning"); @@ -2189,13 +2189,22 @@ var HTML_TABLE_BODY_MODE = 6; var HTML_TABLE_ROW_MODE = 7; var HTML_COLGROUP_MODE = 8; // We have a greater than HTML_TABLE_MODE check elsewhere. If you add more cases here, make sure it // still makes sense -// Lets us keep track of contextual state and pick it back up after suspending. -function createFormatContext(insertionMode, selectedValue, noscriptTagInScope) { +var NO_SCOPE = + /* */ + 0; +var NOSCRIPT_SCOPE = + /* */ + 1; +var PICTURE_SCOPE = + /* */ + 2; // Lets us keep track of contextual state and pick it back up after suspending. + +function createFormatContext(insertionMode, selectedValue, tagScope) { return { insertionMode: insertionMode, selectedValue: selectedValue, - noscriptTagInScope: noscriptTagInScope + tagScope: tagScope }; } @@ -2206,49 +2215,44 @@ function createRootFormatContext(namespaceURI) { : namespaceURI === "http://www.w3.org/1998/Math/MathML" ? MATHML_MODE : ROOT_HTML_MODE; - return createFormatContext(insertionMode, null, false); + return createFormatContext(insertionMode, null, NO_SCOPE); } function getChildFormatContext(parentContext, type, props) { switch (type) { case "noscript": - return createFormatContext(HTML_MODE, null, true); + return createFormatContext( + HTML_MODE, + null, + parentContext.tagScope | NOSCRIPT_SCOPE + ); case "select": return createFormatContext( HTML_MODE, props.value != null ? props.value : props.defaultValue, - parentContext.noscriptTagInScope + parentContext.tagScope ); case "svg": + return createFormatContext(SVG_MODE, null, parentContext.tagScope); + + case "picture": return createFormatContext( - SVG_MODE, + HTML_MODE, null, - parentContext.noscriptTagInScope + parentContext.tagScope | PICTURE_SCOPE ); case "math": - return createFormatContext( - MATHML_MODE, - null, - parentContext.noscriptTagInScope - ); + return createFormatContext(MATHML_MODE, null, parentContext.tagScope); case "foreignObject": - return createFormatContext( - HTML_MODE, - null, - parentContext.noscriptTagInScope - ); + return createFormatContext(HTML_MODE, null, parentContext.tagScope); // Table parents are special in that their children can only be created at all if they're // wrapped in a table parent. So we need to encode that we're entering this mode. case "table": - return createFormatContext( - HTML_TABLE_MODE, - null, - parentContext.noscriptTagInScope - ); + return createFormatContext(HTML_TABLE_MODE, null, parentContext.tagScope); case "thead": case "tbody": @@ -2256,45 +2260,41 @@ function getChildFormatContext(parentContext, type, props) { return createFormatContext( HTML_TABLE_BODY_MODE, null, - parentContext.noscriptTagInScope + parentContext.tagScope ); case "colgroup": return createFormatContext( HTML_COLGROUP_MODE, null, - parentContext.noscriptTagInScope + parentContext.tagScope ); case "tr": return createFormatContext( HTML_TABLE_ROW_MODE, null, - parentContext.noscriptTagInScope + parentContext.tagScope ); } if (parentContext.insertionMode >= HTML_TABLE_MODE) { // Whatever tag this was, it wasn't a table parent or other special parent, so we must have // entered plain HTML again. - return createFormatContext( - HTML_MODE, - null, - parentContext.noscriptTagInScope - ); + return createFormatContext(HTML_MODE, null, parentContext.tagScope); } if (parentContext.insertionMode === ROOT_HTML_MODE) { if (type === "html") { // We've emitted the root and is now in mode. - return createFormatContext(HTML_HTML_MODE, null, false); + return createFormatContext(HTML_HTML_MODE, null, parentContext.tagScope); } else { // We've emitted the root and is now in plain HTML mode. - return createFormatContext(HTML_MODE, null, false); + return createFormatContext(HTML_MODE, null, parentContext.tagScope); } } else if (parentContext.insertionMode === HTML_HTML_MODE) { // We've emitted the document element and is now in plain HTML mode. - return createFormatContext(HTML_MODE, null, false); + return createFormatContext(HTML_MODE, null, parentContext.tagScope); } return parentContext; @@ -4070,14 +4070,15 @@ function getImagePreloadKey(href, imageSrcSet, imageSizes) { return getResourceKey("image", uniquePart); } -function pushImg(target, props, resumableState) { +function pushImg(target, props, resumableState, pictureTagInScope) { var src = props.src, srcSet = props.srcSet; if ( props.loading !== "lazy" && (typeof src === "string" || typeof srcSet === "string") && - props.fetchPriority !== "low" && // We exclude data URIs in src and srcSet since these should not be preloaded + props.fetchPriority !== "low" && + pictureTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded !( typeof src === "string" && src[4] === ":" && @@ -4778,7 +4779,7 @@ function pushStartInstance( props, renderState, formatContext.insertionMode, - formatContext.noscriptTagInScope + !!(formatContext.tagScope & NOSCRIPT_SCOPE) ); case "link": @@ -4789,7 +4790,7 @@ function pushStartInstance( renderState, textEmbedded, formatContext.insertionMode, - formatContext.noscriptTagInScope + !!(formatContext.tagScope & NOSCRIPT_SCOPE) ); case "script": @@ -4799,7 +4800,7 @@ function pushStartInstance( resumableState, textEmbedded, formatContext.insertionMode, - formatContext.noscriptTagInScope + !!(formatContext.tagScope & NOSCRIPT_SCOPE) ); case "style": @@ -4810,7 +4811,7 @@ function pushStartInstance( renderState, textEmbedded, formatContext.insertionMode, - formatContext.noscriptTagInScope + !!(formatContext.tagScope & NOSCRIPT_SCOPE) ); case "meta": @@ -4820,7 +4821,7 @@ function pushStartInstance( renderState, textEmbedded, formatContext.insertionMode, - formatContext.noscriptTagInScope + !!(formatContext.tagScope & NOSCRIPT_SCOPE) ); // Newline eating tags @@ -4830,7 +4831,12 @@ function pushStartInstance( } case "img": { - return pushImg(target, props, resumableState); + return pushImg( + target, + props, + resumableState, + !!(formatContext.tagScope & PICTURE_SCOPE) + ); } // Omitted close tags diff --git a/compiled/facebook-www/ReactDOMServer-prod.classic.js b/compiled/facebook-www/ReactDOMServer-prod.classic.js index 9f89057a1d5e7..69e541e484454 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.classic.js +++ b/compiled/facebook-www/ReactDOMServer-prod.classic.js @@ -378,48 +378,50 @@ function createResumableState( identifierPrefix.push('" async="">\x3c/script>'); return bootstrapScriptContent; } -function createFormatContext(insertionMode, selectedValue, noscriptTagInScope) { +function createFormatContext(insertionMode, selectedValue, tagScope) { return { insertionMode: insertionMode, selectedValue: selectedValue, - noscriptTagInScope: noscriptTagInScope + tagScope: tagScope }; } function getChildFormatContext(parentContext, type, props) { switch (type) { case "noscript": - return createFormatContext(2, null, !0); + return createFormatContext(2, null, parentContext.tagScope | 1); case "select": return createFormatContext( 2, null != props.value ? props.value : props.defaultValue, - parentContext.noscriptTagInScope + parentContext.tagScope ); case "svg": - return createFormatContext(3, null, parentContext.noscriptTagInScope); + return createFormatContext(3, null, parentContext.tagScope); + case "picture": + return createFormatContext(2, null, parentContext.tagScope | 2); case "math": - return createFormatContext(4, null, parentContext.noscriptTagInScope); + return createFormatContext(4, null, parentContext.tagScope); case "foreignObject": - return createFormatContext(2, null, parentContext.noscriptTagInScope); + return createFormatContext(2, null, parentContext.tagScope); case "table": - return createFormatContext(5, null, parentContext.noscriptTagInScope); + return createFormatContext(5, null, parentContext.tagScope); case "thead": case "tbody": case "tfoot": - return createFormatContext(6, null, parentContext.noscriptTagInScope); + return createFormatContext(6, null, parentContext.tagScope); case "colgroup": - return createFormatContext(8, null, parentContext.noscriptTagInScope); + return createFormatContext(8, null, parentContext.tagScope); case "tr": - return createFormatContext(7, null, parentContext.noscriptTagInScope); + return createFormatContext(7, null, parentContext.tagScope); } return 5 <= parentContext.insertionMode - ? createFormatContext(2, null, parentContext.noscriptTagInScope) + ? createFormatContext(2, null, parentContext.tagScope) : 0 === parentContext.insertionMode ? "html" === type - ? createFormatContext(1, null, !1) - : createFormatContext(2, null, !1) + ? createFormatContext(1, null, parentContext.tagScope) + : createFormatContext(2, null, parentContext.tagScope) : 1 === parentContext.insertionMode - ? createFormatContext(2, null, !1) + ? createFormatContext(2, null, parentContext.tagScope) : parentContext; } var styleNameCache = new Map(); @@ -1263,7 +1265,7 @@ function pushStartInstance( case "title": if ( 3 === formatContext.insertionMode || - formatContext.noscriptTagInScope || + formatContext.tagScope & 1 || null != props.itemProp ) var JSCompiler_inline_result$jscomp$1 = pushTitleImpl( @@ -1282,7 +1284,7 @@ function pushStartInstance( renderState, textEmbedded, formatContext.insertionMode, - formatContext.noscriptTagInScope + !!(formatContext.tagScope & 1) ); case "script": var asyncProp = props.async; @@ -1295,7 +1297,7 @@ function pushStartInstance( props.onLoad || props.onError || 3 === formatContext.insertionMode || - formatContext.noscriptTagInScope || + formatContext.tagScope & 1 || null != props.itemProp ) var JSCompiler_inline_result$jscomp$2 = pushScriptImpl( @@ -1331,7 +1333,7 @@ function pushStartInstance( href = props.href; if ( 3 === formatContext.insertionMode || - formatContext.noscriptTagInScope || + formatContext.tagScope & 1 || null != props.itemProp || "string" !== typeof precedence || "string" !== typeof href || @@ -1433,7 +1435,7 @@ function pushStartInstance( case "meta": if ( 3 === formatContext.insertionMode || - formatContext.noscriptTagInScope || + formatContext.tagScope & 1 || null != props.itemProp ) var JSCompiler_inline_result$jscomp$4 = pushSelfClosing( @@ -1501,6 +1503,7 @@ function pushStartInstance( "lazy" !== props.loading && ("string" === typeof src || "string" === typeof srcSet) && "low" !== props.fetchPriority && + !1 === !!(formatContext.tagScope & 2) && ("string" !== typeof src || ":" !== src[4] || ("d" !== src[0] && "D" !== src[0]) || @@ -4380,7 +4383,7 @@ function renderToStringImpl( children, options, createRenderState(options, void 0, generateStaticMarkup), - createFormatContext(0, null, !1), + createFormatContext(0, null, 0), Infinity, onError, void 0, @@ -4431,4 +4434,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "18.3.0-www-classic-5ae5e167"; +exports.version = "18.3.0-www-classic-25483e90"; diff --git a/compiled/facebook-www/ReactDOMServer-prod.modern.js b/compiled/facebook-www/ReactDOMServer-prod.modern.js index 0e649e01803ee..ca9df17cfed79 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.modern.js +++ b/compiled/facebook-www/ReactDOMServer-prod.modern.js @@ -378,48 +378,50 @@ function createResumableState( identifierPrefix.push('" async="">\x3c/script>'); return bootstrapScriptContent; } -function createFormatContext(insertionMode, selectedValue, noscriptTagInScope) { +function createFormatContext(insertionMode, selectedValue, tagScope) { return { insertionMode: insertionMode, selectedValue: selectedValue, - noscriptTagInScope: noscriptTagInScope + tagScope: tagScope }; } function getChildFormatContext(parentContext, type, props) { switch (type) { case "noscript": - return createFormatContext(2, null, !0); + return createFormatContext(2, null, parentContext.tagScope | 1); case "select": return createFormatContext( 2, null != props.value ? props.value : props.defaultValue, - parentContext.noscriptTagInScope + parentContext.tagScope ); case "svg": - return createFormatContext(3, null, parentContext.noscriptTagInScope); + return createFormatContext(3, null, parentContext.tagScope); + case "picture": + return createFormatContext(2, null, parentContext.tagScope | 2); case "math": - return createFormatContext(4, null, parentContext.noscriptTagInScope); + return createFormatContext(4, null, parentContext.tagScope); case "foreignObject": - return createFormatContext(2, null, parentContext.noscriptTagInScope); + return createFormatContext(2, null, parentContext.tagScope); case "table": - return createFormatContext(5, null, parentContext.noscriptTagInScope); + return createFormatContext(5, null, parentContext.tagScope); case "thead": case "tbody": case "tfoot": - return createFormatContext(6, null, parentContext.noscriptTagInScope); + return createFormatContext(6, null, parentContext.tagScope); case "colgroup": - return createFormatContext(8, null, parentContext.noscriptTagInScope); + return createFormatContext(8, null, parentContext.tagScope); case "tr": - return createFormatContext(7, null, parentContext.noscriptTagInScope); + return createFormatContext(7, null, parentContext.tagScope); } return 5 <= parentContext.insertionMode - ? createFormatContext(2, null, parentContext.noscriptTagInScope) + ? createFormatContext(2, null, parentContext.tagScope) : 0 === parentContext.insertionMode ? "html" === type - ? createFormatContext(1, null, !1) - : createFormatContext(2, null, !1) + ? createFormatContext(1, null, parentContext.tagScope) + : createFormatContext(2, null, parentContext.tagScope) : 1 === parentContext.insertionMode - ? createFormatContext(2, null, !1) + ? createFormatContext(2, null, parentContext.tagScope) : parentContext; } var styleNameCache = new Map(); @@ -1263,7 +1265,7 @@ function pushStartInstance( case "title": if ( 3 === formatContext.insertionMode || - formatContext.noscriptTagInScope || + formatContext.tagScope & 1 || null != props.itemProp ) var JSCompiler_inline_result$jscomp$1 = pushTitleImpl( @@ -1282,7 +1284,7 @@ function pushStartInstance( renderState, textEmbedded, formatContext.insertionMode, - formatContext.noscriptTagInScope + !!(formatContext.tagScope & 1) ); case "script": var asyncProp = props.async; @@ -1295,7 +1297,7 @@ function pushStartInstance( props.onLoad || props.onError || 3 === formatContext.insertionMode || - formatContext.noscriptTagInScope || + formatContext.tagScope & 1 || null != props.itemProp ) var JSCompiler_inline_result$jscomp$2 = pushScriptImpl( @@ -1331,7 +1333,7 @@ function pushStartInstance( href = props.href; if ( 3 === formatContext.insertionMode || - formatContext.noscriptTagInScope || + formatContext.tagScope & 1 || null != props.itemProp || "string" !== typeof precedence || "string" !== typeof href || @@ -1433,7 +1435,7 @@ function pushStartInstance( case "meta": if ( 3 === formatContext.insertionMode || - formatContext.noscriptTagInScope || + formatContext.tagScope & 1 || null != props.itemProp ) var JSCompiler_inline_result$jscomp$4 = pushSelfClosing( @@ -1501,6 +1503,7 @@ function pushStartInstance( "lazy" !== props.loading && ("string" === typeof src || "string" === typeof srcSet) && "low" !== props.fetchPriority && + !1 === !!(formatContext.tagScope & 2) && ("string" !== typeof src || ":" !== src[4] || ("d" !== src[0] && "D" !== src[0]) || @@ -4354,7 +4357,7 @@ function renderToStringImpl( children, options, createRenderState(options, void 0, generateStaticMarkup), - createFormatContext(0, null, !1), + createFormatContext(0, null, 0), Infinity, onError, void 0, @@ -4405,4 +4408,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "18.3.0-www-modern-91b9be2c"; +exports.version = "18.3.0-www-modern-9a25d12d"; diff --git a/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js b/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js index 4d980b7f6ed18..3706a2921c123 100644 --- a/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js @@ -2186,13 +2186,22 @@ var HTML_TABLE_BODY_MODE = 6; var HTML_TABLE_ROW_MODE = 7; var HTML_COLGROUP_MODE = 8; // We have a greater than HTML_TABLE_MODE check elsewhere. If you add more cases here, make sure it // still makes sense -// Lets us keep track of contextual state and pick it back up after suspending. -function createFormatContext(insertionMode, selectedValue, noscriptTagInScope) { +var NO_SCOPE = + /* */ + 0; +var NOSCRIPT_SCOPE = + /* */ + 1; +var PICTURE_SCOPE = + /* */ + 2; // Lets us keep track of contextual state and pick it back up after suspending. + +function createFormatContext(insertionMode, selectedValue, tagScope) { return { insertionMode: insertionMode, selectedValue: selectedValue, - noscriptTagInScope: noscriptTagInScope + tagScope: tagScope }; } @@ -2203,49 +2212,44 @@ function createRootFormatContext(namespaceURI) { : namespaceURI === "http://www.w3.org/1998/Math/MathML" ? MATHML_MODE : ROOT_HTML_MODE; - return createFormatContext(insertionMode, null, false); + return createFormatContext(insertionMode, null, NO_SCOPE); } function getChildFormatContext(parentContext, type, props) { switch (type) { case "noscript": - return createFormatContext(HTML_MODE, null, true); + return createFormatContext( + HTML_MODE, + null, + parentContext.tagScope | NOSCRIPT_SCOPE + ); case "select": return createFormatContext( HTML_MODE, props.value != null ? props.value : props.defaultValue, - parentContext.noscriptTagInScope + parentContext.tagScope ); case "svg": + return createFormatContext(SVG_MODE, null, parentContext.tagScope); + + case "picture": return createFormatContext( - SVG_MODE, + HTML_MODE, null, - parentContext.noscriptTagInScope + parentContext.tagScope | PICTURE_SCOPE ); case "math": - return createFormatContext( - MATHML_MODE, - null, - parentContext.noscriptTagInScope - ); + return createFormatContext(MATHML_MODE, null, parentContext.tagScope); case "foreignObject": - return createFormatContext( - HTML_MODE, - null, - parentContext.noscriptTagInScope - ); + return createFormatContext(HTML_MODE, null, parentContext.tagScope); // Table parents are special in that their children can only be created at all if they're // wrapped in a table parent. So we need to encode that we're entering this mode. case "table": - return createFormatContext( - HTML_TABLE_MODE, - null, - parentContext.noscriptTagInScope - ); + return createFormatContext(HTML_TABLE_MODE, null, parentContext.tagScope); case "thead": case "tbody": @@ -2253,45 +2257,41 @@ function getChildFormatContext(parentContext, type, props) { return createFormatContext( HTML_TABLE_BODY_MODE, null, - parentContext.noscriptTagInScope + parentContext.tagScope ); case "colgroup": return createFormatContext( HTML_COLGROUP_MODE, null, - parentContext.noscriptTagInScope + parentContext.tagScope ); case "tr": return createFormatContext( HTML_TABLE_ROW_MODE, null, - parentContext.noscriptTagInScope + parentContext.tagScope ); } if (parentContext.insertionMode >= HTML_TABLE_MODE) { // Whatever tag this was, it wasn't a table parent or other special parent, so we must have // entered plain HTML again. - return createFormatContext( - HTML_MODE, - null, - parentContext.noscriptTagInScope - ); + return createFormatContext(HTML_MODE, null, parentContext.tagScope); } if (parentContext.insertionMode === ROOT_HTML_MODE) { if (type === "html") { // We've emitted the root and is now in mode. - return createFormatContext(HTML_HTML_MODE, null, false); + return createFormatContext(HTML_HTML_MODE, null, parentContext.tagScope); } else { // We've emitted the root and is now in plain HTML mode. - return createFormatContext(HTML_MODE, null, false); + return createFormatContext(HTML_MODE, null, parentContext.tagScope); } } else if (parentContext.insertionMode === HTML_HTML_MODE) { // We've emitted the document element and is now in plain HTML mode. - return createFormatContext(HTML_MODE, null, false); + return createFormatContext(HTML_MODE, null, parentContext.tagScope); } return parentContext; @@ -4062,14 +4062,15 @@ function getImagePreloadKey(href, imageSrcSet, imageSizes) { return getResourceKey("image", uniquePart); } -function pushImg(target, props, resumableState) { +function pushImg(target, props, resumableState, pictureTagInScope) { var src = props.src, srcSet = props.srcSet; if ( props.loading !== "lazy" && (typeof src === "string" || typeof srcSet === "string") && - props.fetchPriority !== "low" && // We exclude data URIs in src and srcSet since these should not be preloaded + props.fetchPriority !== "low" && + pictureTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded !( typeof src === "string" && src[4] === ":" && @@ -4772,7 +4773,7 @@ function pushStartInstance( props, renderState, formatContext.insertionMode, - formatContext.noscriptTagInScope + !!(formatContext.tagScope & NOSCRIPT_SCOPE) ); case "link": @@ -4783,7 +4784,7 @@ function pushStartInstance( renderState, textEmbedded, formatContext.insertionMode, - formatContext.noscriptTagInScope + !!(formatContext.tagScope & NOSCRIPT_SCOPE) ); case "script": @@ -4793,7 +4794,7 @@ function pushStartInstance( resumableState, textEmbedded, formatContext.insertionMode, - formatContext.noscriptTagInScope + !!(formatContext.tagScope & NOSCRIPT_SCOPE) ); case "style": @@ -4804,7 +4805,7 @@ function pushStartInstance( renderState, textEmbedded, formatContext.insertionMode, - formatContext.noscriptTagInScope + !!(formatContext.tagScope & NOSCRIPT_SCOPE) ); case "meta": @@ -4814,7 +4815,7 @@ function pushStartInstance( renderState, textEmbedded, formatContext.insertionMode, - formatContext.noscriptTagInScope + !!(formatContext.tagScope & NOSCRIPT_SCOPE) ); // Newline eating tags @@ -4824,7 +4825,12 @@ function pushStartInstance( } case "img": { - return pushImg(target, props, resumableState); + return pushImg( + target, + props, + resumableState, + !!(formatContext.tagScope & PICTURE_SCOPE) + ); } // Omitted close tags diff --git a/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js b/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js index cd0b8314d6d81..399b67d7e1313 100644 --- a/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js +++ b/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js @@ -189,48 +189,50 @@ var isArrayImpl = Array.isArray, function scriptReplacer(match, prefix, s, suffix) { return "" + prefix + ("s" === s ? "\\u0073" : "\\u0053") + suffix; } -function createFormatContext(insertionMode, selectedValue, noscriptTagInScope) { +function createFormatContext(insertionMode, selectedValue, tagScope) { return { insertionMode: insertionMode, selectedValue: selectedValue, - noscriptTagInScope: noscriptTagInScope + tagScope: tagScope }; } function getChildFormatContext(parentContext, type, props) { switch (type) { case "noscript": - return createFormatContext(2, null, !0); + return createFormatContext(2, null, parentContext.tagScope | 1); case "select": return createFormatContext( 2, null != props.value ? props.value : props.defaultValue, - parentContext.noscriptTagInScope + parentContext.tagScope ); case "svg": - return createFormatContext(3, null, parentContext.noscriptTagInScope); + return createFormatContext(3, null, parentContext.tagScope); + case "picture": + return createFormatContext(2, null, parentContext.tagScope | 2); case "math": - return createFormatContext(4, null, parentContext.noscriptTagInScope); + return createFormatContext(4, null, parentContext.tagScope); case "foreignObject": - return createFormatContext(2, null, parentContext.noscriptTagInScope); + return createFormatContext(2, null, parentContext.tagScope); case "table": - return createFormatContext(5, null, parentContext.noscriptTagInScope); + return createFormatContext(5, null, parentContext.tagScope); case "thead": case "tbody": case "tfoot": - return createFormatContext(6, null, parentContext.noscriptTagInScope); + return createFormatContext(6, null, parentContext.tagScope); case "colgroup": - return createFormatContext(8, null, parentContext.noscriptTagInScope); + return createFormatContext(8, null, parentContext.tagScope); case "tr": - return createFormatContext(7, null, parentContext.noscriptTagInScope); + return createFormatContext(7, null, parentContext.tagScope); } return 5 <= parentContext.insertionMode - ? createFormatContext(2, null, parentContext.noscriptTagInScope) + ? createFormatContext(2, null, parentContext.tagScope) : 0 === parentContext.insertionMode ? "html" === type - ? createFormatContext(1, null, !1) - : createFormatContext(2, null, !1) + ? createFormatContext(1, null, parentContext.tagScope) + : createFormatContext(2, null, parentContext.tagScope) : 1 === parentContext.insertionMode - ? createFormatContext(2, null, !1) + ? createFormatContext(2, null, parentContext.tagScope) : parentContext; } function pushTextInstance(target, text, renderState, textEmbedded) { @@ -1104,7 +1106,7 @@ function pushStartInstance( case "title": if ( 3 === formatContext.insertionMode || - formatContext.noscriptTagInScope || + formatContext.tagScope & 1 || null != props.itemProp ) var JSCompiler_inline_result$jscomp$1 = pushTitleImpl( @@ -1123,7 +1125,7 @@ function pushStartInstance( renderState, textEmbedded, formatContext.insertionMode, - formatContext.noscriptTagInScope + !!(formatContext.tagScope & 1) ); case "script": var asyncProp = props.async; @@ -1136,7 +1138,7 @@ function pushStartInstance( props.onLoad || props.onError || 3 === formatContext.insertionMode || - formatContext.noscriptTagInScope || + formatContext.tagScope & 1 || null != props.itemProp ) var JSCompiler_inline_result$jscomp$2 = pushScriptImpl( @@ -1172,7 +1174,7 @@ function pushStartInstance( href = props.href; if ( 3 === formatContext.insertionMode || - formatContext.noscriptTagInScope || + formatContext.tagScope & 1 || null != props.itemProp || "string" !== typeof precedence || "string" !== typeof href || @@ -1274,7 +1276,7 @@ function pushStartInstance( case "meta": if ( 3 === formatContext.insertionMode || - formatContext.noscriptTagInScope || + formatContext.tagScope & 1 || null != props.itemProp ) var JSCompiler_inline_result$jscomp$4 = pushSelfClosing( @@ -1347,6 +1349,7 @@ function pushStartInstance( "lazy" !== props.loading && ("string" === typeof src || "string" === typeof srcSet) && "low" !== props.fetchPriority && + !1 === !!(formatContext.tagScope & 2) && ("string" !== typeof src || ":" !== src[4] || ("d" !== src[0] && "D" !== src[0]) || @@ -4335,7 +4338,7 @@ exports.renderToStream = function (children, options) { boundaryResources: null, stylesToHoist: !1 }; - bootstrapModules = createFormatContext(0, null, !1); + bootstrapModules = createFormatContext(0, null, 0); externalRuntimeConfig = options ? options.progressiveChunkSize : void 0; idPrefix = options.onError; ReactDOMCurrentDispatcher.current = ReactDOMServerDispatcher; diff --git a/compiled/facebook-www/ReactTestRenderer-dev.modern.js b/compiled/facebook-www/ReactTestRenderer-dev.modern.js index 524028e63b99e..56653e97bbc06 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.modern.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.modern.js @@ -24356,7 +24356,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-modern-1b22884c"; +var ReactVersion = "18.3.0-www-modern-25733132"; // Might add PROFILE later.