summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-percentage-padding.html
blob: 61ad4ed4c9445a3c035f85db7ab0928cbb11b91a (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
<!doctype html>
<title>fieldset percentage padding</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<style>
 body { margin: 0; }
 .outer { width: 500px; position: relative; }
 fieldset { width: 100px; padding: 10%; margin: 0; border: none; }
 .overflow { overflow: auto; }
</style>
<div class=outer>
 <fieldset>
  <div id=no-overflow>x</div>
 </fieldset>
</div>
<div class=outer>
 <fieldset class=overflow>
  <div id=with-overflow>x</div>
 </fieldset>
</div>
<script>
const noOverflow = document.getElementById('no-overflow');
const withOverflow = document.getElementById('with-overflow');
for (const div of [noOverflow, withOverflow]) {
  test(() => {
    assert_equals(div.offsetLeft, 50, "offsetLeft");
    assert_equals(div.clientWidth, 100, "clientWidth");
    assert_equals(div.offsetTop, 50, "offsetTop");
  }, div.id);
}
</script>