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

Side by Side Diff: LayoutTests/svg/custom/js-late-pattern-and-object-creation.svg

Issue 1286093008: Replace setTimeout() with runAfterLayoutAndPaint() in a few tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | LayoutTests/svg/custom/resource-client-removal.svg » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics /SVG/1.1/DTD/svg11-basic.dtd"> 2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics /SVG/1.1/DTD/svg11-basic.dtd">
3 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlin k" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" onload="runRe paintAndPixelTest()"> 3 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlin k" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" onload="runRe paintAndPixelTest()">
4 <script xlink:href="../../resources/run-after-layout-and-paint.js"/>
4 <script xlink:href="../../fast/repaint/resources/text-based-repaint.js"/> 5 <script xlink:href="../../fast/repaint/resources/text-based-repaint.js"/>
5 <g id="content"/> 6 <g id="content"/>
6 7
7 <script> 8 <script>
8 window.testIsAsync = true; 9 window.testIsAsync = true;
9 var content = document.getElementById("content"); 10 var content = document.getElementById("content");
10 11
11 function repaintTest() { 12 function repaintTest() {
12 // FIXME: we need a better way of waiting for layout/repainting to happe n 13 runAfterLayoutAndPaint(createPatterns);
13 setTimeout(createPatterns, 1);
14 } 14 }
15 15
16 function createPatterns() 16 function createPatterns()
17 { 17 {
18 // Setup "fillPattern" 18 // Setup "fillPattern"
19 var pattern1 = document.createElementNS("http://www.w3.org/2000/svg", "p attern"); 19 var pattern1 = document.createElementNS("http://www.w3.org/2000/svg", "p attern");
20 pattern1.setAttribute("id", "fillPattern"); 20 pattern1.setAttribute("id", "fillPattern");
21 pattern1.setAttribute("patternUnits", "userSpaceOnUse"); 21 pattern1.setAttribute("patternUnits", "userSpaceOnUse");
22 pattern1.setAttribute("x", "0"); 22 pattern1.setAttribute("x", "0");
23 pattern1.setAttribute("y", "0"); 23 pattern1.setAttribute("y", "0");
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 rect22.setAttribute("y", "10"); 64 rect22.setAttribute("y", "10");
65 rect22.setAttribute("width", "10"); 65 rect22.setAttribute("width", "10");
66 rect22.setAttribute("height", "10"); 66 rect22.setAttribute("height", "10");
67 rect22.setAttribute("fill", "blue"); 67 rect22.setAttribute("fill", "blue");
68 68
69 pattern2.appendChild(rect12); 69 pattern2.appendChild(rect12);
70 pattern2.appendChild(rect22); 70 pattern2.appendChild(rect22);
71 71
72 content.appendChild(pattern2); 72 content.appendChild(pattern2);
73 73
74 // FIXME: we need a better way of waiting for layout/repainting to happe n 74 runAfterLayoutAndPaint(setupPatternUsers);
75 setTimeout(setupPatternUsers, 1);
76 } 75 }
77 76
78 function setupPatternUsers() 77 function setupPatternUsers()
79 { 78 {
80 var text1 = document.createElementNS("http://www.w3.org/2000/svg", "text "); 79 var text1 = document.createElementNS("http://www.w3.org/2000/svg", "text ");
81 text1.setAttribute("font-size", "68"); 80 text1.setAttribute("font-size", "68");
82 text1.setAttribute("x", "-150"); 81 text1.setAttribute("x", "-150");
83 text1.setAttribute("y", "70") 82 text1.setAttribute("y", "70")
84 text1.setAttribute("fill", "url(#fillPattern)"); 83 text1.setAttribute("fill", "url(#fillPattern)");
85 text1.setAttribute("stroke", "none"); 84 text1.setAttribute("stroke", "none");
(...skipping 19 matching lines...) Expand all
105 text3.setAttribute("stroke", "url(#strokePattern)"); 104 text3.setAttribute("stroke", "url(#strokePattern)");
106 text3.appendChild(document.createTextNode("Pattern on fill/stroke")); 105 text3.appendChild(document.createTextNode("Pattern on fill/stroke"));
107 106
108 content.appendChild(text3); 107 content.appendChild(text3);
109 108
110 finishRepaintTest(); 109 finishRepaintTest();
111 } 110 }
112 </script> 111 </script>
113 112
114 </svg> 113 </svg>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/svg/custom/resource-client-removal.svg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698