| <script src="../../resources/js-test-pre.js"></script> |
| description("Test that it is possible to dispatchEvent() works on documents created using DOMParser.parseFromString()."); |
| var wasEventDispatched = false; |
| var documentString = '<?xml version="1.0" encoding="UTF-8"?>\ |
| var parser = new DOMParser(); |
| var parsedDocument = parser.parseFromString(documentString, 'text/xml'); |
| parsedDocument.addEventListener("click", function(evt) { |
| shouldBeFalse("wasEventDispatched"); |
| wasEventDispatched = true; |
| var clickEvent = parsedDocument.createEvent("Event"); |
| clickEvent.initEvent("click", true, true); |
| parsedDocument.getElementsByTagName("foo")[0].dispatchEvent(clickEvent); |
| shouldBeTrue("wasEventDispatched"); |
| <script src="../../resources/js-test-post.js"></script> |