summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/transitions/multiple-text-shadow-transition.html
blob: f040c634f8213bd697454a739a252f628bb9afa1 (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
<!DOCTYPE html>
<html>
<head>
  <style>
    #container {
      width: 400px;
      height: 100px;
      margin: 10px;
      -webkit-transition-property: text-shadow;
      -webkit-transition-duration: 1s;
      -webkit-transition-timing-function: linear;
    }
    
    #container {
        text-shadow:    yellow 0px 10px 10px,
                        yellow 0px 20px 10px,
                        yellow 0px 30px 10px,
                        yellow 0px 40px 10px,
                        yellow 0px 50px 10px;
    }

    #container.final {
        text-shadow:    green 0px 10px 2px,
                        green 0px 20px 2px,
                        green 0px 30px 2px,
                        green 0px 40px 2px,
                        green 0px 50px 2px;
    }

  </style>
  <script>

    if (window.testRunner) {
        testRunner.dumpAsText();
        testRunner.waitUntilDone();
    }
    
    function setupTest()
    {
      document.getElementById('container').className = 'final';
      window.setTimeout(checkShadow, 0);
    }
    
    function checkShadow()
    {
        var container = document.getElementById('container');
        var shadow = window.getComputedStyle(container).getPropertyCSSValue('text-shadow');
        
        var result = document.getElementById('result');
        if (shadow.length == 5)
            result.innerHTML = 'PASS: saw 5 shadows during the transition';
        else
            result.innerHTML = 'FAIL: saw ' + shadow.length + ' shadows during the transition';
        
        if (window.testRunner)
            testRunner.notifyDone();
    }
    
    window.addEventListener('load', setupTest, false);
  </script>
</head>
<body>
  <div id="container">
      Shadowed text
  </div>
  <div id="result"></div>
</body>
</html>