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