This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Spinned out from Bug 24042.
Per the discussion in bug 24623, I think this is unnecessary, unless we're trying to explicitly kill document.write() for purity reasons (in which case I'm happy to get behind this, if we're clear that we're not doing this for technical reasons).
FYI, I'd be happy to start killing document.write (well, document.open) And one way to do it is to not expose new features to it.
(In reply to Olli Pettay from comment #2) > FYI, I'd be happy to start killing document.write (well, document.open) > And one way to do it is to not expose new features to it. Sounds good to me.
Basically this change makes imports more like external scripts where document.write() is voided. So it aligns the kill-document-write path.
https://github.com/w3c/webcomponents/commit/6786e3c576334bbdd0254c4258c43e5199d9b6f2 I was confused but there are two cases to consider. One is document.write() against the master document. As Hixie mentioned, it just blows the document away. So we don't have do anything. Another is document.write() for imports themselves. IIRC, it works for now. But once we address Bug 24042 and UA delays script execution timing more aggressively, the situation will change and document.write() won't work anymore. I don't have any immediate plan to address Bug 24042 as it needs more consideration and ES6 <module> or <script defer> might resolve the underlying problem for free. I however want to remove obstacles to attack it in the first place. So I disabled these document APIs for imports. It's a safety net, and I think this is what Olli suggests.
Please do not monkeypatch other specs. Talk to the html spec editor about getting this case handled.
(In reply to Boris Zbarsky from comment #6) > Please do not monkeypatch other specs. Talk to the html spec editor about > getting this case handled. We're thinking about making HTML Imports part of WHATWG HTML once the churn is settled. We want to do that exactly because the large part of the spec is a set of monkey patches.
This is resolved now, no? Calling document.write() on an import doc throws, and calling it on a master document just works as already specified, nothing new.
(In reply to Ian 'Hixie' Hickson from comment #8) > This is resolved now, no? Calling document.write() on an import doc throws, > and calling it on a master document just works as already specified, nothing > new. You're right. This was reopened to request removing monkey-patching. As it is merged to HTML, this will no longer an issue. closing.