Test the adoption agency when script reparents nodes during parsing#61398
Open
annevk wants to merge 2 commits into
Open
Test the adoption agency when script reparents nodes during parsing#61398annevk wants to merge 2 commits into
annevk wants to merge 2 commits into
Conversation
The adoption agency algorithm moves existing nodes (the furthest block and its ancestors up to the common ancestor), assuming the DOM tree still matches the stack of open elements. An inline <script> that runs before the misnested end tag can reparent those nodes first — detaching them, moving them into another Document, or nesting them so that a subsequent move would create a cycle. adoption-agency-reparenting.html covers the well-formed cases (detach, adopt into another Document, foster-parented common ancestor); these are interoperable across engines. The cycle-inducing cases are split into separate files (adoption-agency-reparenting-cycle.html and -inner-loop-cycle.html) so a crash in one does not hide the others.
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The adoption agency algorithm moves existing nodes (the furthest block and its ancestors up to the common ancestor), assuming the DOM tree still matches the stack of open elements. An inline
<script>that runs before the misnested end tag can reparent those nodes first — detaching them, moving them into anotherDocument, or nesting them so that a subsequent move would create a cycle.adoption-agency-reparenting.htmlcovers the well-formed cases (detach, adopt into anotherDocument, foster-parented common ancestor); these are interoperable across engines. The cycle-inducing cases are split into separate files (adoption-agency-reparenting-cycle.htmland-inner-loop-cycle.html) so a crash in one does not hide the others; they currently crash Chromium.