LibWeb: Skip fragments of removed boxes when mapping text offsets - #11136
Conversation
Removing an in-flow atomic inline from an inline run detaches its layout subtree immediately. The containing block keeps its fragment list until its next layout, leaving the removed box's fragment with no layout node. Selection updates iterate these fragments before layout runs and crashed on the dead reference. Skip fragments without a layout node. They cannot match any live text node.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
Possibly related PRs
Merge Risk: ⚪ Minimal · up to This localized change skips detached layout fragments during text-offset mapping and adds a focused regression test; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Removing an in-flow atomic inline from an inline run detaches its layout subtree immediately. The containing block keeps its fragment list until its next layout, leaving the removed box's fragment with no layout node. Selection updates iterate these fragments before layout runs and crashed on the dead reference. Skip fragments without a layout node. They cannot match any live text node.
Fixes a regression introduced at 351d601 (#11126).
Found with domato, where this crash was present in 19 / 1000 cases.