aboutsummaryrefslogtreecommitdiffstats
path: root/src/html
diff options
context:
space:
mode:
Diffstat (limited to 'src/html')
-rw-r--r--src/html/dom.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim
index 31cf4ccf..db73c23a 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -2368,6 +2368,13 @@ func getElementById(document: Document; id: string): Element {.jsfunc.} =
return nil
func getElementsByName(document: Document; name: CAtom): NodeList {.jsfunc.} =
+ if name == document.toAtom(""):
+ return document.newNodeList(
+ func(node: Node): bool =
+ return false,
+ islive = false,
+ childonly = true
+ )
return document.newNodeList(
func(node: Node): bool =
return node of Element and Element(node).name == name,
@@ -2912,6 +2919,9 @@ proc getter(ctx: JSContext; this: HTMLFormElement; atom: JSAtom): JSValue
{.jsgetownprop.} =
return ctx.getter(this.elements, atom)
+func length(this: HTMLFormElement): int {.jsfget.} =
+ return this.elements.getLength()
+
# <input>
func jsForm(this: HTMLInputElement): HTMLFormElement {.jsfget: "form".} =
return this.form