New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 674641 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Make window.closed behavior consistent across main frames and subframes

Project Member Reported by dcheng@chromium.org, Dec 15 2016

Issue description

While fixing some other bugs, I noticed that window.closed doesn't behave consistently for main frames vs subframes. window.close() is async-ish, so today, when we call it, we mark the window as closing and call closeWidgetSoon().

However, since this is tracked per-window, rather than per-page, given code like this:

var w = window.open();
w.document.body.appendChild(w.document.createChild('iframe'));
w.close();
console.log(w.closed);
console.log(w[0].closed);

will print:

true
false

The steps given in the spec for discarding a browsing context seem to imply that this should return true, true though: https://html.spec.whatwg.org/multipage/browsers.html#a-browsing-context-is-discarded

To make things more fun, Firefox agrees with us, but Edge returns false, true!

Spec bug: https://github.com/whatwg/html/issues/2126#issuecomment-267130700
 
Project Member

Comment 1 by sheriffbot@chromium.org, Feb 16 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 2 by tkent@chromium.org, Feb 20 2018

Labels: -Hotlist-Recharge-Cold
Status: Available (was: Untriaged)

Sign in to add a comment