Fix borrow hazard creating intersection observer entries#45001
Open
SharanRP wants to merge 1 commit into
Open
Conversation
xiaochengh
reviewed
May 19, 2026
Contributor
xiaochengh
left a comment
There was a problem hiding this comment.
The PR doesn't compile, can we fix it?
Contributor
Author
|
yes looking into that |
jdm
reviewed
May 19, 2026
| Finite::wrap(intersection_ratio), | ||
| target, | ||
| ) | ||
| .as_traced(); |
Member
There was a problem hiding this comment.
Move the as_traced() call to the push call instead to avoid this error.
Gae24
requested changes
May 19, 2026
| target, | ||
| ) | ||
| .as_traced(), | ||
| // > 2. Append it to observer's internal [[QueuedEntries]] slot. |
Contributor
There was a problem hiding this comment.
Nit: move this comment above self.queued_entries.borrow_mut().push(entry.as_traced());
Signed-off-by: SharanRP <[email protected]>
Contributor
Author
|
are the changes good ? @Gae24 @jdm @xiaochengh |
Gae24
approved these changes
May 21, 2026
Contributor
Gae24
left a comment
There was a problem hiding this comment.
Just to keep it consistent with how spec comments are written nowadays.
Comment on lines
+340
to
341
| // Step 1 | ||
| // > 1. Construct an IntersectionObserverEntry, passing in time, rootBounds, |
Contributor
There was a problem hiding this comment.
Suggested change
| // Step 1 | |
| // > 1. Construct an IntersectionObserverEntry, passing in time, rootBounds, | |
| // Step 1. Construct an IntersectionObserverEntry, passing in time, rootBounds, |
Comment on lines
+359
to
+360
| // Step 2 | ||
| // > 2. Append it to observer's internal [[QueuedEntries]] slot. |
Contributor
There was a problem hiding this comment.
Suggested change
| // Step 2 | |
| // > 2. Append it to observer's internal [[QueuedEntries]] slot. | |
| // Step 2. Append it to observer's internal [[QueuedEntries]] slot. |
Comment on lines
362
to
363
| // > Step 3 | ||
| // Queue an intersection observer task for document. |
Contributor
There was a problem hiding this comment.
Suggested change
| // > Step 3 | |
| // Queue an intersection observer task for document. | |
| // Step 3. Queue an intersection observer task for document. |
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.
IntersectionObserverEntry::new()can trigger garbage collection butself.queued_entries.borrow_mut()was held during the call when GC traces the cell it tries to borrow again causing a panic , create the entry first then push it to avoid the borrow hazardFixes #44988