Treat fragment parser documents as not connected#1474
Conversation
|
I don't like changing the meaning of connected for this. It feels a bit like a layering violation. Also, as discovered in whatwg/html#11669 (comment) I don't think this will actually do the trick long term as not all browsers create an intermediate document. I wonder if @noamr and @foolip have ideas on how to address this properly. |
I think a more consistent approach would be to insert elements directly to the |
|
Indeed it feels a bit yuck, though it doesn't seem possible to change in a nice way as long as connected is defined in terms of document and fragment parsing requires a document. If we can wire up fragment parsing without a document that indeed seems much nicer, I can try and investigate that approach (unless this is already being worked on based on what is mentioned above?) |
An element inserted to a Note that multiple in-flight and upcoming changes like whatwg/html#11818 are doing this work through redirecting the insertion target (see https://html.spec.whatwg.org/multipage/parsing.html#appropriate-place-for-inserting-a-node). This would probably be the place to fix it as well. I would prefer if we do this after these in-flight changes are complete though. |
if persistent document fragment will ever exist, the element is connected "if the fragment is" so please consider the fact in the future there could be live/persistent document fragments, thank you! |
Sure, but in this case it wouldn't be that future type of fragment, but a normal disconnected fragment. |
Sounds good, I'll hold off! |
Matching the behaviour of engines. For: whatwg/html#11023, but needs a small patch in HTML spec also, which I will raise if directionally this is okay.
(See WHATWG Working Mode: Changes for more details.)
Preview | Diff