summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/pointerevents/pointerevent_touch-action-none-on-body-when-style-propagates-to-viewport_touch.html
blob: b2a3a9326eadf67bdd506fb1840403e3b5b31c77 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html>
<title>Touch Action None on body when style propagates from body to viewport</title>
<head>
  <style>
    html {
      touch-action: none;
    }
    body {
      overflow: auto;
    }
  </style>
  <link rel="help" href="crbug.com/1031745">
  <link rel="help" href="https://drafts.csswg.org/css-overflow-3/#overflow-propagation">
  <link rel="help" href="https://w3c.github.io/pointerevents/#determining-supported-touch-behavior">
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
  <script src="/resources/testdriver.js"></script>
  <script src="/resources/testdriver-actions.js"></script>
  <script src="/resources/testdriver-vendor.js"></script>
  <script src="pointerevent_support.js"></script>
</head>
<body onload="onLoad()">
  <h2>Pointer Events touch-action none on body when style propagates from body to viewport</h2>
  <h4>Test Description: Try to touch scroll. You shouldn't be able to.</h4>
  <p>Note: this test is for touch only</p>
  Body with touch-action=none.
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <p>Paragraph with touch-action=none</p>
  <script>
    function onLoad(){
      var body = document.body;

      if(!window.promise_test)
        return;

      promise_test(function(t){
        return new Promise(async function(resolve,reject){
          await touchScrollInTarget(body, 'down');
          await touchScrollInTarget(body, 'right');
          t.step(function(){
            assert_equals(document.scrollingElement.scrollLeft, 0, "scrollingElement scroll x offset should be 0 in the end of the test");
            assert_equals(document.scrollingElement.scrollTop, 0, "scrollingElement scroll y offset should be 0 in the end of the test");
          });
          resolve();
      }).then(
        ()=>{t.done();},
        ()=>{t.done();}
      );}, "touch-action none on body when style propagates to viewport");
    }
  </script>
</body>
</html>