From 074fd1290aa8547cd1061a581c64169005653c01 Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 6 Dec 2019 19:15:41 +0000 Subject: [PATCH] fix(types): cast nodes to elements in _viewportPointAndScroll --- src/dom.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dom.ts b/src/dom.ts index 17bb39404c..5939a5204b 100644 --- a/src/dom.ts +++ b/src/dom.ts @@ -258,8 +258,8 @@ export class ElementHandle extends js.JSHandle { private async _viewportPointAndScroll(relativePoint: types.Point): Promise<{point: types.Point, scrollX: number, scrollY: number}> { const [box, border] = await Promise.all([ this.boundingBox(), - this.evaluate((e: Element) => { - const style = e.ownerDocument.defaultView.getComputedStyle(e); + this.evaluate((e: Node) => { + const style = e.ownerDocument.defaultView.getComputedStyle(e as Element); return { x: parseInt(style.borderLeftWidth, 10), y: parseInt(style.borderTopWidth, 10) }; }).catch(debugError), ]);