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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/foreignObject/viewport-foreignobject-crash.html

Issue 2967343002: Convert svg/foreignObject/viewport-foreignobject-crash.html using testharness. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/svg/foreignObject/viewport-foreignobject-crash-expected.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <body> 2 <body>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
3 <script> 5 <script>
6 var t = async_test();
4 var script = document.getElementsByTagName("script")[0]; 7 var script = document.getElementsByTagName("script")[0];
5 script.parentNode.removeChild(script); 8 script.parentNode.removeChild(script);
6 9
7 var count = 0; 10 var count = 0;
8 function crash() { 11 function crash() {
9 var element = event.srcElement; 12 var element = event.srcElement;
10 document.adoptNode(element); 13 document.adoptNode(element);
11 if (!document.body.innerHTML) 14 if (!document.body.innerHTML)
12 return; 15 return;
13 document.execCommand('InsertHTML', false, document.body.innerHTML); 16 document.execCommand('InsertHTML', false, document.body.innerHTML);
14 if (count == 1) { 17 if (count == 1) {
15 document.removeEventListener("DOMNodeInserted", crash, false); 18 document.removeEventListener("DOMNodeInserted", crash, false);
16 document.body.innerHTML = "PASS"; 19 t.done();
17 return; 20 return;
18 } 21 }
19 count += 1; 22 count += 1;
20 document.body.appendChild(element); 23 document.body.appendChild(element);
21 element.insertAdjacentHTML('beforeend', '<svg><foreignObject>A</foreignObjec t></svg>'); 24 element.insertAdjacentHTML('beforeend', '<svg><foreignObject>A</foreignObjec t></svg>');
22 element.focus(); 25 element.focus();
23 } 26 }
24 27
25 document.addEventListener("DOMNodeInserted", crash, false); 28 document.addEventListener("DOMNodeInserted", crash, false);
26 document.addEventListener("DOMContentLoaded", function () { 29 document.addEventListener("DOMContentLoaded", function () {
27 document.execCommand("SelectAll", false, false); 30 document.execCommand("SelectAll", false, false);
28 var range = window.getSelection().getRangeAt(0); 31 var range = window.getSelection().getRangeAt(0);
29 var docFragment = range.extractContents(); 32 var docFragment = range.extractContents();
30 document.documentElement.firstChild.appendChild(docFragment); 33 document.documentElement.firstChild.appendChild(docFragment);
31 }, false); 34 }, false);
32 </script> 35 </script>
33 <input/> 36 <input/>
34 </body> 37 </body>
35 </html> 38 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/svg/foreignObject/viewport-foreignobject-crash-expected.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698