Skip to content

Nested Forms #29

Description

@techengr1

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

                        ### From the Spec:

An end tag whose tag name is "form"
If there is no template element on the stack of open elements, then run these substeps:

  1. Let node be the element that the form element pointer is set to, or null if it is not set to an element.

  2. Set the form element pointer to null.

  3. 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.

  4. Generate implied end tags.

  5. If the current node is not node, then this is a parse error.

  6. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions