2f04b655f30c6607e5decc7fed0958423e16b79b
[test/tct/web/api.git] /
1 <!DOCTYPE html>
2 <!--
3 Copyright (c) 2012 Intel Corporation.
4
5 Redistribution and use in source and binary forms, with or without modification, 
6 are permitted provided that the following conditions are met:
7
8 * Redistributions of works must retain the original copyright notice, this list 
9   of conditions and the following disclaimer.
10 * Redistributions in binary form must reproduce the original copyright notice, 
11   this list of conditions and the following disclaimer in the documentation 
12   and/or other materials provided with the distribution.
13 * Neither the name of Intel Corporation nor the names of its contributors 
14   may be used to endorse or promote products derived from this work without 
15   specific prior written permission.
16
17 THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" 
18 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
19 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
20 ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, 
21 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
22 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 
24 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
25 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
26 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
27
28 Authors:
29         Liu, Jinfeng <jinfengx.liu@intel.com> 
30
31 -->
32
33 <html>
34   <head>
35     <title>CSS3 Backgrounds Test: CSS3BG_border-image-width_20pct_50pct_50pct_url_png</title>
36     <link rel="author" title="Intel" href="http://www.intel.com/" />
37     <link rel="help" href="http://www.w3.org/TR/2012/CR-css3-background-20120724/#border-image-width" />
38     <meta name="flags" content="" />
39     <meta name="assert" content="border-image-width:20%;border-image-slice:50% 50%;border-image-source:url(support/swatch-orange.png) on test div" />
40     <script type="text/javascript" src="../resources/testharness.js"></script>
41     <script type="text/javascript" src="../resources/testharnessreport.js"></script>
42     <script type="text/javascript" src="support/cssstyle.js"></script>
43     <style>
44         #test{
45             height: 200px;
46             width: 300px;
47             padding: 5px;
48             border: 5px solid black;
49             margin: 5px;
50             background: blue;
51         }
52     </style>
53   </head>
54   <body>
55     <div id="log"></div>
56     <div id="test"></div>
57     <script type="text/javascript">
58         var div = document.querySelector("#test");
59         var t = async_test(document.title, {timeout: 500});
60         t.step(function () {
61             div.style[headProp("border-image-width")] = "20%";
62             div.style[headProp("border-image-slice")] = "50% 50%";
63             div.style[headProp("border-image-source")] = "url(support/swatch-orange.png)";
64             var propvalue = GetCurrentStyle("border-image-width");
65             assert_equals(propvalue, "20%", "The element border-image-width should ");
66             var borderImageSlice = GetCurrentStyle("border-image-slice");
67             assert_equals(borderImageSlice, "50%", "The element border-image-slice should ");
68             var borderImageSource = GetCurrentStyle("border-image-source");
69             prop = borderImageSource.indexOf("support/swatch-orange.png") != -1;
70             assert_true(prop, "The element border-image-source should be url(support/swatch-orange.png)");
71         });
72         t.done();
73     </script>
74   </body>
75 </html>