Skip to content

Adoption Agency Algorithm #9

Description

@heathj

There is a step that is confusingly worded in the AAA:

  1. Insert whatever last node ended up being in the previous step at the appropriate place for inserting a node, but using common ancestor as the override target.

This doesn't say to remove that element from its previous parent, but I think it is implied. The go X package for this algorithm does this and I think that is what they meant (https://github.com/golang/net/blob/master/html/parse.go#L1309). I think it should be better read as "take that node that was in lastNode and move it in the DOM (effectively removing it from its previous place in the DOM and reinserting it in the new place). I am making this a ticket because it took me a long time to identify this issue in my implementation because of the wording of the spec. My test cases kept failing and I think this was the culprit.

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