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

Unified Diff: LayoutTests/editing/selection/focus-iframe-removal-crash.html

Issue 225163004: Element::focus() should acquire the reference of LocalFrame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « no previous file | LayoutTests/editing/selection/focus-iframe-removal-crash-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/editing/selection/focus-iframe-removal-crash.html
diff --git a/LayoutTests/editing/selection/focus-iframe-removal-crash.html b/LayoutTests/editing/selection/focus-iframe-removal-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..82c8eb446173d40b0d5d1ca4e9a9935b6b9499df
--- /dev/null
+++ b/LayoutTests/editing/selection/focus-iframe-removal-crash.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
+</head>
+<body>
+<iframe></iframe>
+<script>
+description('Should not crash if iframe\'s document element\'s DOMFocusOut event handler removes the iframe in the parent document.');
+
+window.jsTestIsAsync = true;
+
+function run()
+{
+ var iframe = document.getElementsByTagName('iframe')[0];
+ iframe.contentDocument.documentElement.contentEditable = true;
+ iframe.contentDocument.documentElement.addEventListener('DOMFocusOut', function () {
yosin_UTC9 2014/04/14 02:00:27 nit: Can we use "focusout" instead of "DOMFocusOut
Yuta Kitamura 2014/04/14 02:44:32 Done.
+ iframe.parentNode.removeChild(iframe);
+ }, false);
+ iframe.contentDocument.documentElement.focus();
+
+ testPassed('Did not crash.');
+ window.finishJSTest();
+}
+
+document.addEventListener('DOMContentLoaded', run);
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/editing/selection/focus-iframe-removal-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698