()
| 219 | }; |
| 220 | |
| 221 | const processReadyStateChange = () => { |
| 222 | const readyState = doc.readyState; |
| 223 | if (!hasInitialized && (readyState == 'interactive' || readyState == 'complete')) { |
| 224 | roots.forEach(findShadowRoots); |
| 225 | // document is ready |
| 226 | hasInitialized = 1; |
| 227 | |
| 228 | emitEvent('qinit'); |
| 229 | const riC = win.requestIdleCallback ?? win.setTimeout; |
| 230 | riC.bind(win)(() => emitEvent('qidle')); |
| 231 | |
| 232 | if (events.has('qvisible')) { |
| 233 | const results = querySelectorAll('[on\\:qvisible]'); |
| 234 | const observer = new IntersectionObserver((entries) => { |
| 235 | for (const entry of entries) { |
| 236 | if (entry.isIntersecting) { |
| 237 | observer.unobserve(entry.target); |
| 238 | dispatch(entry.target, '', createEvent<QwikVisibleEvent>('qvisible', entry)); |
| 239 | } |
| 240 | } |
| 241 | }); |
| 242 | results.forEach((el) => observer.observe(el)); |
| 243 | } |
| 244 | } |
| 245 | }; |
| 246 | |
| 247 | const addEventListener = ( |
| 248 | el: EventTarget, |
no test coverage detected
searching dependent graphs…