File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -194,6 +194,9 @@ export async function buildBackendIdMaps(
194
194
const stack : StackEntry [ ] = [ { node : startNode , path : "" , fid : rootFid } ] ;
195
195
const seen = new Set < EncodedId > ( ) ;
196
196
197
+ const joinStep = ( base : string , step : string ) : string =>
198
+ base . endsWith ( "//" ) ? `${ base } ${ step } ` : `${ base } /${ step } ` ;
199
+
197
200
while ( stack . length ) {
198
201
const { node, path, fid } = stack . pop ( ) ! ;
199
202
@@ -211,6 +214,16 @@ export async function buildBackendIdMaps(
211
214
stack . push ( { node : node . contentDocument , path : "" , fid : childFid } ) ;
212
215
}
213
216
217
+ if ( node . shadowRoots ?. length ) {
218
+ for ( const shadowRoot of node . shadowRoots ) {
219
+ stack . push ( {
220
+ node : shadowRoot ,
221
+ path : `${ path } //` ,
222
+ fid,
223
+ } ) ;
224
+ }
225
+ }
226
+
214
227
// push children
215
228
const kids = node . children ?? [ ] ;
216
229
if ( kids . length ) {
@@ -233,7 +246,7 @@ export async function buildBackendIdMaps(
233
246
for ( let i = kids . length - 1 ; i >= 0 ; i -- ) {
234
247
stack . push ( {
235
248
node : kids [ i ] ! ,
236
- path : ` ${ path } / ${ segs [ i ] } ` ,
249
+ path : joinStep ( path , segs [ i ] ! ) ,
237
250
fid,
238
251
} ) ;
239
252
}
You can’t perform that action at this time.
0 commit comments