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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/svg/custom/load-svgfragments-inserted-after-docload.html
diff --git a/LayoutTests/svg/custom/load-svgfragments-inserted-after-docload.html b/LayoutTests/svg/custom/load-svgfragments-inserted-after-docload.html
new file mode 100644
index 0000000000000000000000000000000000000000..80dc1d5b940254afbf2c06a0effd497795b88c3f
--- /dev/null
+++ b/LayoutTests/svg/custom/load-svgfragments-inserted-after-docload.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<svg></svg>
+<script>
+const svgNs = 'http://www.w3.org/2000/svg';
+
+function makeImage(test) {
+ var image = document.createElementNS(svgNs, 'image');
+ image.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', 'resources/red-checker.png');
+ image.setAttribute('width', 10);
+ image.setAttribute('height', 10);
+ image.onload = test.step_func(function() {
+ assert_true(true);
+ setTimeout(function() { test.done(); }, 0);
+ });
+ return image;
+}
+
+function makeSvg(test) {
+ var svgRoot = document.createElementNS(svgNs, 'svg');
+ svgRoot.onload = test.unreached_func("SVG 'load' should not be fired after document 'load'");
+ return svgRoot;
+}
+
+function makeSvgWithImage(test) {
+ var svgRoot = makeSvg(test);
+ svgRoot.appendChild(makeImage(test));
+ return svgRoot;
+}
+
+var t0 = async_test("No 'load' event fired after document load for outer SVG root.");
+var t1 = async_test("No 'load' event fired after document load for outer SVG root w/ image.");
+var t2 = async_test("No 'load' event fired after document load for inner SVG root.");
+var t3 = async_test("No 'load' event fired after document load for inner SVG root w/ image.");
+
+window.onload = function() {
+ var parsedSvg = document.querySelector('svg');
+
+ t0.step(function() { document.body.appendChild(makeSvg(t0)); });
+ t1.step(function() { document.body.appendChild(makeSvgWithImage(t1)); });
+
+ t2.step(function() { parsedSvg.appendChild(makeSvg(t2)); });
+ t3.step(function() { parsedSvg.appendChild(makeSvgWithImage(t3)); });
+
+ setTimeout(function() {
+ t0.done();
+ t2.done();
+ }, 0);
+};
+</script>
« 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