Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Window.open and related infrastructure #20678

Merged
merged 7 commits into from Aug 11, 2018

make auxiliary browsing-context script-closeable

  • Loading branch information
gterzian committed Aug 10, 2018
commit fee542831683d52b07cc59bf62fb1b5442cd94ba
@@ -609,13 +609,13 @@ impl WindowMethods for Window {

// https://html.spec.whatwg.org/multipage/#dom-window-close
fn Close(&self) {
let window_proxy = self.window_proxy();
// Note: check the length of the "session history", as opposed to the joint session history?
// see https://github.com/whatwg/html/issues/3734
if let Ok(history_length) = self.History().GetLength() {
// TODO: allow auxilliary browsing contexts created by script to be script-closeable,
// regardless of history length.
let is_auxiliary = window_proxy.is_auxiliary();
// https://html.spec.whatwg.org/multipage/#script-closable
let is_script_closable = self.is_top_level() && history_length == 1;
let is_script_closable = (self.is_top_level() && history_length == 1) || is_auxiliary;
if is_script_closable {
let doc = self.Document();
// https://html.spec.whatwg.org/multipage/#closing-browsing-contexts

This file was deleted.

This file was deleted.

This file was deleted.

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.