Since insertBefore caches the docElement (and, currently, docType),
removeChild has to know how to undo the cache
REVISIT: According to the spec it is not allowed to alter neither the
document element nor the document type in any way
Since we cache the docElement (and, currently, docType),
replaceChild has to update the cache
REVISIT: According to the spec it is not allowed to alter neither the
document element nor the document type in any way
An optimization option that we should write in the future is to separate the static list
of Datatype Validators from the dynamic part where anonymous, and user derived datatype are
kept, then when we resetRegistry only the dynamic part of the registry should be cleared.
This array must be at least as large as possibleChildren since
a flag is set in the same indexes in this array to indicate that
the possible child at that index in possibleChildren can be
inserted at the requested insertion point.