Had a meeting with Domenic and Timothy.
Conclusions:
- We can probably do for |window.open| what we do for dialogs, not allow them when the event loop's termination nesting level is nonzero (see https://html.spec.whatwg.org/#termination-nesting-level). This should be a pretty simple spec change.
- The structure of the WPT would be an iframe that upon unload/beforeunload/hide tries to do a window.open and put it into a variable on the parent. The parent then deletes/navigates the iframe and then can immediately check the variable to pass/fail.
- For implementation, we can reuse a lot of dialog code. For example, alert calls |ChromeClient::OpenJavaScriptAlert| which calls |ChromeClient::CanOpenModalIfDuringPageDismissal|. That's a great function that implements the check we want. It takes a parameter of |ChromeClient::DialogType| for logging purposes, so we'd want to extend that type (and rename it so it isn't entirely about "dialog"s with an enum meaning "a window.open window", and then call it right before a window.open.
Comment 1 by a...@chromium.org
, Aug 10