OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <meta charset="utf-8"> |
| 3 <title>HTML Test: object - attributes</title> |
| 4 <link rel="author" title="Intel" href="http://www.intel.com"> |
| 5 <script src="../../../../../../resources/testharness.js"></script> |
| 6 <script src="../../../../../../resources/testharnessreport.js"></script> |
| 7 <body onload="on_load()"> |
| 8 <div id="log"></div> |
| 9 <form> |
| 10 <object id="obj1" data="blue.html" name="o" height="50" width="100"></object> |
| 11 <object id="obj2" name="p" type="image/png"></object> |
| 12 </form> |
| 13 <script> |
| 14 var obj1; |
| 15 var obj2; |
| 16 var t1 = async_test("object.contentWindow"); |
| 17 var t3 = async_test("object.width"); |
| 18 var t4 = async_test("object.height"); |
| 19 |
| 20 setup(function() { |
| 21 obj1 = document.getElementById("obj1"); |
| 22 obj2 = document.getElementById("obj2"); |
| 23 }); |
| 24 |
| 25 function on_load () { |
| 26 t1.step(function() { |
| 27 assert_equals(obj1.contentWindow.name, "o", "The contentWindow's name of t
he object element should be 'o'."); |
| 28 assert_equals(obj2.contentWindow, null, "The contentWindow of the object e
lement should be null when it type attribute starts with 'image/'."); |
| 29 obj1.setAttribute("name", "o1"); |
| 30 assert_equals(obj1.name, "o1", "The name of the object element should be '
o1'."); |
| 31 assert_equals(obj1.contentWindow.name, "o1", "The contentWindow's name of
the object element should be 'o1'."); |
| 32 obj1.removeAttribute("name"); |
| 33 assert_equals(obj1.name, "", "The name of the object element should be emp
ty string."); |
| 34 assert_equals(obj1.contentWindow.name, "", "The contentWindow's name of th
e object element should be empty string."); |
| 35 }); |
| 36 t1.done() |
| 37 |
| 38 t3.step(function() { |
| 39 assert_equals(getComputedStyle(obj1, null)["width"], "100px", "The width s
hould be 100px."); |
| 40 }); |
| 41 t3.done(); |
| 42 |
| 43 t4.step(function() { |
| 44 assert_equals(getComputedStyle(obj1, null)["height"], "50px", "The height
should be 50px."); |
| 45 }); |
| 46 t4.done(); |
| 47 } |
| 48 </script> |
| 49 |
| 50 </body> |
OLD | NEW |