Skip to content

Commit

Permalink
Address initial PR feedback: add TODO about MIME type to HTML Module …
Browse files Browse the repository at this point in the history
…doc creation, remove non-quirks mode assignment and add origin assignment for new HTML Module doc, replace '=' usage with 'to', and clarify note about HTML Module script execution in prepare-a-script.
  • Loading branch information
dandclark committed Apr 12, 2019
1 parent a08ad96 commit 71074e4
Showing 1 changed file with 35 additions and 17 deletions.
52 changes: 35 additions & 17 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -58354,9 +58354,14 @@ o............A....e

</li>

<li><p>If the element's <span>node document</span> is an <span>HTML module document</span>, then
return. The script will be executed as part of <span
data-x="js-Evaluate">module graph evaluation</span>.</p></li>
<li>
<p>If the element's <span>node document</span> is an <span>HTML module document</span>, then
return.</p>

<p class="note">This means that scripts that are dynamically added to an HTML Module document
will not execute. The scripts that were originally part of the HTML Module document at parse
time will be executed as part of <span data-x="js-Evaluate">module graph evaluation</span>.</p>
</li>

<li>

Expand Down Expand Up @@ -79885,6 +79890,10 @@ interface <dfn>BarProp</dfn> {
data-x="concept-document-bc">browsing context</span>'s <span>browsing context
container</span>'s <span>node document</span>.</p></dd>

<dt>If the <code>Document</code> is an <span>HTML Module document</span></dt>

<dd><p>The <span>origin</span> that the <code>Document</code> was assigned when it was created
during <span>ParseHTMLModule</span>.</p></dd>

<dt>If the <code>Document</code> was obtained in some other manner (e.g. a <code>Document</code>
created using the <code data-x="dom-DOMImplementation-createDocument">createDocument()</code>
Expand Down Expand Up @@ -87249,7 +87258,7 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
<p>For each <span>ScriptEntry</span> <var>scriptEntry</var> in
<var>module</var>.[[RequestedModules]], do:</p>
<ol>
<li><p>If <var>scriptEntry</var>.[[ExternalScriptURL]] != null, continue to the next
<li><p>If <var>scriptEntry</var>.[[ExternalScriptURL]] is not null, continue to the next
<span>ScriptEntry</span>.</p></li>

<li><p>Let <var>importedModule</var> be <var>scriptEntry</var>.[[InlineModuleRecord]]).</p>
Expand Down Expand Up @@ -88007,8 +88016,8 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
<var>scriptEntries</var>:</p>

<ol>
<li><p>If <var>scriptEntry</var>'s <span>ExternalScriptURL</span> is not null, then perform the
following steps:</p>
<li><p>If <var>scriptEntry</var>'s <span>ExternalScriptURL</span> is not null, then perform
the following steps:</p>

<ol>
<li><p>Let <var>childURL</var> be the result result of calling
Expand Down Expand Up @@ -88261,12 +88270,19 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
<var>htmlModuleScript</var>) as the following:</p>

<ol>
<li><p>Create a new <span>Document</span> node <var>document</var> whose
<span data-x="concept-document-content-type">content type</span> is
<code data-x="">text/html</code> and mark it as being an <span
data-x="HTML documents">HTML document</span>. Let <var>document</var> be in
<span>no-quirks mode</span>. <var>document</var> must be considered an
<span>HTML module document</span>.</p></li>
<li>
<p>Create a new <span>Document</span> node <var>document</var> whose <span
data-x="concept-document-content-type">content type</span> is the
<span>HTML Module MIME type</span> and whose <span>origin</span> is
<var>htmlModuleScript</var>'s <span>settings object</span>'s <span>origin</span>, and mark it as
being an <span data-x="HTML documents">HTML document</span>. This <var>document</var> must be
considered an <span>HTML module document</span>.</p>

<p>TODO(HTMLModules): Discussion is still ongoing regarding whether the
<span>HTML Module MIME type</span> will be <code>text/html</code> or a new type introduced for
HTML Modules. See discussion <a
href="https://github.com/w3c/webcomponents/issues/742">here</a>.</p>
</li>

<li><p>Create a new <span>HTML parser</span>, and associate it with <var>document</var>.</p></li>

Expand All @@ -88292,18 +88308,19 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
<p>If <var>script</var> is inline:</p>

<ol>
<li><p>Set <var>scriptEntry</var>.[[InlineModuleRecord]] = <var>script</var>'s
<li><p>Set <var>scriptEntry</var>.[[InlineModuleRecord]] to <var>script</var>'s
<span>Source Text Module Record</span>.</p></li>

<li><p>Set <var>scriptEntry</var>.[[ExternalScriptURL]] = null.</p></li>
<li><p>Set <var>scriptEntry</var>.[[ExternalScriptURL]] to null.</p></li>
</ol>
<li>
<p>Otherwise:</p>

<ol>
<li><p>Set <var>scriptEntry</var>.[[InlineModuleRecord]] = null.</p></li>
<li><p>Set <var>scriptEntry</var>.[[InlineModuleRecord]] to null.</p></li>

<li><p>Set <var>scriptEntry</var>.[[ExternalScriptURL]] = *script’s* src URL.</p></li>
<li><p>Set <var>scriptEntry</var>.[[ExternalScriptURL]] to the value of <var>script</var>’s
<code data-x="attr-script-src">src</code> attribute.</p></li>
</ol>
</li>
<li><p>Append <var>scriptEntry</var> to <var>scriptEntries</var>.</p></li>
Expand Down Expand Up @@ -107239,7 +107256,8 @@ document.body.appendChild(text);
<dd>

<p>If the document is <em>not</em> <span>an <code>iframe</code> <code
data-x="attr-iframe-srcdoc">srcdoc</code> document</span>, then this is a <span>parse
data-x="attr-iframe-srcdoc">srcdoc</code> document</span> nor an
<span>HTML module document</span>, then this is a <span>parse
error</span>; set the <code>Document</code> to <span>quirks mode</span>.</p>

<p>In any case, switch the <span>insertion mode</span> to "<span data-x="insertion mode: before
Expand Down

0 comments on commit 71074e4

Please sign in to comment.