-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
What is the issue with the HTML Standard?
The DOM spec defines removing steps such that oldParent being non-null says that the node is the root of the removed subtree and oldParent being null means that the element is not. Removing steps for a non-root node in a removal do not have access to nodes above the root of the removed subtree. (In implementations I think this may not be the case, though -- I think the equivalent concepts in at least some implementations do have access, so this may be a spec issue only that is not reflected in implementations!)
Two (independent) HTML Element removing steps defined in the HTML spec use oldParent in ways that don't match the way it's actually defined, and seem to assume that it has a different meaning. In particular, I think the following seem broken:
- https://html.spec.whatwg.org/multipage/links.html#api-for-a-and-area-elements:html-element-removing-steps
- https://html.spec.whatwg.org/multipage/form-elements.html#the-selectedcontent-element:html-element-removing-steps
On the other hand, the following two uses (which are related, they're both for <picture>) seem to depend on the current "odd" definition of oldParent:
- https://html.spec.whatwg.org/multipage/embedded-content.html#the-source-element:html-element-removing-steps
- https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element:html-element-removing-steps
I suspect the right thing to do here may be to change the parameter passed by the DOM spec to be something different.
cc @josepharhar