summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/CSS2/normal-flow/dynamic-percentage-height.html
blob: 2e995963edc200aa857663e4816d0f7807e2969b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html class='reftest-wait'>
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#propdef-height" />
<meta name="assert" content="Tests a dynamic change in height correctly resizes a child element."/>
<script src="/common/reftest-wait.js"></script>
<style>
#container {
  background: red;

  box-sizing: border-box;
  border: solid green 10px;
  width: 100px;
  height: 200px;
}

#block {
  background: green;
  height: 80px;
}

#target {
  height: 100%;
}
</style>
<p>Test passes if there is a filled green square.</p>
<div id="container">
  <div id="target">
    <div id="block"></div>
  </div>
</div>
<script>
document.body.offsetTop;
const container = document.getElementById('container');
container.style.height = '100px';
document.body.offsetTop;
takeScreenshot();
</script>