зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1560928 [wpt PR 17428] - [LayoutNG] Fix |ComputeMinMaxSize| not to clear |NeedsLayout|, a=testonly
Automatic update from web-platform-tests [LayoutNG] Fix |ComputeMinMaxSize| not to clear |NeedsLayout| This patch fixes |ComputeMinMaxSize| not to clear |NeedsLayout| when all of following conditions are met: 1. Needs |MinMaxSize| 2. Is an orthogonal flow root. 3. Is legacy layout. 4. Change is applied that dirties the layout. In this case, |NGBlockNode::ComputeMinMaxSize()| calls |Layout()|, which goes to |RunLegacyLayout()|, which calls |LayoutObject::LayoutIfNeeded()|. However, its constraint space is intermediate that it does not update |CachedLayoutResult|. Then when laying it out, because |NeedsLayout()| is cleared, existing out-of-date |CachedLayoutResult| is used. This patch fixes: 1. Not to pre-layout orthogonal roots if it has |CachedLayoutResult|. 2. Set |NeedsLayout()| if |RunLegacyLayout()| clears it, but |CachedLayoutResult| was not updated. Bug: 976859 Change-Id: Ic2d979a3c4f9479040bfd0e54cf4283b60ed52b5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1670146 Reviewed-by: Christian Biesinger <cbiesinger@chromium.org> Reviewed-by: Emil A Eklund <eae@chromium.org> Commit-Queue: Emil A Eklund <eae@chromium.org> Cr-Commit-Position: refs/heads/master@{#671460} -- wpt-commits: 47b08c15495e05fa73e243736742851109198af1 wpt-pr: 17428
This commit is contained in:
Родитель
de3dc8b626
Коммит
4d0e2fd4d6
|
@ -0,0 +1,30 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<title>CSS Test: Check computing min-/max-content does not cause crash</title>
|
||||||
|
<link rel="help" href="https://crbug.com/976859">
|
||||||
|
<link rel="help" href="https://drafts.csswg.org/css-sizing-3/#sizing-values">
|
||||||
|
<link rel="author" title="Koji Ishii" href="mailto:kojii@chromium.org">
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
width: fit-content;
|
||||||
|
}
|
||||||
|
#target {
|
||||||
|
display: block;
|
||||||
|
writing-mode: vertical-lr;
|
||||||
|
columns: 2;
|
||||||
|
}
|
||||||
|
.after #target {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<body>
|
||||||
|
<div id="target"></div>
|
||||||
|
<script>
|
||||||
|
test(() => {
|
||||||
|
const body = document.body;
|
||||||
|
body.offsetTop;
|
||||||
|
body.classList.add("after");
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
Загрузка…
Ссылка в новой задаче