Bug 1560889 [wpt PR 17390] - [LayoutNG] Fix DCHECK(NeedsLayout) for inline oof fixed container., a=testonly

Automatic update from web-platform-tests
[LayoutNG] Fix DCHECK(NeedsLayout) for inline oof fixed container.

NGOutOfFlowLayoutDescendant.inline_container was not being set
correctly for an Element if:
- There is an OOF containing block between Element and
its Container(). This can only happens if Element is
position:fixed.

This caused Element not to be laid out after it got dirty (but
its containing block did not).

The fix is to set inline_container when Element's
NGOutOfFlowDesecendantCandidate gets propagated up the OOF
containing block chain.

For a while, I was afraid that this fundamentally broke
the concept of inline_container. I could not come up
with a counterexample that broke this fix.

Bug: 974760
Change-Id: Id16a0057f0aefe183c30c53244dd5c46108f093c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1666809
Commit-Queue: Aleks Totic <atotic@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#670634}

--

wpt-commits: b6343fc17a3035a0c2170f44fb63df2356aa2cb9
wpt-pr: 17390
This commit is contained in:
Aleks Totic 2019-07-19 12:36:43 +00:00 коммит произвёл James Graham
Родитель a41f088278
Коммит d4f1901d92
1 изменённых файлов: 37 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,37 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://crbug.com/974760">
<meta name="assert" content="fixed children inside inline container do not crash">
<style>
#container {
position: relative;
overflow: auto;
width: 200px;
height: 200px;
}
#inline-fixed-container {
filter:url("");
}
#fixed-container {
position: fixed;
}
#target {
position: fixed;
}
</style>
<div id="container">
<span id="inline-fixed-container">
<div id="fixed-container">
<div id="target"></div>
</div>
</span>
</div>
<script>
test(() => {
document.body.offsetTop;
document.querySelector("#target").appendChild(
document.createTextNode("foo"));
document.body.offsetTop;
}, 'this test passes if it does not crash');
</script>