Fix hit testing on stale derived paint lists after node removal - #699
Open
nicoburns wants to merge 3 commits into
Open
Fix hit testing on stale derived paint lists after node removal#699nicoburns wants to merge 3 commits into
nicoburns wants to merge 3 commits into
Conversation
paint_children, stacking-context hoisted children, and inline layout data are derived data rebuilt during resolve(). After remove_and_drop_node (and before the next resolve) they can contain stale NodeIds, causing hit_inner to panic on tree().get(id).unwrap(). Fixes #624
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Fixes #624.
paint_children, stacking-context hoisted children, and inline layout data are derived data rebuilt duringresolve().DocumentMutator::remove_and_drop_nodeupdatesparent.childrenbut not these lists, so a hit test between the removal and the next resolve iterated stale NodeIds and panicked inNode::hit_innerviaself.with(id)(tree().get(id).unwrap()).hit_innernow does a fallible lookup and skips ids that are no longer live, in all four places that consume derived ids:Regression tests in
tests/blitz-tests/tests/hit_test_after_remove_node.rscover all four paths (plain child, positive/negative z-index hoisted child, inline text); each panicked before the fix.Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/30a37a9f486c4e0e8ba8c6cb5197c1fc
Requested by: @nicoburns
WPT results
No changes in test results compared to
main.Generated by the WPT workflow.