Hi.
Reading through this:
https://htmlparser.info/parser/#forms
I am confused about parsing the below html ( github was hiding less than and greater than symbols):
form
A
div
B
form /form
C
/div
D
/form
An end tag whose tag name is "form"
If there is no template element on the stack of open elements, then run these substeps:
-
Let node be the element that the form element pointer is set to, or null if it is not set to an element.
-
Set the form element pointer to null.
-
If node is null or if the stack of open elements does not have node in scope, then this is a parse error; return and ignore the token.
-
Generate implied end tags.
-
If the current node is not node, then this is a parse error.
-
Remove node from the stack of open elements.
My questions are: According to the spec it states "Let node be the element that the form element pointer is set to, or null if it is not set to an element." What node was let to ? Why was 4. Generate implied end tags (I don't understand the meaning of implied tags, please explain) ? While explaining in your book you mentioned (I quote) "step 3 doesn't apply (node is the form),..."
If node is form then why did you said Step 5 applies since the current node is a div ? What is the difference between node in step 1 and node in step 5 ?
Thank you
Hi.
Reading through this:
https://htmlparser.info/parser/#forms
I am confused about parsing the below html ( github was hiding less than and greater than symbols):
form
A
div
B
form /form
C
/div
D
/form
An end tag whose tag name is "form"
If there is no template element on the stack of open elements, then run these substeps:
Let node be the element that the form element pointer is set to, or null if it is not set to an element.
Set the form element pointer to null.
If node is null or if the stack of open elements does not have node in scope, then this is a parse error; return and ignore the token.
Generate implied end tags.
If the current node is not node, then this is a parse error.
Remove node from the stack of open elements.
My questions are: According to the spec it states "Let node be the element that the form element pointer is set to, or null if it is not set to an element." What node was let to ? Why was 4. Generate implied end tags (I don't understand the meaning of implied tags, please explain) ? While explaining in your book you mentioned (I quote) "step 3 doesn't apply (node is the form),..."
If node is form then why did you said Step 5 applies since the current node is a div ? What is the difference between node in step 1 and node in step 5 ?
Thank you