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

Unified Diff: LayoutTests/fast/block/float/float-selection-delete-crash.html

Issue 131223003: Track intruding and overhanging floats (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 11 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-selection-delete-crash.html
diff --git a/LayoutTests/fast/block/float/float-selection-delete-crash.html b/LayoutTests/fast/block/float/float-selection-delete-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..42d0139c6ed1acb3446d73e9f2e36ce8004012f6
--- /dev/null
+++ b/LayoutTests/fast/block/float/float-selection-delete-crash.html
@@ -0,0 +1,33 @@
+<style>
+ * {
+ float: left;
+ }
+ *:after {
+ content: url();
+ display: block;
+ }
+</style>
+<script>
+function domNodeRemovedFromDocumentHandler() {
+ document.removeEventListener("DOMNodeRemovedFromDocument", domNodeRemovedFromDocumentHandler, true);
+ var selection = window.getSelection();
+ selection.deleteFromDocument();
+ var range = selection.getRangeAt(81 % selection.rangeCount);
+ var elements = document.getElementsByTagName("*");
+ range.surroundContents(elements[1]);
+}
+document.addEventListener("DOMNodeRemovedFromDocument", domNodeRemovedFromDocumentHandler, true);
+window.onload = function() {
+ var selection = window.getSelection();
+ var body = document.getElementsByTagName("body")[0];
+ selection.collapse(body, 2);
+ selection.deleteFromDocument();
+};
+
+if (window.testRunner)
+ testRunner.dumpAsText();
+</script>
+PASS: This passes if it does not crash with an ASAN enabled build.
+<table>
+<caption>
+<col>
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/block/float/float-selection-delete-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698