gecko-dev/testing/web-platform/tests/css/css-position/position-absolute-container-dynamic.html
Aleks Totic 7643b264c6 Bug 1529061 [wpt PR 15425] - Reland new wpt tests, a=testonly
Automatic update from web-platform-tests
Reland new wpt tests

Reland of https://chromium-review.googlesource.com/c/chromium/src/+/1471384

Originals failed wpt import

Bug: 907911
Change-Id: Ie97da9f68cf972d31303c7e3ee547e8a184bd52d
Reviewed-on: https://chromium-review.googlesource.com/c/1474709
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Commit-Queue: Aleks Totic <atotic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632768}

--

wpt-commits: 432f9f3f64bc6180e272a5877cb0cdf8aae6b191
wpt-pr: 15425
2019-03-16 12:12:55 +00:00

35 lines
972 B
HTML

<!DOCTYPE html>
<title>CSS Position Absolute: dynamic changes to containing block width</title>
<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://www.w3.org/TR/css-position-3/#abs-non-replaced-width">
<meta name="assert" content="abspos descendant responds to containing block size change">
<style>
#container {
position: relative;
width: 50px;
height: 100px;
background: red;
}
#target {
position: absolute;
left: 0;
width: 100%;
height: 100%;
background: green;
}
</style>
<div id="container">
<div style="display:flex;">
<div id="target"></div>
</div>
</div>
<script>
document.body.offsetTop;
test(() => {
document.getElementById("container").style.width = "100px";
assert_equals(document.querySelector("#target").offsetWidth, 100);
}, '#target used container width when computing size');
</script>