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

Side by Side Diff: LayoutTests/svg/custom/pattern-3-step-cycle-dynamic-3.html

Issue 303693009: Make SVGResourcesCycleSolver check for cycles beyond one level (and more) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add dynamic tests. Created 6 years, 6 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>
3 if (window.testRunner) {
4 testRunner.dumpAsText();
5 testRunner.waitUntilDone();
6 window.onload = function() {
7 testRunner.displayAsyncThen(function() {
8 mutateTree();
9 testRunner.displayAsyncThen(function() {
10 testRunner.notifyDone();
11 });
12 });
13 };
14 } else {
15 window.onload = function() { setTimeout(mutateTree, 100); };
16 }
17 const svgNs = 'http://www.w3.org/2000/svg';
18 function buildPattern(patternId, refId) {
19 var pattern = document.createElementNS(svgNs, 'pattern');
20 var rect = pattern.appendChild(document.createElementNS(svgNs, 'rect'));
21 pattern.setAttribute('id', patternId);
22 pattern.setAttribute('width', 1);
23 pattern.setAttribute('height', 1);
24 rect.setAttribute('width', 100);
25 rect.setAttribute('height', 100);
26 rect.setAttribute('fill', 'url(#' + refId + ')');
27 return pattern;
28 }
29 function mutateTree() {
30 // Build a three-step pattern cycle in a detached
31 // subtree and then insert it at load.
32 var defs = document.createElementNS(svgNs, 'defs');
33 defs.appendChild(buildPattern('p3', 'p1'));
34 defs.appendChild(buildPattern('p2', 'p3'));
35 defs.appendChild(buildPattern('p1', 'p2'));
36 document.querySelector('svg').appendChild(defs);
37 }
38 </script>
39 <p>PASS if no crash (stack overflow).</p>
40 <svg width="100" height="100">
41 <rect width="100" height="100" fill="url(#p1)"/>
42 </svg>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698