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

Side by Side Diff: LayoutTests/svg/custom/load-svgfragments-inserted-after-docload.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 <svg></svg>
5 <script>
6 const svgNs = 'http://www.w3.org/2000/svg';
7
8 function makeImage(test) {
9 var image = document.createElementNS(svgNs, 'image');
10 image.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', 'resources/ red-checker.png');
11 image.setAttribute('width', 10);
12 image.setAttribute('height', 10);
13 image.onload = test.step_func(function() {
14 assert_true(true);
15 setTimeout(function() { test.done(); }, 0);
16 });
17 return image;
18 }
19
20 function makeSvg(test) {
21 var svgRoot = document.createElementNS(svgNs, 'svg');
22 svgRoot.onload = test.unreached_func("SVG 'load' should not be fired after doc ument 'load'");
23 return svgRoot;
24 }
25
26 function makeSvgWithImage(test) {
27 var svgRoot = makeSvg(test);
28 svgRoot.appendChild(makeImage(test));
29 return svgRoot;
30 }
31
32 var t0 = async_test("No 'load' event fired after document load for outer SVG roo t.");
33 var t1 = async_test("No 'load' event fired after document load for outer SVG roo t w/ image.");
34 var t2 = async_test("No 'load' event fired after document load for inner SVG roo t.");
35 var t3 = async_test("No 'load' event fired after document load for inner SVG roo t w/ image.");
36
37 window.onload = function() {
38 var parsedSvg = document.querySelector('svg');
39
40 t0.step(function() { document.body.appendChild(makeSvg(t0)); });
41 t1.step(function() { document.body.appendChild(makeSvgWithImage(t1)); });
42
43 t2.step(function() { parsedSvg.appendChild(makeSvg(t2)); });
44 t3.step(function() { parsedSvg.appendChild(makeSvgWithImage(t3)); });
45
46 setTimeout(function() {
47 t0.done();
48 t2.done();
49 }, 0);
50 };
51 </script>
OLDNEW
« no previous file with comments | « LayoutTests/svg/custom/load-image-reparented-in-onload.html ('k') | Source/core/svg/SVGElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698