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

Unified Diff: LayoutTests/fast/dom/StyleSheet/stylesheet-move-between-documents-crash.html

Issue 721103002: Fix lfiespan of ScopedStyleResolver (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix for hayato's review comments Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/dom/StyleSheet/stylesheet-move-between-documents-crash.html
diff --git a/LayoutTests/fast/dom/StyleSheet/stylesheet-move-between-documents-crash.html b/LayoutTests/fast/dom/StyleSheet/stylesheet-move-between-documents-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..cf51280b327ec95f237a75602194915512639ab8
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/stylesheet-move-between-documents-crash.html
@@ -0,0 +1,53 @@
+<script>
+if (window.testRunner)
+ testRunner.waitUntilDone();
+
+var iframe;
+var div;
+
+function start() {
+ iframe = document.createElement('iframe');
+ iframe.src='resources/stylesheet-move-iframe1.xml';
+ document.getElementById('store_div').appendChild(iframe);
+ window.setTimeout('startrly()', 100);
+}
+
+function startrly() {
+ if (location.hash == '#done') {
+ document.write('PASS');
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.notifyDone();
+ }
+ return;
+ }
+ var count = 0;
+ if (location.hash !== "")
+ count = parseInt(location.hash.substr(1));
+ if (count < 10) {
+ ++count;
+ location.hash = '#' + count;
+ } else {
+ location.hash = 'done';
+ }
+ div = document.createElement('div');
+ // <marquee> is special as it is implemented using Blink-in-JS (JS code runs for
+ // creating a custom element and a shadow root) and invokes its attachedCallback
+ // from C++ code, which can cause a special race condition with reloading when
+ // it is moved between different documents.
+ var marquee = document.createElement('marquee');
+ document.body.appendChild(marquee);
+ document.body.scrollIntoView(false);
+
+ var iframe2 = document.createElement('iframe');
+ iframe2.src = 'resources/stylesheet-move-iframe2.html';
+ document.body.appendChild(iframe2);
+
+ document.body.appendChild(iframe.contentDocument.firstChild);
+ div.appendChild(marquee);
+ window.setTimeout('location.reload();',20);
+}
+</script>
+<body onload="start()">
+<div id="store_div"></div>
+</script>

Powered by Google App Engine
This is Rietveld 408576698