Bug 1400487 - Move img src declaration after onload and onerror declaration in file_meta_element.html. r=ckerschb

This commit is contained in:
vinoth 2018-03-29 15:22:53 -04:00
parent 9a6b5da848
commit c6574d2c99

View File

@ -9,7 +9,7 @@
<body>
<!-- try to load an image which is forbidden by meta CSP -->
<img id="testimage" src="http://mochi.test:8888/tests/image/test/mochitest/blue.png"></img>
<img id="testimage"></img>
<script type="application/javascript">
var myImg = document.getElementById("testimage");
@ -19,6 +19,8 @@
myImg.onerror = function(e) {
window.parent.postMessage({result: "img-blocked"}, "*");
};
//Image should be tried to load only after onload/onerror event declaration.
myImg.src = "http://mochi.test:8888/tests/image/test/mochitest/blue.png";
</script>
</body>