WebCore: HTML5 Conformance Test failure: approved/xhtml5/object_border_pixel.xhtml
[WebKit-https.git] / LayoutTests / fast / html / object-border.html
1 <html xmlns='http://www.w3.org/1999/xhtml'>
2 <head>
3 <link rel="stylesheet" href="../js/resources/js-test-style.css">
4 <script src="../js/resources/js-test-pre.js"></script>
5 <title>OBJECT - border=pixel</title>
6 </head>
7 <p id="description"></p>
8 <table border="">
9 <thead>
10 <tr>
11 <th> Title </th>
12 <th> Actual Image </th>
13 <th> Expected Image </th>
14 </tr>
15 </thead>
16 <tr><td><div  valing="center"> Object Tag with border="50" px </div></td>
17     <td><object id="objID" data="./resources/images/blue.png" type="image/png" border="50"></object></td>
18     <td><img src="./resources/images/blue-border.png" /></td>
19 </tr>
20 </table>
21 <div id="console"></div>
22 <script type="text/javascript">
23 description('Tests for border attribute with Object tag<br/><a href="https://bugs.webkit.org/show_bug.cgi?id=48596">Bug 48596</a> : HTML5 Conformance Test failure: approved/xhtml5/object_border_pixel.xhtml</p>');
24
25 function getStyle(el,styleProp)
26 {
27     var x = document.getElementById(el);
28     if (x.currentStyle)
29         var y = x.currentStyle[styleProp];
30     else if (window.getComputedStyle)
31         var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
32
33     return y;
34 }
35
36 function startTests(prop)
37 {
38     var value = getStyle('objID', prop);
39     if (value =="50px")
40         testPassed(prop + " is " + "50px.");
41     else
42         testFailed(prop + " should be " + "50px" + ". Was " + value);  
43 }
44
45 startTests("border-top-width");
46 startTests("border-left-width");
47 startTests("border-bottom-width");
48 startTests("border-right-width");
49
50 var successfullyParsed = true;
51  </script>  
52  <script src="../js/resources/js-test-post.js"></script>
53  </body>
54 </html>
55