From 2610b16f6ede15888de9769b7226233dc8e86b68 Mon Sep 17 00:00:00 2001 From: liuxiaodong Date: Sat, 16 Feb 2019 00:43:22 +0800 Subject: some dom proc correction and complement (#10684) --- lib/js/dom.nim | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/js/dom.nim b/lib/js/dom.nim index 9d6cd9152..3c6d65d8a 100644 --- a/lib/js/dom.nim +++ b/lib/js/dom.nim @@ -192,7 +192,7 @@ type Element* = ref ElementObj ElementObj {.importc.} = object of NodeObj - classList*: Classlist + classList*: ClassList checked*: bool defaultChecked*: bool defaultValue*: cstring @@ -1183,9 +1183,10 @@ proc contains*(c: ClassList, class: cstring): bool proc toggle*(c: ClassList, class: cstring) # Style "methods" -proc getAttribute*(s: Style, attr: cstring, caseSensitive=false): cstring -proc removeAttribute*(s: Style, attr: cstring, caseSensitive=false) -proc setAttribute*(s: Style, attr, value: cstring, caseSensitive=false) +proc getPropertyValue*(s: Style, property: cstring): cstring +proc removeProperty*(s: Style, property: cstring) +proc setProperty*(s: Style, property, value: cstring, priority = "") +proc getPropertyPriority*(s: Style, property: cstring): cstring # Event "methods" proc preventDefault*(ev: Event) @@ -1267,6 +1268,10 @@ proc inViewport*(el: Node): bool = rect.right <= clientWidth().float proc scrollTop*(e: Node): int {.importcpp: "#.scrollTop", nodecl.} +proc scrollLeft*(e: Node): int {.importcpp: "#.scrollLeft", nodecl.} +proc scrollHeight*(e: Node): int {.importcpp: "#.scrollHeight", nodecl.} +proc scrollWidth*(e: Node): int {.importcpp: "#.scrollWidth", nodecl.} proc offsetHeight*(e: Node): int {.importcpp: "#.offsetHeight", nodecl.} +proc offsetWidth*(e: Node): int {.importcpp: "#.offsetWidth", nodecl.} proc offsetTop*(e: Node): int {.importcpp: "#.offsetTop", nodecl.} proc offsetLeft*(e: Node): int {.importcpp: "#.offsetLeft", nodecl.} -- cgit 1.4.1-2-gfad0