MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / buildFakeIframeWithStack

Function buildFakeIframeWithStack

packages/sdk/src/adapters/iframe.test.ts:647–662  ·  view source on GitHub ↗
(stack: Array<FakeEl | FakeHTMLImageElement>)

Source from the content-addressed store, hash-verified

645// buildFakeIframeWithStack accepts FakeEl or FakeHTMLImageElement.
646
647function buildFakeIframeWithStack(stack: Array<FakeEl | FakeHTMLImageElement>) {
648 return {
649 contentDocument: {
650 elementsFromPoint(_x: number, _y: number) {
651 return stack;
652 },
653 },
654 contentWindow: {
655 // Supply our stub class so `candidate instanceof win.HTMLImageElement` works
656 HTMLImageElement: FakeHTMLImageElement,
657 getComputedStyle(_el: Element) {
658 return { opacity: "1" } as CSSStyleDeclaration;
659 },
660 },
661 } as unknown as HTMLIFrameElement;
662}
663
664// ─── OffscreenCanvas stub helpers ────────────────────────────────────────────
665

Callers 2

withCanvasStubFunction · 0.85
iframe.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected