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