4 <title>CSSOM-View: HTMLImageElement x and y attributes
</title>
5 <link rel=
"author" title=
"Adobe" href=
"http://html.adobe.com/">
6 <link rel=
"author" title=
"Alan Stearns" href=
"mailto:stearns@adobe.com">
7 <link rel=
"reviewer" title=
"" href=
"">
8 <link rel=
"help" href=
"http://dev.w3.org/csswg/cssom-view/#excensions-to-the-htmlimageelement-interface">
9 <meta name=
"assert" content=
"HTMLImageElement attributes give x and y position of CSS layout box">
10 <meta name=
"flags" content=
"dom">
11 <script src=
"../resources/testharness.js"></script>
12 <script src=
"../resources/testharnessreport.js"></script>
16 <script type=
"text/javascript">
18 function testIMGAttributes(attribute_name
, display_none
) {
19 var element
= document
.createElement("img");
20 document
.body
.appendChild(element
);
21 element
.style
.setProperty("position", "absolute");
22 element
.style
.setProperty("left", "10px");
23 element
.style
.setProperty("top", "10px");
24 element
.style
.setProperty("width", "10px");
25 element
.style
.setProperty("height", "10px");
27 element
.style
.setProperty("display", "none");
29 var attributeValue
= element
[attribute_name
];
30 document
.body
.removeChild(element
);
31 return attributeValue
;
41 imgAttributes
.forEach(function(test_data
) {
42 test (function() { assert_equals(testIMGAttributes(test_data
[0], test_data
[1]), test_data
[2])},
43 "test " + test_data
[0] + " with display " + test_data
[1])