2 <script src=
"../../../resources/js-test.js"></script>
4 description("This tests the handling of the img.crossOrigin attribute");
5 var img
= document
.createElement("img");
6 shouldBeTrue("'crossOrigin' in img");
7 shouldBeNull("img.crossOrigin");
8 shouldBeEqualToString("img.setAttribute('crossorigin', ''); img.crossOrigin", "anonymous");
9 shouldBeNull("img.removeAttribute('crossorigin'); img.crossOrigin");
10 shouldBeEqualToString("img.setAttribute('crossorigin', 'foo'); img.crossOrigin", "anonymous");
11 shouldBeEqualToString("img.setAttribute('crossorigin', 'ANONYMOUS'); img.crossOrigin", "anonymous");
12 shouldBeEqualToString("img.setAttribute('crossorigin', 'use-credentials'); img.crossOrigin", "use-credentials");
13 shouldBeEqualToString("img.crossOrigin = ''; img.getAttribute('crossorigin')", "");
14 shouldBeEqualToString("img.crossOrigin = 'foo'; img.getAttribute('crossorigin')", "foo");
15 shouldBeFalse("img.crossOrigin = null; img.hasAttribute('crossorigin')");
16 shouldBeEqualToString("img.crossOrigin = 'ANONYMOUS'; img.getAttribute('crossorigin')", "ANONYMOUS");
17 shouldBeEqualToString("img.crossOrigin = 'use-credentials'; img.getAttribute('crossorigin')", "use-credentials");