summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/resize-observer/change-layout-in-error.html
blob: 9083fb48f94efe2a4d402fda2e452d72f94b1e17 (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
<!doctype HTML>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<style>
  div {
    width: 100px;
    height: 100px;
  }
</style>
<div id="observeme"></div>

<script>
setup({allow_uncaught_exception: true});

async_test(a => {
  let t = document.querySelector("#observeme");
  let i = 0;
  window.onerror = function (err) {
    t.style.height = "112px";
    i++;
    requestAnimationFrame(a.step_func_done(() => {
      assert_equals(i, 1);
    }), 0);
  };

  new ResizeObserver(function() {
    t.style.height = "111px";
  }).observe(observeme);
  observeme.style.height = "110px";

}, "Changing layout in window error handler should not result in lifecyle loop when resize observer loop limit is reached.");
</script>