document.write allows writing to a non-active document |
||||||||
Issue descriptionChrome Version: 61.0.3141.7 What steps will reproduce the problem? (1) https://codepen.io/rbyers/pen/owJxgB What is the expected result? Per-spec the resulting document should still be empty (see https://bugzilla.mozilla.org/show_bug.cgi?id=867102). What happens instead? Get "success" Screenshots showing that only Firefox matches the spec in this regard today: https://www.browserstack.com/screenshots/f08a8f86598cd69ca761c9c5a2daf64987db23e6 Spec debate: https://github.com/whatwg/html/issues/2827 Given that 3 browsers already match and there's a reason to want to rely on this for streaming parsing, perhaps we should just be landing web-platform-test and spec changes to match reality. dvoytenko@ says AMP relies on this today for streaming shadow DOM. We could add a UseCounter to try to quantify the compat risk of changing, but with AMP depending on it the counter is almost certainly going to be non-trivial.
,
Jul 12 2017
,
Aug 28 2017
,
Aug 28 2017
I am really surprised document.write gets used in newer code. Sounds like a legacy API and sounds like hacky new code. Can you try and advocate against it to the AMP team and suggest alternatives? While this API will probably never be killed, its use should probably be highly discouraged.
,
Aug 28 2017
Please first provide a new API to do incremental and asynchronous parsing. We'll gladly switch to something more modern. As it stands, there's nothing I'm aware of.
,
Sep 1 2017
I created https://github.com/whatwg/html/issues/2993 for the new thing (is there already one?) and we can keep this issue open to track whether to match FF and the specs or not.
,
Sep 1 2017
Thanks a lot for filing the API request! I'd just like to make sure the current "streaming API" is not removed until the new one exists :)
,
Sep 1 2017
#7 - it is used far too much for a removal, I believe. I do not think it will ever go away, unfortunately.
,
Jul 16
,
Jul 17
,
Jul 17
,
Jul 21
,
Sep 5
Per https://github.com/whatwg/html/issues/2827 and https://github.com/whatwg/html/pull/3977, document.open() is now allowed to be called on a non-active document in the HTML spec. |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by rbyers@chromium.org
, Jul 11 2017