Index: LayoutTests/svg/custom/load-image-removed-in-onload.html |
diff --git a/LayoutTests/svg/custom/load-image-removed-in-onload.html b/LayoutTests/svg/custom/load-image-removed-in-onload.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..39a53e079a3e113b361f9fe7104e6ae59e309492 |
--- /dev/null |
+++ b/LayoutTests/svg/custom/load-image-removed-in-onload.html |
@@ -0,0 +1,33 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script> |
+var events = []; |
+function logLoadEvent(event) { |
+ events.push(event.target.id); |
+} |
+function removeSelfAndLogLoadEvent(event) { |
+ logLoadEvent(event); |
+ event.target.remove(); |
+} |
+ |
+var t = async_test("'load' event fires on parent of element removed in onload handler."); |
+ |
+window.onload = function() { |
+ t.step(function() { |
+ assert_equals(events.length, 4); |
+ assert_equals(events[0], "inner1"); |
+ assert_equals(events[1], "image"); |
+ assert_equals(events[2], "inner2"); |
+ assert_equals(events[3], "outer"); |
+ }, 'Verify order and presence of events'); |
+ t.done(); |
+}; |
+</script> |
+<svg id="outer" onload="logLoadEvent(evt)"> |
+ <svg id="inner1" onload="logLoadEvent(evt)"></svg> |
+ <svg id="inner2" onload="logLoadEvent(evt)"> |
+ <image id="image" onload="removeSelfAndLogLoadEvent(evt)" |
+ xlink:href="resources/red-checker.png" width="10" height="10"/> |
+ </svg> |
+</svg> |