OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../../resources/js-test.js"></script> | 2 <script src="../../../resources/js-test.js"></script> |
3 <script> | 3 <script> |
4 description("This tests the handling of the img.crossOrigin attribute"); | 4 description("This tests the handling of the img.crossOrigin attribute"); |
5 var img = document.createElement("img"); | 5 var img = document.createElement("img"); |
6 shouldBeTrue("'crossOrigin' in img"); | 6 shouldBeTrue("'crossOrigin' in img"); |
7 shouldBeEqualToString("img.crossOrigin", ""); | 7 shouldBeNull("img.crossOrigin"); |
8 shouldBeEqualToString("img.setAttribute('crossorigin', ''); img.crossOrigin", "a
nonymous"); | 8 shouldBeEqualToString("img.setAttribute('crossorigin', ''); img.crossOrigin", "a
nonymous"); |
9 shouldBeEqualToString("img.removeAttribute('crossorigin'); img.crossOrigin", "")
; | 9 shouldBeNull("img.removeAttribute('crossorigin'); img.crossOrigin"); |
10 shouldBeEqualToString("img.setAttribute('crossorigin', 'foo'); img.crossOrigin",
"anonymous"); | 10 shouldBeEqualToString("img.setAttribute('crossorigin', 'foo'); img.crossOrigin",
"anonymous"); |
11 shouldBeEqualToString("img.setAttribute('crossorigin', 'ANONYMOUS'); img.crossOr
igin", "anonymous"); | 11 shouldBeEqualToString("img.setAttribute('crossorigin', 'ANONYMOUS'); img.crossOr
igin", "anonymous"); |
12 shouldBeEqualToString("img.setAttribute('crossorigin', 'use-credentials'); img.c
rossOrigin", "use-credentials"); | 12 shouldBeEqualToString("img.setAttribute('crossorigin', 'use-credentials'); img.c
rossOrigin", "use-credentials"); |
13 shouldBeEqualToString("img.crossOrigin = ''; img.getAttribute('crossorigin')", "
"); | 13 shouldBeEqualToString("img.crossOrigin = ''; img.getAttribute('crossorigin')", "
"); |
14 shouldBeEqualToString("img.crossOrigin = 'foo'; img.getAttribute('crossorigin')"
, "foo"); | 14 shouldBeEqualToString("img.crossOrigin = 'foo'; img.getAttribute('crossorigin')"
, "foo"); |
15 shouldBeEqualToString("img.crossOrigin = null; img.getAttribute('crossorigin')",
"null"); | 15 shouldBeFalse("img.crossOrigin = null; img.hasAttribute('crossorigin')"); |
16 shouldBeEqualToString("img.crossOrigin = 'ANONYMOUS'; img.getAttribute('crossori
gin')", "ANONYMOUS"); | 16 shouldBeEqualToString("img.crossOrigin = 'ANONYMOUS'; img.getAttribute('crossori
gin')", "ANONYMOUS"); |
17 shouldBeEqualToString("img.crossOrigin = 'use-credentials'; img.getAttribute('cr
ossorigin')", "use-credentials"); | 17 shouldBeEqualToString("img.crossOrigin = 'use-credentials'; img.getAttribute('cr
ossorigin')", "use-credentials"); |
18 </script> | 18 </script> |
OLD | NEW |