summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-contain/contain-layout-ink-overflow-019.html
blob: 5cda6cd5bebb2f3353778eb17285b4dd487ca881 (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
<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta name="fuzzy" content="1;0-50">

  <title>CSS Test: 'contain: layout' on element that overflows and its parent has 'overflow: scroll'</title>

  <link rel="author" title="Morgan Rae Reschenberg" href="mailto:mreschenberg@berkeley.edu">
  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
  <link rel="help" href="https://www.w3.org/TR/css-overflow-3/#ink-overflow">
  <link rel="help" href="https://www.w3.org/TR/css-contain-1/#containment-layout">
  <link rel="match" href="reference/contain-layout-ink-overflow-019-ref.html">

  <meta content="This test checks that when the contents of an element with 'contain: layout' overflows, its overflowing content must be treated as ink overflow. Such overflowing content therefore can not be reached and can not be accessed by the scrollbars or by the scrolling mechanism of the parent of such element. In this test, the parent has 'overflow: scroll'." name="assert">

  <style>
  div
    {
      height: 100px;
      width: 100px;
    }

    /* this means that each and all 4 div's use the same definite height and width */

  div#parent-with-overflow-scroll
    {
      overflow: scroll;
    }

  div#contain
    {
      contain: layout;
    }

  div#pass
    {
      background-color: green;
    }

  div#fail
    {
      background-color: red;
    }
  </style>

  <!--

    25px  : height of a very tall horizontal scrollbar
 +
   100px  : height of div#fail
  =======
   125px

  -->

  <body onload="document.getElementById('parent-with-overflow-scroll').scrollLeft = 100; document.getElementById('parent-with-overflow-scroll').scrollTop = 125;">

  <p>Test passes if there is a filled green square <strong>with 2 scroll bars</strong> and if there is <strong>no red</strong>.

  <div id="parent-with-overflow-scroll">

    <div id="contain">

      <div id="pass"></div>

      <div id="fail"></div>

    </div>

  </div>