bugfix: textareas are allowed to be weird

This commit is contained in:
Araq 2018-05-25 22:41:01 +02:00
commit 092395ed5c

View file

@ -199,8 +199,9 @@ proc same(n: VNode, e: Node; nesting = 0): bool =
elif toTag[n.kind] == e.nodename: elif toTag[n.kind] == e.nodename:
result = true result = true
if n.kind != VNodeKind.text: if n.kind != VNodeKind.text:
if e.len != n.len: # BUGFIX: Microsoft's Edge gives the textarea a child containing the text node!
echo "expected ", e.len, " real ", n.len, toTag[n.kind], " nesting ", nesting if e.len != n.len and n.kind != VNodeKind.textarea:
echo "expected ", n.len, " real ", e.len, " ", toTag[n.kind], " nesting ", nesting
return false return false
for i in 0 ..< n.len: for i in 0 ..< n.len:
if not same(n[i], e[i], nesting+1): return false if not same(n[i], e[i], nesting+1): return false