summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/CSS2/backgrounds/background-intrinsic-007.xht
blob: 1fcf1d91beb625bda4708a4315d7582a0a6505f6 (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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title>CSS Test: Background Intrinsic Sizes: Intrinsic Width and Ratio</title>
  <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
  <link rel="help" href="http://www.w3.org/TR/CSS21/colors.html#background-properties" />
  <link rel="help" href="http://www.w3.org/TR/css3-background/#the-background-size"/>
  <link rel="match" href="background-intrinsic-ref.xht"/>
  <meta name="flags" content="svg" />
  <meta name="assert" content="A missing background image height is calculated
    from the width and the ratio." />
  <style type="text/css">
    /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */
    div {
      position: relative;
    }
    .cover, .limit {
      width: 120px;
      height: 120px;
      margin: 0.5em;
      background: green; /* Used to match reference; remove for debugging. */
    }
    .control {
      position: absolute;
      top: 10px; bottom: 10px;
      left: 10px; right: 30px;
    }
    .cover .control {
      background: red;
    }
    .limit .control {
      background: green;
    }
    .test {
      /* 80x100 bgpos area */
      height: 80px;
      width: 60px;
      padding: 10px;
      border: 10px solid transparent;
    }

    /* Test */
    .cover .test {
      background: no-repeat url(support/green-intrinsic-width-ratio.svg);
    }
    .limit .test {
      background: no-repeat url(support/red-intrinsic-width-ratio.svg);
    }
    .control {
      width: 40px;
      height: 60px;
    }
  </style>
 </head>
 <body>
  <p>There must be two green boxes below and no red.</p>

  <div class="cover">
    <div class="control"></div>
    <div class="test"></div>
  </div>

  <div class="limit">
    <div class="test"></div>
    <div class="control"></div>
  </div>

 </body>
</html>