Skip to content

Commit

Permalink
[Float] Don't preload images inside <noscript> (#28815)
Browse files Browse the repository at this point in the history
`<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)
  • Loading branch information
gnoff committed Apr 10, 2024
1 parent a0cbdd5 commit 05f6de5
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
84cb3b4cb250bd592f4eb9495e66b50d33c8cd1e
dc6a7e01e1d2fa5eb4974f9bb66e9e8fb40f6ef8
8 changes: 4 additions & 4 deletions compiled/facebook-www/ReactDOMServer-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (__DEV__) {
var React = require("react");
var ReactDOM = require("react-dom");

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

// This refers to a WWW module.
var warningWWW = require("warning");
Expand Down Expand Up @@ -5021,7 +5021,7 @@ if (__DEV__) {
props,
resumableState,
renderState,
pictureTagInScope
pictureOrNoScriptTagInScope
) {
var src = props.src,
srcSet = props.srcSet;
Expand All @@ -5032,7 +5032,7 @@ if (__DEV__) {
(typeof src === "string" || src == null) &&
(typeof srcSet === "string" || srcSet == null) &&
props.fetchPriority !== "low" &&
pictureTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded
pictureOrNoScriptTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded
!(
typeof src === "string" &&
src[4] === ":" &&
Expand Down Expand Up @@ -5878,7 +5878,7 @@ if (__DEV__) {
props,
resumableState,
renderState,
!!(formatContext.tagScope & PICTURE_SCOPE)
!!(formatContext.tagScope & (PICTURE_SCOPE | NOSCRIPT_SCOPE))
);
}
// Omitted close tags
Expand Down
8 changes: 4 additions & 4 deletions compiled/facebook-www/ReactDOMServer-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (__DEV__) {
var React = require("react");
var ReactDOM = require("react-dom");

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

// This refers to a WWW module.
var warningWWW = require("warning");
Expand Down Expand Up @@ -5021,7 +5021,7 @@ if (__DEV__) {
props,
resumableState,
renderState,
pictureTagInScope
pictureOrNoScriptTagInScope
) {
var src = props.src,
srcSet = props.srcSet;
Expand All @@ -5032,7 +5032,7 @@ if (__DEV__) {
(typeof src === "string" || src == null) &&
(typeof srcSet === "string" || srcSet == null) &&
props.fetchPriority !== "low" &&
pictureTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded
pictureOrNoScriptTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded
!(
typeof src === "string" &&
src[4] === ":" &&
Expand Down Expand Up @@ -5878,7 +5878,7 @@ if (__DEV__) {
props,
resumableState,
renderState,
!!(formatContext.tagScope & PICTURE_SCOPE)
!!(formatContext.tagScope & (PICTURE_SCOPE | NOSCRIPT_SCOPE))
);
}
// Omitted close tags
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactDOMServer-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -1569,7 +1569,7 @@ function pushStartInstance(
("string" !== typeof srcSet && null != srcSet)
) &&
"low" !== props.fetchPriority &&
!1 === !!(formatContext.tagScope & 2) &&
!1 === !!(formatContext.tagScope & 3) &&
("string" !== typeof src ||
":" !== src[4] ||
("d" !== src[0] && "D" !== src[0]) ||
Expand Down Expand Up @@ -5675,4 +5675,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 = "19.0.0-www-classic-99d46394";
exports.version = "19.0.0-www-classic-507463a5";
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactDOMServer-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -1569,7 +1569,7 @@ function pushStartInstance(
("string" !== typeof srcSet && null != srcSet)
) &&
"low" !== props.fetchPriority &&
!1 === !!(formatContext.tagScope & 2) &&
!1 === !!(formatContext.tagScope & 3) &&
("string" !== typeof src ||
":" !== src[4] ||
("d" !== src[0] && "D" !== src[0]) ||
Expand Down Expand Up @@ -5653,4 +5653,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 = "19.0.0-www-modern-e5178c8d";
exports.version = "19.0.0-www-modern-703c0e89";
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -5026,7 +5026,7 @@ if (__DEV__) {
props,
resumableState,
renderState,
pictureTagInScope
pictureOrNoScriptTagInScope
) {
var src = props.src,
srcSet = props.srcSet;
Expand All @@ -5037,7 +5037,7 @@ if (__DEV__) {
(typeof src === "string" || src == null) &&
(typeof srcSet === "string" || srcSet == null) &&
props.fetchPriority !== "low" &&
pictureTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded
pictureOrNoScriptTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded
!(
typeof src === "string" &&
src[4] === ":" &&
Expand Down Expand Up @@ -5885,7 +5885,7 @@ if (__DEV__) {
props,
resumableState,
renderState,
!!(formatContext.tagScope & PICTURE_SCOPE)
!!(formatContext.tagScope & (PICTURE_SCOPE | NOSCRIPT_SCOPE))
);
}
// Omitted close tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,7 @@ function pushStartInstance(
("string" !== typeof srcSet && null != srcSet)
) &&
"low" !== props.fetchPriority &&
!1 === !!(formatContext.tagScope & 2) &&
!1 === !!(formatContext.tagScope & 3) &&
("string" !== typeof src ||
":" !== src[4] ||
("d" !== src[0] && "D" !== src[0]) ||
Expand Down

0 comments on commit 05f6de5

Please sign in to comment.