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

Unified Diff: LayoutTests/fast/block/float/float-mark-descendants-for-layout-crash.html

Issue 195363007: Avoid unnecessary descents into nested boxes with floats. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/block/float/float-mark-descendants-for-layout-crash.html
diff --git a/LayoutTests/fast/block/float/float-mark-descendants-for-layout-crash.html b/LayoutTests/fast/block/float/float-mark-descendants-for-layout-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..98d31a9511b96a4bc8355b882e2f6dd85c822cf2
--- /dev/null
+++ b/LayoutTests/fast/block/float/float-mark-descendants-for-layout-crash.html
@@ -0,0 +1,52 @@
+<!doctype HTML>
+<script>
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+</script>
+<style>
+.c7 { float: right; }
+.c8:nth-last-of-type(2n+1) { float: right;}
+</style>
+<script>
+// This test will crash if we leave stale floats in a child's descendants.
+var nodes = Array();
+function reference(domNode) {
+ this.domNode = domNode;
+}
+function walk(a, currentPrefix, index, domNode) {
+ if(domNode == null)
+ return;
+ newPrefix = currentPrefix + "_" + index;
+ a[newPrefix] = new reference(domNode);
+}
+function clear() {
+ var a = new Array();
+ walk(a, "", 0, document.documentElement);
+ for(key in a) {
+ a[key].domNode.parentNode.removeChild(a[key].domNode);
+ }
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+function boom() {
+ nodes[0] = document.createElement('meter');
+ nodes[0].setAttribute('class', 'c7');
+ document.documentElement.appendChild(nodes[0]);
+ nodes[58] = document.createElement('br');
+ document.documentElement.appendChild(nodes[58]);
+ nodes[63] = document.createElement('h1');
+ nodes[63].setAttribute('class', 'c8');
+ document.documentElement.appendChild(nodes[63]);
+ nodes[66] = document.createElement('iframe');
+ nodes[66].setAttribute('srcdoc', '');
+ document.documentElement.appendChild(nodes[66]);
+ nodes[72] = document.createElement('sup');
+ nodes[72].setAttribute('class', 'c7');
+ document.documentElement.appendChild(nodes[72]);
+ setTimeout('clear();', 700);
Julien - ping for review 2014/04/25 20:22:28 Do we really need a 700ms sleep. Usually forcing a
+}
Julien - ping for review 2014/04/25 20:22:28 Let's have something in the output that says what
+window.onload = boom;
+</script>
+

Powered by Google App Engine
This is Rietveld 408576698