Bug 1560856 [wpt PR 17350] - [LayoutNG] Fix for OOF position in simplified layout, a=testonly

Automatic update from web-platform-tests
[LayoutNG] Fix for OOF position in simplified layout

Bug: 970166
Change-Id: Ib85e5b819e5870c1867e6c753d9a250ea4e4a548
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1660205
Commit-Queue: Aleks Totic <atotic@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#669842}

--

wpt-commits: eb662aa07a1e2394169ca26fa6f1376a076c7d55
wpt-pr: 17350
This commit is contained in:
Aleks Totic 2019-07-19 12:24:14 +00:00 коммит произвёл James Graham
Родитель 9317f8411d
Коммит ecb7117cfd
1 изменённых файлов: 39 добавлений и 0 удалений

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

@ -0,0 +1,39 @@
<!DOCTYPE html>
<link rel="author" href="mailto:atotic@google.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://crbug.com/970166">
<meta name="assert" content="simplified layout calculates correct abspos position with floats">
<style>
#container {
position: relative;
background: gray;
}
#container::after {
content: '';
display: table;
clear:both;
}
#target {
position: absolute;
right: 0;
background: green;
}
</style>
<div id="container">
<div style="float:left">floatleft</div>
<div id="target">
<div>text</div>
<div id="toggle">toggle</div>
</div>
</div>
<script>
test(() => {
document.body.offsetTop;
let el = document.querySelector("#toggle");
el.style.display = "none";
document.body.offsetTop;
assert_equals(document.querySelector("#target").offsetTop, 0);
}, '#target position is recalculated correctly.');
</script>