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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/loader/crash-focus-in-unload.html

Issue 2692423006: Fix stale focusedElement in unloaded document. (Closed)
Patch Set: Check nullptr. Created 3 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src='../../resources/testharness.js'></script>
3 <script src='../../resources/testharnessreport.js'></script>
4 <body>
5 <iframe></iframe>
6 </body>
7 <script>
8 'use strict';
9
10 let iframe = document.querySelector('iframe');
11 let iframeDoc = iframe.contentDocument;
12
13 let focusableIframe = document.createElement('iframe');
14 iframeDoc.body.appendChild(focusableIframe);
15
16 focusableIframe.contentWindow.addEventListener('unload', () => {
17 // Try to focus on frame owner during unload event of its content.
18 focusableIframe.focus();
19 });
20
21 test(() => {
22 // Trigger unload event.
23 document.body.appendChild(focusableIframe);
24
25 var input = document.createElement('input');
26 iframeDoc.body.appendChild(input);
27 input.focus();
28 assert_true(true, 'This test must run without crash.');
29 }, 'Should not trigger assertion. crbug.com/677690');
30 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698