summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/modal-dialog-scroll-height.html
blob: 638217f02100de800fd231c4d94d0ac43783c9af (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
<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<link rel=author href="mailto:skobes@chromium.org">
<link rel=help href="https://html.spec.whatwg.org/multipage/interactive-elements.html#the-dialog-element">
<link rel=help href="https://bugs.chromium.org/p/chromium/issues/detail?id=403136">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<style>
body {
  margin: 0;
}
.spacer {
  height: 500px;
}
dialog {
  border: 0;
  margin: 0;
  padding: 1px;
}
</style>
<div class="spacer"></div>
<dialog>
  <div class="spacer"></div>
</dialog>

<script>
test(() => {
  document.querySelector('dialog').showModal();
  assert_equals(document.scrollingElement.scrollHeight, window.innerHeight);
}, 'dialogs should be centered before computing overflow.');
</script>