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

Side by Side Diff: LayoutTests/svg/custom/load-image-reparented-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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script>
5 var events = [];
6 function logLoadEvent(event) {
7 events.push(event.target.id);
8 }
9 function reparentAndLogLoadEvent(event) {
10 logLoadEvent(event);
11 var element = event.target;
12 var newParent = element.parentNode.previousSibling.previousSibling;
13 newParent.appendChild(element);
14 }
15
16 var t = async_test("'load' event fires on parent of element reparented in onload handler.");
17
18 window.onload = function() {
19 t.step(function() {
20 assert_equals(events.length, 4);
21 assert_equals(events[0], "inner1");
22 assert_equals(events[1], "image");
23 assert_equals(events[2], "inner2");
24 assert_equals(events[3], "outer");
25 }, 'Verify order and presence of events');
26 t.done();
27 };
28 </script>
29 <svg id="outer" onload="logLoadEvent(evt)">
30 <svg id="inner1" onload="logLoadEvent(evt)"></svg>
31 <svg id="inner2" onload="logLoadEvent(evt)">
32 <image id="image" onload="reparentAndLogLoadEvent(evt)"
33 xlink:href="resources/red-checker.png" width="10" height="10"/>
34 </svg>
35 </svg>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698