-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid layout roots in subtrees skipped for style recalc
Layout roots are laid out from inner to outer in LocalFrameView. DOM mutations may have added layout roots inside size container subtrees before style recalc. If we decide to postpone style recalc until layout of the size container, it means we may try to layout a root inside a subtree skipped for style recalc. That causes a DCHECK and possibly other issues. This also fixes the use-after-poison issue 1365330. Bug: 1371820, 1365330 Change-Id: Ia48890c08aacfe7b9a3e660817702abce0570564 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3934847 Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/main@{#1055853}
- Loading branch information
Rune Lillesveen
authored and
Chromium LUCI CQ
committed
Oct 6, 2022
1 parent
cc21ed7
commit 0f0f1e9
Showing
4 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
17 changes: 17 additions & 0 deletions
17
...s/external/wpt/css/css-contain/container-queries/crashtests/chrome-layout-root-crash.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!doctype html> | ||
<html class="reftest-wait"> | ||
<link rel="help" href="https://crbug.com/1371820"> | ||
<style> | ||
body, div, img { container-type: size; } | ||
</style> | ||
<p>Pass if no crash.</p> | ||
<div id="div"><img id="img" alt="a"></div> | ||
<script> | ||
requestAnimationFrame(() => requestAnimationFrame(() => { | ||
// Adds a layout root inside the div size container. | ||
img.alt = img.src = "b"; | ||
// Marks div size container for layout which skips style recalc for the sub-tree. | ||
div.style.width = "500px"; | ||
document.documentElement.classList.remove("reftest-wait"); | ||
})); | ||
</script> |