summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorJuan Carlos <juancarlospaco@gmail.com>2023-09-28 02:37:09 -0300
committerGitHub <noreply@github.com>2023-09-28 07:37:09 +0200
commitf0865fa6960cbff301318f4ef8d603052519b24d (patch)
tree680206bccbae4248cf1351b851ff64a1d18919e3 /lib
parenta9e6660a74322f0385f22c89e60c46e3177c2513 (diff)
downloadNim-f0865fa6960cbff301318f4ef8d603052519b24d.tar.gz
Fix #21407 (#22759)
- Fix #21407

---------

Co-authored-by: Amjad Ben Hedhili <amjadhedhili@outlook.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/js/dom.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/js/dom.nim b/lib/js/dom.nim
index ceb0375b7..ba9b4159d 100644
--- a/lib/js/dom.nim
+++ b/lib/js/dom.nim
@@ -1832,3 +1832,11 @@ since (1, 7):
 
   proc matches*(self: Node; cssSelector: cstring): bool {.importjs: "(#.$1(#) || false)".}
     ## https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
+
+
+since (2, 1):
+  type VisualViewport* {.importc.} = ref object of EventTarget
+    offsetLeft*, offsetTop*, pageLeft*, pageTop*, width*, height*, scale*: float
+    onResize*, onScroll*: proc (event: Event) {.closure.}
+
+  func visualViewport*(self: Window): VisualViewport {.importjs: "#.$1", nodecl.}