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

Side by Side Diff: LayoutTests/fast/dom/HTMLObjectElement/beforeload-set-text-crash.xhtml

Issue 200763006: Node::setTextContent should avoid work when nothing changes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated beforeload-set-text-crash to not timeout Created 6 years, 9 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/fast/repaint/set-text-content-same.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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html xmlns="http://www.w3.org/1999/xhtml"> 2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <body> 3 <body>
4 Test passes if it does not crash. 4 Test passes if it does not crash.
5 <object id="object" type="image/svg+xml" /> 5 <object id="object" type="image/svg+xml" />
6 <script src="../../../resources/js-test.js"></script> 6 <script src="../../../resources/js-test.js"></script>
7 <script> 7 <script>
8 window.jsTestIsAsync = true; 8 window.jsTestIsAsync = true;
9 var count = 0; 9 var count = 0;
10 function setText() { 10 function setText() {
11 count++; 11 count++;
12 if (count > 100) { 12 if (count > 100) {
13 document.removeEventListener("beforeload", setText, true); 13 document.removeEventListener("beforeload", setText, true);
14 finishJSTest(); 14 finishJSTest();
15 } 15 }
16 gc(); // Because we are recursively entering into setText, can't gc() after this command. 16 gc(); // Because we are recursively entering into setText, can't gc() after this command.
17 document.getElementById("object").textContent = "A"; 17 // textContent will ignore setting identical text, so use count.
18 document.getElementById("object").textContent = count;
18 } 19 }
19 document.execCommand("SelectAll"); 20 document.execCommand("SelectAll");
20 document.getElementById("object").textContent = "A"; 21 document.getElementById("object").textContent = "A";
21 document.addEventListener("beforeload", setText, true); 22 document.addEventListener("beforeload", setText, true);
22 event = document.createEvent("Event"); 23 event = document.createEvent("Event");
23 event.initEvent("beforeload", false); 24 event.initEvent("beforeload", false);
24 document.documentElement.dispatchEvent(event); 25 document.documentElement.dispatchEvent(event);
25 </script> 26 </script>
26 </body> 27 </body>
27 </html> 28 </html>
28 29
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/repaint/set-text-content-same.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698