Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Unified Diff: LayoutTests/svg/custom/load-image-removed-in-onload.html

Issue 375923002: Don't dispatch '(SVG)load' to ancestors of <svg:image> after doc. 'load' (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Drop assert_true; use toSVGElement. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>
« no previous file with comments | « LayoutTests/svg/custom/image-svgload-after-docload.html ('k') | LayoutTests/svg/custom/load-image-reparented-in-onload.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698