script: Use is_in_a_document_tree() to check if a node is in a tree - #46866
Merged
mrobinson merged 1 commit intoJul 30, 2026
Merged
Conversation
… instead of `.has_parent()`. Being in a tree is a pre-condition of `insert_pre_order()` for its call to `compare_dom_tree_position()`. Failing to uphold that pre-condition caused a panic in some case found by a DOM fuzzer. Fixes: servo#46790 Testing: adding a new crashtest to WPT Signed-off-by: Simon Sapin <simon@igalia.com>
|
🔨 Triggering try run (#30474743087) for Linux (WPT) |
Collaborator
|
🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#61611) with upstreamable changes. |
Collaborator
|
✍ Updated existing upstream WPT pull request (web-platform-tests/wpt#61611) title and body. |
|
Test results for linux-wpt from try job (#30474743087): Flaky unexpected result (46)
Stable unexpected results that are known to be intermittent (13)
|
|
✨ Try run (#30474743087) succeeded. |
mrobinson
approved these changes
Jul 30, 2026
| // the tree can't be compared to anything in the DOM tree. | ||
| let control_element = control.to_element(); | ||
| if control_element.upcast::<Node>().has_parent() { | ||
| if control_element.upcast::<Node>().is_in_a_document_tree() { |
Member
There was a problem hiding this comment.
I suspect longer-term these issues will be better fixed by more closely following https://html.spec.whatwg.org/multipage/#create-an-element-for-the-token.
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.
… instead of
.has_parent(). Being in a tree is a pre-condition ofinsert_pre_order()for its call tocompare_dom_tree_position(). Failing to uphold that pre-condition caused a panic in some case found by a DOM fuzzer.Fixes: #46790
Testing: adding a new crashtest to WPT, manually checked to crash before the code change