Skip to content

Commit 05f6de5

Browse files
committed
[Float] Don't preload images inside <noscript> (#28815)
`<noscript>` scopes should be considered inert from the perspective of Fizz since we assume they'll only be used in rare and adverse circumstances. When we added preload support for img tags we did not include the noscript scope check in the opt-out for preloading. This change adds it in fixes: #27910 DiffTrain build for [dc6a7e0](dc6a7e0)
1 parent a0cbdd5 commit 05f6de5

7 files changed

+17
-17
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
84cb3b4cb250bd592f4eb9495e66b50d33c8cd1e
1+
dc6a7e01e1d2fa5eb4974f9bb66e9e8fb40f6ef8

compiled/facebook-www/ReactDOMServer-dev.classic.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if (__DEV__) {
1919
var React = require("react");
2020
var ReactDOM = require("react-dom");
2121

22-
var ReactVersion = "19.0.0-www-classic-444ca498";
22+
var ReactVersion = "19.0.0-www-classic-464a0920";
2323

2424
// This refers to a WWW module.
2525
var warningWWW = require("warning");
@@ -5021,7 +5021,7 @@ if (__DEV__) {
50215021
props,
50225022
resumableState,
50235023
renderState,
5024-
pictureTagInScope
5024+
pictureOrNoScriptTagInScope
50255025
) {
50265026
var src = props.src,
50275027
srcSet = props.srcSet;
@@ -5032,7 +5032,7 @@ if (__DEV__) {
50325032
(typeof src === "string" || src == null) &&
50335033
(typeof srcSet === "string" || srcSet == null) &&
50345034
props.fetchPriority !== "low" &&
5035-
pictureTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded
5035+
pictureOrNoScriptTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded
50365036
!(
50375037
typeof src === "string" &&
50385038
src[4] === ":" &&
@@ -5878,7 +5878,7 @@ if (__DEV__) {
58785878
props,
58795879
resumableState,
58805880
renderState,
5881-
!!(formatContext.tagScope & PICTURE_SCOPE)
5881+
!!(formatContext.tagScope & (PICTURE_SCOPE | NOSCRIPT_SCOPE))
58825882
);
58835883
}
58845884
// Omitted close tags

compiled/facebook-www/ReactDOMServer-dev.modern.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if (__DEV__) {
1919
var React = require("react");
2020
var ReactDOM = require("react-dom");
2121

22-
var ReactVersion = "19.0.0-www-modern-8c4379c6";
22+
var ReactVersion = "19.0.0-www-modern-79e731cd";
2323

2424
// This refers to a WWW module.
2525
var warningWWW = require("warning");
@@ -5021,7 +5021,7 @@ if (__DEV__) {
50215021
props,
50225022
resumableState,
50235023
renderState,
5024-
pictureTagInScope
5024+
pictureOrNoScriptTagInScope
50255025
) {
50265026
var src = props.src,
50275027
srcSet = props.srcSet;
@@ -5032,7 +5032,7 @@ if (__DEV__) {
50325032
(typeof src === "string" || src == null) &&
50335033
(typeof srcSet === "string" || srcSet == null) &&
50345034
props.fetchPriority !== "low" &&
5035-
pictureTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded
5035+
pictureOrNoScriptTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded
50365036
!(
50375037
typeof src === "string" &&
50385038
src[4] === ":" &&
@@ -5878,7 +5878,7 @@ if (__DEV__) {
58785878
props,
58795879
resumableState,
58805880
renderState,
5881-
!!(formatContext.tagScope & PICTURE_SCOPE)
5881+
!!(formatContext.tagScope & (PICTURE_SCOPE | NOSCRIPT_SCOPE))
58825882
);
58835883
}
58845884
// Omitted close tags

compiled/facebook-www/ReactDOMServer-prod.classic.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,7 +1569,7 @@ function pushStartInstance(
15691569
("string" !== typeof srcSet && null != srcSet)
15701570
) &&
15711571
"low" !== props.fetchPriority &&
1572-
!1 === !!(formatContext.tagScope & 2) &&
1572+
!1 === !!(formatContext.tagScope & 3) &&
15731573
("string" !== typeof src ||
15741574
":" !== src[4] ||
15751575
("d" !== src[0] && "D" !== src[0]) ||
@@ -5675,4 +5675,4 @@ exports.renderToString = function (children, options) {
56755675
'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'
56765676
);
56775677
};
5678-
exports.version = "19.0.0-www-classic-99d46394";
5678+
exports.version = "19.0.0-www-classic-507463a5";

compiled/facebook-www/ReactDOMServer-prod.modern.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,7 +1569,7 @@ function pushStartInstance(
15691569
("string" !== typeof srcSet && null != srcSet)
15701570
) &&
15711571
"low" !== props.fetchPriority &&
1572-
!1 === !!(formatContext.tagScope & 2) &&
1572+
!1 === !!(formatContext.tagScope & 3) &&
15731573
("string" !== typeof src ||
15741574
":" !== src[4] ||
15751575
("d" !== src[0] && "D" !== src[0]) ||
@@ -5653,4 +5653,4 @@ exports.renderToString = function (children, options) {
56535653
'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'
56545654
);
56555655
};
5656-
exports.version = "19.0.0-www-modern-e5178c8d";
5656+
exports.version = "19.0.0-www-modern-703c0e89";

compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5026,7 +5026,7 @@ if (__DEV__) {
50265026
props,
50275027
resumableState,
50285028
renderState,
5029-
pictureTagInScope
5029+
pictureOrNoScriptTagInScope
50305030
) {
50315031
var src = props.src,
50325032
srcSet = props.srcSet;
@@ -5037,7 +5037,7 @@ if (__DEV__) {
50375037
(typeof src === "string" || src == null) &&
50385038
(typeof srcSet === "string" || srcSet == null) &&
50395039
props.fetchPriority !== "low" &&
5040-
pictureTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded
5040+
pictureOrNoScriptTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded
50415041
!(
50425042
typeof src === "string" &&
50435043
src[4] === ":" &&
@@ -5885,7 +5885,7 @@ if (__DEV__) {
58855885
props,
58865886
resumableState,
58875887
renderState,
5888-
!!(formatContext.tagScope & PICTURE_SCOPE)
5888+
!!(formatContext.tagScope & (PICTURE_SCOPE | NOSCRIPT_SCOPE))
58895889
);
58905890
}
58915891
// Omitted close tags

compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,7 @@ function pushStartInstance(
15711571
("string" !== typeof srcSet && null != srcSet)
15721572
) &&
15731573
"low" !== props.fetchPriority &&
1574-
!1 === !!(formatContext.tagScope & 2) &&
1574+
!1 === !!(formatContext.tagScope & 3) &&
15751575
("string" !== typeof src ||
15761576
":" !== src[4] ||
15771577
("d" !== src[0] && "D" !== src[0]) ||

0 commit comments

Comments
 (0)