|
26 | 26 | if (typeof global.ArrayBuffer !== "undefined" && value instanceof global.ArrayBuffer) { |
27 | 27 | return "com_codename1_html5_js_typedarrays_ArrayBuffer"; |
28 | 28 | } |
| 29 | + if (typeof global.Uint8ClampedArray !== "undefined" && value instanceof global.Uint8ClampedArray) { |
| 30 | + return "com_codename1_html5_js_typedarrays_Uint8ClampedArray"; |
| 31 | + } |
29 | 32 | if (typeof global.Uint8Array !== "undefined" && value instanceof global.Uint8Array) { |
30 | 33 | return "com_codename1_html5_js_typedarrays_Uint8Array"; |
31 | 34 | } |
@@ -3227,31 +3230,16 @@ bindCiFallback("Cn1ssDeviceRunnerHelper.emitCurrentFormScreenshotDom", [ |
3227 | 3230 | cn1ssEmitCurrentFormScreenshotMethodId + "__impl", |
3228 | 3231 | cn1ssEmitCurrentFormScreenshotMethodId |
3229 | 3232 | ], cn1ssHelperClassName, fallbackSymbol); |
| 3233 | + // In worker mode the translated screenshot path eventually calls |
| 3234 | + // BlobUtil.canvasToBlob() which uses HTMLCanvasElement.toBlob(callback). |
| 3235 | + // That callback is a Java object and cannot be invoked from the host |
| 3236 | + // thread, so the worker hangs forever in a wait-loop. Always use the |
| 3237 | + // DOM-based capture via host bridge calls instead – this avoids async |
| 3238 | + // callbacks entirely and works reliably across the worker boundary. |
3230 | 3239 | if (originalResolved && typeof originalResolved.fn === "function") { |
3231 | | - if (cn1ssEmitCurrentFormScreenshotInvokeDepth > 0) { |
3232 | | - emitDiagLine("PARPAR:DIAG:FALLBACK:cn1ssEmitCurrentFormScreenshotDom:originalReentryBypass=1"); |
3233 | | - shouldUseDomFallback = true; |
3234 | | - } else { |
3235 | | - try { |
3236 | | - cn1ssEmitCurrentFormScreenshotInvokeDepth++; |
3237 | | - emitDiagLine("PARPAR:DIAG:FALLBACK:cn1ssEmitCurrentFormScreenshotDom:originalResolved=" + originalResolved.source); |
3238 | | - yield* originalResolved.fn(testName, completion); |
3239 | | - return null; |
3240 | | - } catch (originalErr) { |
3241 | | - emitDiagLine("PARPAR:DIAG:FALLBACK:cn1ssEmitCurrentFormScreenshotDom:originalInvokeErr=" |
3242 | | - + String(originalErr && originalErr.message ? originalErr.message : originalErr)); |
3243 | | - if (originalErr && originalErr.stack) { |
3244 | | - emitDiagLine("PARPAR:DIAG:FALLBACK:cn1ssEmitCurrentFormScreenshotDom:originalInvokeStack=" |
3245 | | - + String(originalErr.stack).split("\n").slice(0, 2).join(" | ")); |
3246 | | - } |
3247 | | - shouldUseDomFallback = true; |
3248 | | - } finally { |
3249 | | - cn1ssEmitCurrentFormScreenshotInvokeDepth = Math.max(0, cn1ssEmitCurrentFormScreenshotInvokeDepth - 1); |
3250 | | - } |
3251 | | - } |
| 3240 | + emitDiagLine("PARPAR:DIAG:FALLBACK:cn1ssEmitCurrentFormScreenshotDom:skipTranslated=canvasToBlob_hang"); |
3252 | 3241 | } else { |
3253 | 3242 | emitDiagLine("PARPAR:DIAG:FALLBACK:cn1ssEmitCurrentFormScreenshotDom:originalMissing=1"); |
3254 | | - shouldUseDomFallback = true; |
3255 | 3243 | } |
3256 | 3244 | const canvas = global.document && typeof global.document.querySelector === "function" |
3257 | 3245 | ? global.document.querySelector("canvas") |
|
0 commit comments