<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>24808</bug_id>
          
          <creation_ts>2014-02-25 18:47:13 +0000</creation_ts>
          <short_desc>[imports]: document.write() in imports should do nothing.</short_desc>
          <delta_ts>2014-05-14 00:17:23 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>HISTORICAL - Component Model</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>24623</dependson>
          <blocked>20683</blocked>
    
    <blocked>24042</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Morrita Hajime">morrita</reporter>
          <assigned_to name="Dimitri Glazkov">dglazkov</assigned_to>
          <cc>annevk</cc>
    
    <cc>bruno</cc>
    
    <cc>bugs</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>101362</commentid>
    <comment_count>0</comment_count>
    <who name="Morrita Hajime">morrita</who>
    <bug_when>2014-02-25 18:47:13 +0000</bug_when>
    <thetext>Spinned out from Bug 24042.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101365</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-02-25 18:50:34 +0000</bug_when>
    <thetext>Per the discussion in bug 24623, I think this is unnecessary, unless we&apos;re trying to explicitly kill document.write() for purity reasons (in which case I&apos;m happy to get behind this, if we&apos;re clear that we&apos;re not doing this for technical reasons).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101377</commentid>
    <comment_count>2</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2014-02-25 19:23:44 +0000</bug_when>
    <thetext>FYI, I&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101379</commentid>
    <comment_count>3</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2014-02-25 19:26:10 +0000</bug_when>
    <thetext>(In reply to Olli Pettay from comment #2)
&gt; FYI, I&apos;d be happy to start killing document.write (well, document.open)
&gt; And one way to do it is to not expose new features to it.

Sounds good to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101382</commentid>
    <comment_count>4</comment_count>
    <who name="Morrita Hajime">morrita</who>
    <bug_when>2014-02-25 19:30:35 +0000</bug_when>
    <thetext>Basically this change makes imports more like external scripts where document.write() is voided. So it aligns the kill-document-write path.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103889</commentid>
    <comment_count>5</comment_count>
    <who name="Morrita Hajime">morrita</who>
    <bug_when>2014-04-15 18:14:08 +0000</bug_when>
    <thetext>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&apos;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&apos;t work anymore.

I don&apos;t have any immediate plan to address Bug 24042 as it needs more consideration and ES6 &lt;module&gt; or &lt;script defer&gt; 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&apos;s a safety net, and I think this is what Olli suggests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103893</commentid>
    <comment_count>6</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-04-15 18:20:03 +0000</bug_when>
    <thetext>Please do not monkeypatch other specs.  Talk to the html spec editor about getting this case handled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103897</commentid>
    <comment_count>7</comment_count>
    <who name="Morrita Hajime">morrita</who>
    <bug_when>2014-04-15 19:52:25 +0000</bug_when>
    <thetext>(In reply to Boris Zbarsky from comment #6)
&gt; Please do not monkeypatch other specs.  Talk to the html spec editor about
&gt; getting this case handled.

We&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105925</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-13 21:59:24 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105935</commentid>
    <comment_count>9</comment_count>
    <who name="Morrita Hajime">morrita</who>
    <bug_when>2014-05-14 00:17:23 +0000</bug_when>
    <thetext>(In reply to Ian &apos;Hixie&apos; Hickson from comment #8)
&gt; This is resolved now, no? Calling document.write() on an import doc throws,
&gt; and calling it on a master document just works as already specified, nothing
&gt; new.
You&apos;re right. This was reopened to request removing monkey-patching.
As it is merged to HTML, this will no longer an issue. closing.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>