diff options
author | bptato <nincsnevem662@gmail.com> | 2024-01-01 20:19:56 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-01-01 20:19:56 +0100 |
commit | a16b9876820cabcae5f79606ec6bad669c080bc6 (patch) | |
tree | a23067acbae9031ff48a2375e5c352af2f3da30f | |
parent | 08420beb5b5e70de63e9ae79ebe996c90dd4fabf (diff) | |
download | chawan-a16b9876820cabcae5f79606ec6bad669c080bc6.tar.gz |
htmlparser: get rid of some todos
* No namespace is correct. * Queue a microtask can be implemented in elementPoppedImpl, because the stack of open elements is not visible to scripts. * We can just change <image> tag name and reproces, no problem * Update todo file
-rw-r--r-- | chame/htmlparser.nim | 10 | ||||
-rw-r--r-- | todo | 4 |
2 files changed, 2 insertions, 12 deletions
diff --git a/chame/htmlparser.nim b/chame/htmlparser.nim index 7ee70372..779cf1ed 100644 --- a/chame/htmlparser.nim +++ b/chame/htmlparser.nim @@ -521,7 +521,6 @@ func createElement[Handle, Atom](parser: HTML5Parser[Handle, Atom], func toParsedAttrs[Atom](attrs: seq[TokenAttr[Atom]]): seq[ParsedAttr[Atom]] = result = @[] for attr in attrs: - #TODO is no namespace correct? result.add((NO_PREFIX, NO_NAMESPACE, attr.name, attr.value)) func createElement[Handle, Atom](parser: HTML5Parser[Handle, Atom], @@ -1906,13 +1905,7 @@ proc processInHTMLContent[Handle, Atom](parser: var HTML5Parser[Handle, Atom], parser.framesetOk = false ) "<image>" => (block: - #TODO ew - let token = Token( - t: START_TAG, - tagname: parser.tagTypeToAtom(TAG_IMG), - selfclosing: token.selfclosing, - attrs: token.attrs - ) + token.tagname = parser.tagTypeToAtom(TAG_IMG) reprocess token ) "<textarea>" => (block: @@ -2023,7 +2016,6 @@ proc processInHTMLContent[Handle, Atom](parser: var HTML5Parser[Handle, Atom], reprocess token ) "</script>" => (block: - #TODO microtask (?) pop_current_node parser.insertionMode = parser.oldInsertionMode ) diff --git a/todo b/todo index 0772e4af..4a113baa 100644 --- a/todo +++ b/todo @@ -2,13 +2,11 @@ interface: * pass TokenAttr to createElement, then append adjusted attributes with a separate callback * get rid of getParentNode (replace with an insertBeforeOrAppendTo?) -* optional callbacks without function pointers (when compiles?) +* use converter + proc for optional callbacks instead of method? optimizations: * reduce use of getNamespace (maybe store ns on the stack of open elements?) * reduce atomToTagType calls (store tagType before the case statement in match?) -* go through TODOs in htmltokenizer * on-demand creation of attribute name atoms (most documents don't even need atomMap); use ref array/Option? -* htmltokenizer: do something with copyBuf, it's ugly and probably broken etc: * turn test1 into a serializer module |