summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-view-transitions/support/dialog-in-rtl-iframe-child.html
blob: 7b40a8fd5b614e18c27e3ba53754274edb7ec896 (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
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html dir="rtl">
  <head>
    <style>
      body {
        /* We need a background due to https://crbug.com/1414158. */
        background-color: white;
        height: 200vh;
      }

      ::view-transition-new(*) {
        animation: unset;
        opacity: 1;
      }
      ::view-transition-old(*) {
        animation-duration: 30s;
        opacity: 0;
      }

      dialog {
        width: 50dvw;
        height: 50dvh;
        box-sizing: border-box;
        background-color: limegreen;
        border: 1px solid black;
      }

    </style>
    <script>
      function show() {
        document.getElementById('dialog').showModal();
      }
      function startTransition() {
        window.transition = document.startViewTransition(() => {
          show();
        });
      }

      const params = new URLSearchParams(window.location.search);
      if (params.has('show')) {
        addEventListener('load', show);
      }
    </script>
  </head>
  <body>
    <dialog id="dialog">
    </dialog>
  </body>
</html>