Suggested project: aligning document.open() across browsers

15 views
Skip to first unread message

Domenic Denicola

unread,
Jul 3, 2017, 12:59:24 PM7/3/17
to platform-pr...@chromium.org
Hi all,

I wanted to provide a suggested work item for predictability folks. I'm not sure on its priority, but I wanted to get it on your radar and hear what you thought.

Right now the HTML Standard has a model for document.open() which replaces the Window object. However, only Firefox matches this spec. All other browsers have a different model, which does various things to "reset" the Window object without actually replacing it. (E.g., removing all event listeners.) This is summarized in https://github.com/whatwg/html/issues/1698 . There are various other related issues; see https://github.com/whatwg/html/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20document.open .

However, we haven't been willing to just switch the spec, as we don't have a good idea what other browsers do exactly, and whether it's aligned. So, this project would consist of:

* Surveying Edge, Blink, and WebKit, and finding out exactly what steps they carry out. Jochen gave a description for Blink in https://github.com/whatwg/html/issues/1698#issuecomment-301795931.
* Deciding on a reasonable intersection
* Writing web platform tests for this intersection
* Updating the spec to follow this intersection
* Aligning Blink with any delta between the current behavior and the now-specced intersection behavior

Again, I'm not sure whether interop in this area is a huge real-world pain point for developers. But it's a pretty gnarly area of the spec that complicates a bunch of other stuff (by making it possible to have multiple windows for one document) and the reality-spec mismatch is troubling. So I wanted to see what predictability folks thought about this. I hope this is a reasonable use of the mailing list :)

-Domenic

Mike West

unread,
Jul 5, 2017, 4:47:22 AM7/5/17
to Domenic Denicola, Charlie Reis, Daniel Cheng, Rick Byers, platform-pr...@chromium.org
`window.open()` and the mechanics of the resulting navigation has generally fallen between the cracks of a few different teams (navigation/site isolation, loading, security, etc). CCing rbyers@, creis@, and dcheng@ who were all on an earlier thread around related issues.

I think there's general agreement that it would be nice to do some cleanup here, both in Blink and in the spec, but no one (myself included) has seen it as high-enough priority to drop other work.

-mike


-Domenic

--
You received this message because you are subscribed to the Google Groups "platform-predictability" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-predictability+unsubscr...@chromium.org.
To post to this group, send email to platform-predictability@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-predictability/BLUPR0501MB8522A36B308E2074BDB173CDFD60%40BLUPR0501MB852.namprd05.prod.outlook.com.

Charlie Reis

unread,
Jul 5, 2017, 6:19:20 PM7/5/17
to Mike West, Domenic Denicola, Daniel Cheng, Rick Byers, platform-pr...@chromium.org, Nasko Oskov, Nick Carter, Alex Moshchuk
Sounds like this is about document.open() rather than window.open().  Adding nasko@, nick@, and alexmos@, since we (and dcheng@) were recently discussing better ways to handle document.open().  It's unfortunate that there's no way to observe it in the browser process today, for example, since the URL can change at that point (e.g., if an opener page calls document.write on an about:blank window).

We were brainstorming about issuing a navigation event to Chrome's WebContentsObservers, similar to history.replaceState.  That would give observers a chance to listen to it and know that the document has changed.  Sounds like there may be other changes needed in Blink as well for interop?

Charlie

Charlie Reis

unread,
Jul 5, 2017, 6:54:13 PM7/5/17
to Mike West, Domenic Denicola, Daniel Cheng, Rick Byers, platform-pr...@chromium.org, Nasko Oskov, Nick Carter, Alex Moshchuk
And for reference, there's some discussion of this on https://crbug.com/729021 (which is mainly about tracking document lifetime in Chrome's browser process).

Charlie
Reply all
Reply to author
Forward
0 new messages