layout: Clone static position rectangles when caching in IndependentFormattingContext#39591
Merged
mrobinson merged 1 commit intoservo:mainfrom Oct 1, 2025
Conversation
|
🔨 Triggering try run (#18136551354) for Linux (WPT) |
|
Test results for linux-wpt from try job (#18136551354): Flaky unexpected result (30)
Stable unexpected results that are known to be intermittent (30)
Stable unexpected results (1)
|
|
|
Loirooriol
approved these changes
Sep 30, 2025
components/layout/positioned.rs
Outdated
|
|
||
| fn static_position_rect(&self) -> PhysicalRect<Au> { | ||
| self.adjusted_static_position_rect | ||
| .unwrap_or(self.fragment.borrow().original_static_position_rect) |
Contributor
There was a problem hiding this comment.
Maybe unwrap_or_else to avoid borrowing when not necessary?
…ormattingContext Hoisted absolutes that are cached in IndependentFormattingContexts may have their HoistedSharedFragment resused between layouts. This means that the original value of the adjusted static positioning rectangles need to be preserved in cache. This change makes it so that these values are cloned when being retrieved from the cache. Further adjustments up the tree will now no longer affected the version in teh cache. Signed-off-by: Martin Robinson <[email protected]> Co-authored-by: Oriol Brufau <[email protected]>
d5d3216 to
5369f25
Compare
IndependentFormattingContext
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.
Hoisted absolutes that are cached in IndependentFormattingContexts may
have their HoistedSharedFragment reused between layouts. This means
that the original value of the adjusted static positioning rectangles
need to be preserved in cache. This change makes it so that these values
are cloned when being retrieved from the cache. Further adjustments up
the tree will now no longer affected the version in teh cache.
Testing: This should cause
/_mozilla/css/stacked_layers.htmlto no longerbe flaky.
Fixes: #39548.
Fixes: #39439.