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

Side by Side Diff: LayoutTests/editing/inserting/insert-with-javascript-protocol-crash.html

Issue 221673003: Defer iframe JavaScript URL evaluation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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
1 <script> 1 <script>
2 onload = function() { 2 onload = function() {
3 document.execCommand('selectall'); 3 document.execCommand('selectall');
4 var iframe = document.createElement('iframe'); 4 var iframe = document.createElement('iframe');
5 iframe.onload = startIframe; 5 iframe.onload = startIframe;
6 document.documentElement.appendChild(iframe); 6 document.documentElement.appendChild(iframe);
7 document.body.textContent = 'PASS; NOT CRASHED'; 7 setTimeout(function() {
8 if (window.testRunner) 8 document.body.textContent = 'PASS; NOT CRASHED';
9 testRunner.dumpAsText(); 9 if (window.testRunner)
10 testRunner.dumpAsText();
11 }, 0);
10 }; 12 };
11 13
12 function startIframe() 14 function startIframe()
13 { 15 {
14 document.designMode = 'on'; 16 document.designMode = 'on';
15 document.execCommand('justifyfull'); 17 document.execCommand('justifyfull');
16 document.execCommand('insertimage', false, 'x.gif'); 18 document.execCommand('insertimage', false, 'x.gif');
17 document.execCommand('indent'); 19 document.execCommand('indent');
18 document.execCommand('inserthtml', false, '<iframe></iframe>') 20 document.execCommand('inserthtml', false, '<iframe></iframe>')
19 document.execCommand('inserthtml', false, '<iframe src="javascript:window.to p.startIFrame2()"></iframe>'); 21 document.execCommand('inserthtml', false, '<iframe src="javascript:window.to p.startIFrame2()"></iframe>');
20 } 22 }
21 23
22 var counter = 0; 24 var counter = 0;
23 function startIFrame2() 25 function startIFrame2()
24 { 26 {
25 try { 27 try {
26 ++counter; 28 ++counter;
27 if (counter >= 22) 29 if (counter >= 22)
28 return; 30 return;
29 document.execCommand('justifyleft'); 31 document.execCommand('justifyleft');
30 document.execCommand('indent'); 32 document.execCommand('indent');
31 document.execCommand('forwardDelete'); 33 document.execCommand('forwardDelete');
32 } catch (e) { 34 } catch (e) {
33 // Catch "Uncaught RangeError: Maximum call stack size exceeded." 35 // Catch "Uncaught RangeError: Maximum call stack size exceeded."
34 } 36 }
35 } 37 }
36 </script> 38 </script>
37 <body></body> 39 <body></body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698