File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 142142 el = el . childNodes [ key ] || null ;
143143 } else if ( typeof key === 'string' && ( match = key . match ( / ^ # ( .+ ) $ / ) ) ) {
144144 const id = match [ 1 ] ;
145- el = el . childNodes . find ( childEl => Array . prototype . some . call ( childEl . attributes , attr => attr . name === 'id' && attr . value === id ) ) || null ;
145+ const matchEl = Array . from ( el . childNodes ) . find ( childEl => childEl . id === id ) || null ;
146+ if ( matchEl ) {
147+ el = matchEl ;
148+ } else {
149+ const _findRecursive = el => {
150+ const xrIframes = el . querySelectorAll ( 'xr-iframe' ) ;
151+ for ( let i = 0 ; i < xrIframes . length ; i ++ ) {
152+ const xrIframe = xrIframes [ i ] ;
153+ if ( xrIframe . id === id ) {
154+ return xrIframe ;
155+ } else if ( xrIframe . loaded ) {
156+ return _findRecursive ( xrIframe . contentWindow . iframe . contentDocument ) ;
157+ } else {
158+ return null ;
159+ }
160+ }
161+ } ;
162+ return _findRecursive ( el ) ;
163+ }
146164 } else {
147165 el = null ;
148166 }
You can’t perform that action at this time.
0 commit comments