summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-overflow-cssomview.html
blob: c47c7cdd5d51c1fd9f508f927d1a2293af0dfcbb (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
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
fieldset {
  height: 200px;
  overflow: scroll;
  padding: 0;
}

.content {
  height: 400px;
}
</style>

<fieldset>
  <legend>Legend</legend>
  <div class="content"></div>
</fieldset>

<script>
test(() => {
  const fieldset = document.querySelector('fieldset');
  assert_equals(getComputedStyle(fieldset)['overflow-x'], 'scroll');
  assert_equals(getComputedStyle(fieldset)['overflow-y'], 'scroll');
  assert_equals(fieldset.scrollHeight, 400);
  fieldset.scrollTop = 500;
  assert_greater_than_equal(fieldset.scrollTop, 200);
}, 'Test cssom-view API for FIELDSET');
</script>