0e5e9d4a6782ad9c1eaff64b8989b6d20870471a
[WebKit-https.git] / LayoutTests / animations / cross-fade-border-image-source.html
1 <html>
2 <head>
3   <style>
4     #box {
5         position: absolute;
6         left: 100px;
7         top: 100px;
8         height: 100px;
9         width: 100px;
10         background-color: green;
11         -webkit-animation: anim 1s linear infinite;
12         border-image: url() 5 5 5 5 /20px stretch stretch;
13     }
14     #boxShorthand {
15         position: absolute;
16         left: 100px;
17         top: 250px;
18         height: 100px;
19         width: 100px;
20         background-color: green;
21         -webkit-animation: animShorthand 1s linear infinite;
22     }
23     #boxStatic {
24         position: absolute;
25         left: 100px;
26         top: 400px;
27         height: 100px;
28         width: 100px;
29         background-color: green;
30         border-image: -webkit-cross-fade(url(resources/stripes-100.png), url(resources/green-100.png), 50%) 5 5 5 5 /20px stretch stretch;
31     }
32     @-webkit-keyframes anim {
33         from { border-image-source: url(resources/stripes-100.png); }
34         to   { border-image-source: url(resources/green-100.png); }
35     }
36     @-webkit-keyframes animShorthand {
37         from { border-image: url(resources/stripes-100.png) 5 5 5 5 /20px stretch stretch; }
38         to   { border-image: url(resources/green-100.png) 5 5 5 5 /20px stretch stretch; }
39     }
40   </style>
41   <script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
42   <script type="text/javascript" charset="utf-8">
43     const expectedValues = [
44       // [animation-name, time, element-id, property, expected-value, tolerance]
45       // FIXME: We can't test reading the borderImage shorthand because of bug #13658.
46       ["anim", 2.5, "box", "borderImageSource", "-webkit-cross-fade(url(stripes-100.png), url(green-100.png), 0.5)", 0.05],
47       ["anim", 2.5, ["box", "static:boxStatic"], "borderImageSource", "cross-fade(url(stripes-100.png), url(green-100.png), 50%)", 0.05],
48       ["animShorthand", 2.5, ["boxShorthand", "static:boxStatic"], "borderImageSource", "cross-fade(url(stripes-100), url(green-100.png), 50%)", 0.05],
49     ];
50
51     var doPixelTest = true;
52     var disablePauseAPI = false;
53     runAnimationTest(expectedValues, null, undefined, disablePauseAPI, doPixelTest);
54   </script>
55 </head>
56 <body>
57 <div id="box"></div>
58 <div id="boxShorthand"></div>
59 <div id="boxStatic"></div>
60 <div id="result"></div>
61 </body>
62 </html>