@@ -19,7 +19,7 @@ if (__DEV__) {
19
19
var React = require ( "react" ) ;
20
20
var ReactDOM = require ( "react-dom" ) ;
21
21
22
- var ReactVersion = "18.3.0-www-classic-12c31f96 " ;
22
+ var ReactVersion = "18.3.0-www-classic-605a9ce6 " ;
23
23
24
24
// This refers to a WWW module.
25
25
var warningWWW = require ( "warning" ) ;
@@ -2189,13 +2189,22 @@ var HTML_TABLE_BODY_MODE = 6;
2189
2189
var HTML_TABLE_ROW_MODE = 7 ;
2190
2190
var HTML_COLGROUP_MODE = 8 ; // We have a greater than HTML_TABLE_MODE check elsewhere. If you add more cases here, make sure it
2191
2191
// still makes sense
2192
- // Lets us keep track of contextual state and pick it back up after suspending.
2193
2192
2194
- function createFormatContext ( insertionMode , selectedValue , noscriptTagInScope ) {
2193
+ var NO_SCOPE =
2194
+ /* */
2195
+ 0 ;
2196
+ var NOSCRIPT_SCOPE =
2197
+ /* */
2198
+ 1 ;
2199
+ var PICTURE_SCOPE =
2200
+ /* */
2201
+ 2 ; // Lets us keep track of contextual state and pick it back up after suspending.
2202
+
2203
+ function createFormatContext ( insertionMode , selectedValue , tagScope ) {
2195
2204
return {
2196
2205
insertionMode : insertionMode ,
2197
2206
selectedValue : selectedValue ,
2198
- noscriptTagInScope : noscriptTagInScope
2207
+ tagScope : tagScope
2199
2208
} ;
2200
2209
}
2201
2210
@@ -2206,95 +2215,86 @@ function createRootFormatContext(namespaceURI) {
2206
2215
: namespaceURI === "http://www.w3.org/1998/Math/MathML"
2207
2216
? MATHML_MODE
2208
2217
: ROOT_HTML_MODE ;
2209
- return createFormatContext ( insertionMode , null , false ) ;
2218
+ return createFormatContext ( insertionMode , null , NO_SCOPE ) ;
2210
2219
}
2211
2220
function getChildFormatContext ( parentContext , type , props ) {
2212
2221
switch ( type ) {
2213
2222
case "noscript" :
2214
- return createFormatContext ( HTML_MODE , null , true ) ;
2223
+ return createFormatContext (
2224
+ HTML_MODE ,
2225
+ null ,
2226
+ parentContext . tagScope | NOSCRIPT_SCOPE
2227
+ ) ;
2215
2228
2216
2229
case "select" :
2217
2230
return createFormatContext (
2218
2231
HTML_MODE ,
2219
2232
props . value != null ? props . value : props . defaultValue ,
2220
- parentContext . noscriptTagInScope
2233
+ parentContext . tagScope
2221
2234
) ;
2222
2235
2223
2236
case "svg" :
2237
+ return createFormatContext ( SVG_MODE , null , parentContext . tagScope ) ;
2238
+
2239
+ case "picture" :
2224
2240
return createFormatContext (
2225
- SVG_MODE ,
2241
+ HTML_MODE ,
2226
2242
null ,
2227
- parentContext . noscriptTagInScope
2243
+ parentContext . tagScope | PICTURE_SCOPE
2228
2244
) ;
2229
2245
2230
2246
case "math" :
2231
- return createFormatContext (
2232
- MATHML_MODE ,
2233
- null ,
2234
- parentContext . noscriptTagInScope
2235
- ) ;
2247
+ return createFormatContext ( MATHML_MODE , null , parentContext . tagScope ) ;
2236
2248
2237
2249
case "foreignObject" :
2238
- return createFormatContext (
2239
- HTML_MODE ,
2240
- null ,
2241
- parentContext . noscriptTagInScope
2242
- ) ;
2250
+ return createFormatContext ( HTML_MODE , null , parentContext . tagScope ) ;
2243
2251
// Table parents are special in that their children can only be created at all if they're
2244
2252
// wrapped in a table parent. So we need to encode that we're entering this mode.
2245
2253
2246
2254
case "table" :
2247
- return createFormatContext (
2248
- HTML_TABLE_MODE ,
2249
- null ,
2250
- parentContext . noscriptTagInScope
2251
- ) ;
2255
+ return createFormatContext ( HTML_TABLE_MODE , null , parentContext . tagScope ) ;
2252
2256
2253
2257
case "thead" :
2254
2258
case "tbody" :
2255
2259
case "tfoot" :
2256
2260
return createFormatContext (
2257
2261
HTML_TABLE_BODY_MODE ,
2258
2262
null ,
2259
- parentContext . noscriptTagInScope
2263
+ parentContext . tagScope
2260
2264
) ;
2261
2265
2262
2266
case "colgroup" :
2263
2267
return createFormatContext (
2264
2268
HTML_COLGROUP_MODE ,
2265
2269
null ,
2266
- parentContext . noscriptTagInScope
2270
+ parentContext . tagScope
2267
2271
) ;
2268
2272
2269
2273
case "tr" :
2270
2274
return createFormatContext (
2271
2275
HTML_TABLE_ROW_MODE ,
2272
2276
null ,
2273
- parentContext . noscriptTagInScope
2277
+ parentContext . tagScope
2274
2278
) ;
2275
2279
}
2276
2280
2277
2281
if ( parentContext . insertionMode >= HTML_TABLE_MODE ) {
2278
2282
// Whatever tag this was, it wasn't a table parent or other special parent, so we must have
2279
2283
// entered plain HTML again.
2280
- return createFormatContext (
2281
- HTML_MODE ,
2282
- null ,
2283
- parentContext . noscriptTagInScope
2284
- ) ;
2284
+ return createFormatContext ( HTML_MODE , null , parentContext . tagScope ) ;
2285
2285
}
2286
2286
2287
2287
if ( parentContext . insertionMode === ROOT_HTML_MODE ) {
2288
2288
if ( type === "html" ) {
2289
2289
// We've emitted the root and is now in <html> mode.
2290
- return createFormatContext ( HTML_HTML_MODE , null , false ) ;
2290
+ return createFormatContext ( HTML_HTML_MODE , null , parentContext . tagScope ) ;
2291
2291
} else {
2292
2292
// We've emitted the root and is now in plain HTML mode.
2293
- return createFormatContext ( HTML_MODE , null , false ) ;
2293
+ return createFormatContext ( HTML_MODE , null , parentContext . tagScope ) ;
2294
2294
}
2295
2295
} else if ( parentContext . insertionMode === HTML_HTML_MODE ) {
2296
2296
// We've emitted the document element and is now in plain HTML mode.
2297
- return createFormatContext ( HTML_MODE , null , false ) ;
2297
+ return createFormatContext ( HTML_MODE , null , parentContext . tagScope ) ;
2298
2298
}
2299
2299
2300
2300
return parentContext ;
@@ -4070,14 +4070,15 @@ function getImagePreloadKey(href, imageSrcSet, imageSizes) {
4070
4070
return getResourceKey ( "image" , uniquePart ) ;
4071
4071
}
4072
4072
4073
- function pushImg ( target , props , resumableState ) {
4073
+ function pushImg ( target , props , resumableState , pictureTagInScope ) {
4074
4074
var src = props . src ,
4075
4075
srcSet = props . srcSet ;
4076
4076
4077
4077
if (
4078
4078
props . loading !== "lazy" &&
4079
4079
( typeof src === "string" || typeof srcSet === "string" ) &&
4080
- props . fetchPriority !== "low" && // We exclude data URIs in src and srcSet since these should not be preloaded
4080
+ props . fetchPriority !== "low" &&
4081
+ pictureTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded
4081
4082
! (
4082
4083
typeof src === "string" &&
4083
4084
src [ 4 ] === ":" &&
@@ -4778,7 +4779,7 @@ function pushStartInstance(
4778
4779
props ,
4779
4780
renderState ,
4780
4781
formatContext . insertionMode ,
4781
- formatContext . noscriptTagInScope
4782
+ ! ! ( formatContext . tagScope & NOSCRIPT_SCOPE )
4782
4783
) ;
4783
4784
4784
4785
case "link" :
@@ -4789,7 +4790,7 @@ function pushStartInstance(
4789
4790
renderState ,
4790
4791
textEmbedded ,
4791
4792
formatContext . insertionMode ,
4792
- formatContext . noscriptTagInScope
4793
+ ! ! ( formatContext . tagScope & NOSCRIPT_SCOPE )
4793
4794
) ;
4794
4795
4795
4796
case "script" :
@@ -4799,7 +4800,7 @@ function pushStartInstance(
4799
4800
resumableState ,
4800
4801
textEmbedded ,
4801
4802
formatContext . insertionMode ,
4802
- formatContext . noscriptTagInScope
4803
+ ! ! ( formatContext . tagScope & NOSCRIPT_SCOPE )
4803
4804
) ;
4804
4805
4805
4806
case "style" :
@@ -4810,7 +4811,7 @@ function pushStartInstance(
4810
4811
renderState ,
4811
4812
textEmbedded ,
4812
4813
formatContext . insertionMode ,
4813
- formatContext . noscriptTagInScope
4814
+ ! ! ( formatContext . tagScope & NOSCRIPT_SCOPE )
4814
4815
) ;
4815
4816
4816
4817
case "meta" :
@@ -4820,7 +4821,7 @@ function pushStartInstance(
4820
4821
renderState ,
4821
4822
textEmbedded ,
4822
4823
formatContext . insertionMode ,
4823
- formatContext . noscriptTagInScope
4824
+ ! ! ( formatContext . tagScope & NOSCRIPT_SCOPE )
4824
4825
) ;
4825
4826
// Newline eating tags
4826
4827
@@ -4830,7 +4831,12 @@ function pushStartInstance(
4830
4831
}
4831
4832
4832
4833
case "img" : {
4833
- return pushImg ( target , props , resumableState ) ;
4834
+ return pushImg (
4835
+ target ,
4836
+ props ,
4837
+ resumableState ,
4838
+ ! ! ( formatContext . tagScope & PICTURE_SCOPE )
4839
+ ) ;
4834
4840
}
4835
4841
// Omitted close tags
4836
4842
0 commit comments