about summary refs log tree commit diff stats
path: root/src/html
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-15 21:04:31 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-15 21:04:31 +0100
commitb630bbe6a223dd2f54a2d9e24eba51c616490e80 (patch)
tree1b03a2f1da006eb6536d8a4e83c7c64c74274c15 /src/html
parent609e628a39043179c937a20ab5a1dbd0505be5ea (diff)
parentf4c263645df79e2dad8c107eb502851d6e2ad8de (diff)
downloadchawan-b630bbe6a223dd2f54a2d9e24eba51c616490e80.tar.gz
Merge branch 'master' of ssh://192.168.0.230/~/x/cha
Diffstat (limited to 'src/html')
-rw-r--r--src/html/htmlparser.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/html/htmlparser.nim b/src/html/htmlparser.nim
index f04a94f7..6fbc4ae7 100644
--- a/src/html/htmlparser.nim
+++ b/src/html/htmlparser.nim
@@ -472,6 +472,17 @@ proc genericRCDATAElementParsingAlgorithm(parser: var HTML5Parser, token: Token)
   parser.oldInsertionMode = parser.insertionMode
   parser.insertionMode = TEXT
 
+proc pushElement(parser: var HTML5Parser, node: Element) =
+  parser.openElements.add(node)
+  parser.tokenizer.hasnonhtml = not node.inHTMLNamespace()
+
+proc popElement(parser: var HTML5Parser): Element =
+  result = parser.openElements.pop()
+  if result.tagType == TAG_TEXTAREA:
+    result.resetElement()
+  if parser.openElements.len == 0:
+    parser.tokenizer.hasnonhtml = false
+
 # 13.2.6.3
 proc generateImpliedEndTags(parser: var HTML5Parser) =
   const tags = {TAG_DD, TAG_DT, TAG_LI, TAG_OPTGROUP, TAG_OPTION, TAG_P,