File: skew-test1.html

package info (click to toggle)
firefox-esr 128.14.0esr-1~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,230,248 kB
  • sloc: cpp: 7,104,262; javascript: 6,088,450; ansic: 3,654,017; python: 1,212,326; xml: 594,604; asm: 420,654; java: 182,969; sh: 71,124; makefile: 20,739; perl: 13,449; objc: 12,399; yacc: 4,583; cs: 3,846; pascal: 2,973; lex: 1,720; ruby: 1,194; exp: 762; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10
file content (63 lines) | stat: -rw-r--r-- 2,317 bytes parent folder | download | duplicates (11)
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
<!DOCTYPE html>
<!-- Based on a test that was submitted from TestTWF Paris -->
<meta charset="utf-8">
<title>Testing 1 - skew()</title>
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
<link rel="author" title="Myriam Goude" href="mailto:mymygo@gmail.com">
<link rel="help" href="http://www.w3.org/TR/css-transforms-1/#svg-transform">
<link rel="help" href="http://www.w3.org/TR/css-transforms-1/#two-d-transform-functions">
<link rel="match" href="/css/reference/ref-filled-green-100px-square.xht">
<meta name="flags" content="svg">
<meta name="assert" content="The two skew_div squares in this test have skew transform applied, with a different angle in each axis: 45deg on x and 135deg on y. The red polygon should be totally hidden by the green skewed square; and the orange skewed square should be totally hidden by the white polygon.">
<style>
  .green_container {
    background-color: green;
    height: 100px;
    width: 100px;
    position: relative;
  }

  .skew_div {
    position: absolute;
    width: 40px;
    height: 40px;
    box-sizing: border-box;
    transform: skew(45deg,135deg);
    transform-origin:0 0;
  }
  .front {
    /* This one is positioned in front of a red reference polygon: */
    top: 50px;
    left: 10px;
    background: green;
    z-index: 1;
  }
  .back {
    /* This one is positioned in back of a white reference polygon: */
    top: 50px;
    left: 110px;
    background: orange;
    z-index: -1;
  }
</style>
<p>
  Test passes if there is a filled green square and <strong>no red</strong>.
</p>
<div class="green_container">
   <!-- These divs should both render as 80px-tall-and-wide diamond shapes. -->
  <div class="skew_div front"></div>
  <div class="skew_div back"></div>

  <svg width="300px" height="100px">
    <g transform="translate(10,10)">
      <!-- A diamond-shaped red polygon, slightly less than 80px tall and
           wide (should be covered up by the green 'front' div) -->
      <polygon points="2,40 40,2 78,40 40,78" fill="red"></polygon>
    </g>
    <g transform="translate(110,10)">
      <!-- A diamond-shaped white polygon, slightly more than 80px tall and
           wide (should cover up the orange 'back' div) -->
      <polygon points="-2,40 40,-2 82,40 40,82" fill="white"></polygon>
    </g>
  </svg>
</div>