Skip to content

script: Don't crash when encountering unexpected node types in Range::createContextualFragment#40762

Merged
simonwuelker merged 3 commits intoservo:mainfrom
simonwuelker:range-crash
Nov 20, 2025
Merged

script: Don't crash when encountering unexpected node types in Range::createContextualFragment#40762
simonwuelker merged 3 commits intoservo:mainfrom
simonwuelker:range-crash

Conversation

@simonwuelker
Copy link
Copy Markdown
Contributor

The spec says that all node types other than element, text and comment should be treated as None. We were panicking on a few instead.

Testing: This change adds a simple crashtest
Fixes: #40719

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 20, 2025
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 20, 2025
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#56149) with upstreamable changes.

@servo-highfive servo-highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-awaiting-review There is new code that needs to be reviewed. labels Nov 20, 2025
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#56149).

Signed-off-by: Simon Wülker <[email protected]>
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#56149).

@simonwuelker simonwuelker added this pull request to the merge queue Nov 20, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 20, 2025
Merged via the queue into servo:main with commit 8dbe44b Nov 20, 2025
32 checks passed
@simonwuelker simonwuelker deleted the range-crash branch November 20, 2025 20:24
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

panic: internal error: entered unreachable code (at components/script/dom/range.rs:1142)

5 participants