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

Side by Side Diff: LayoutTests/svg/custom/loadevents-async.html

Issue 134263003: Followup fixes for bug 332066. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: setTimeout == race with load Created 6 years, 11 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
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script> 7 <script>
8 description("This test ensures that tree mutation on the load doesn't break cons istency."); 8 description("This test ensures that tree mutation on the load doesn't break cons istency.");
9 var invoked = false; 9 var invoked = false;
10 var spanElement = document.createElementNS("http://www.w3.org/1999/xhtml", "span "); 10 var spanElement = document.createElementNS("http://www.w3.org/1999/xhtml", "span ");
11 var divElement = document.createElementNS("http://www.w3.org/1999/xhtml", "div") ; 11 var divElement = document.createElementNS("http://www.w3.org/1999/xhtml", "div") ;
12 var useElement = document.createElementNS("http://www.w3.org/2000/svg", "use"); 12 var useElement = document.createElementNS("http://www.w3.org/2000/svg", "use");
13 var emptyDocument = document.implementation.createDocument("", "", null); 13 var emptyDocument = document.implementation.createDocument("", "", null);
14 14
15 document.body.appendChild(spanElement); 15 document.body.appendChild(spanElement);
16 divElement.appendChild(useElement); 16 divElement.appendChild(useElement);
17 useElement.addEventListener("load", function () { emptyDocument.adoptNode(useEle ment); invoked = true; }, false); 17 useElement.addEventListener("load", function () {
18 emptyDocument.adoptNode(useElement);
19 invoked = true;
20 shouldBeTrue("invoked");
Stephen Chennney 2014/01/13 17:24:17 This seems pointless. Is there some other sensible
Erik Dahlström (inactive) 2014/01/14 09:03:59 Done.
21 finishJSTest();
22 }, false);
18 spanElement.appendChild(divElement); 23 spanElement.appendChild(divElement);
19 document.body.appendChild(useElement); 24 document.body.appendChild(useElement);
20 shouldBeFalse("invoked"); 25 shouldBeFalse("invoked");
21 26
22 jsTestIsAsync = true; 27 jsTestIsAsync = true;
23 setTimeout(function() {
24 shouldBeTrue("invoked");
25 finishJSTest();
26 }, 1);
27 28
29 // need to reference an external file to get a load event
30 useElement.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", "resourc es/rgb.svg#RGB");
28 </script> 31 </script>
29 <body> 32 <body>
30 </html> 33 </html>
OLDNEW
« no previous file with comments | « no previous file | Source/core/svg/SVGDocumentExtensions.cpp » ('j') | Source/core/svg/SVGUseElement.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698