Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make text/plugin/media/ua-inline no-quirks documents #6745

Merged
merged 8 commits into from
Jun 24, 2021
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 35 additions & 20 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -86855,6 +86855,11 @@ new PaymentRequest(…); // Allowed to use
object</span> given "<code data-x="">html</code>", <var>type</var>, and
<var>navigationParams</var>.</p></li>

<li><p>Set the <var>document</var>'s <span>parser cannot change the mode flag</span> to true.</p></li>
domenic marked this conversation as resolved.
Show resolved Hide resolved

<li><p>Set <var>document</var>'s <span data-x="concept-document-mode">mode</span>
domenic marked this conversation as resolved.
Show resolved Hide resolved
flag to <code data-x="">no-quirks</code>.</p></li>
mfreed7 marked this conversation as resolved.
Show resolved Hide resolved

<li><p>Create an <span>HTML parser</span> and associate it with the <var>document</var>. Act as
if the tokenizer had emitted a start tag token with the tag name "pre" followed by a single
U+000A LINE FEED (LF) character<!-- to get eaten, so that a leading LF in the text/plain stream
Expand Down Expand Up @@ -104076,16 +104081,16 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
<td><p>This error occurs if the parser encounters a U+003E (>) <span>code point</span> in the
<span data-x="syntax-doctype">DOCTYPE</span> public identifier (e.g., <code
data-x="">&lt;!DOCTYPE html PUBLIC "foo></code>). In such a case, if the DOCTYPE is correctly
placed as a document preamble, the parser sets the <code>Document</code> to <span>quirks
mode</span>.</p>
placed as a document preamble, and if the <span>parser cannot change the mode flag</span> is false,
the parser sets the <code>Document</code> to <span>quirks mode</span>.</p>
mfreed7 marked this conversation as resolved.
Show resolved Hide resolved

<tr>
<td><dfn data-x="parse-error-abrupt-doctype-system-identifier">abrupt-doctype-system-identifier</dfn>
<td><p>This error occurs if the parser encounters a U+003E (>) <span>code point</span> in the
<span data-x="syntax-doctype">DOCTYPE</span> system identifier (e.g., <code
data-x="">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "foo></code>). In such a case,
if the DOCTYPE is correctly placed as a document preamble, the parser sets the
<code>Document</code> to <span>quirks mode</span>.</p>
if the DOCTYPE is correctly placed as a document preamble, and if the <span>parser cannot change
the mode flag</span> is false, the parser sets the <code>Document</code> to <span>quirks mode</span>.</p>

<tr>
<td><dfn data-x="parse-error-absence-of-digits-in-numeric-character-reference">absence-of-digits-in-numeric-character-reference</dfn>
Expand Down Expand Up @@ -104167,7 +104172,8 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
<td><dfn data-x="parse-error-eof-in-doctype">eof-in-doctype</dfn>
<td><p>This error occurs if the parser encounters the end of the input stream in a <span
data-x="syntax-doctype">DOCTYPE</span>. In such a case, if the DOCTYPE is correctly placed as a
document preamble, the parser sets the <code>Document</code> to <span>quirks mode</span>.</p>
document preamble, and if the <span>parser cannot change the mode flag</span> is false,
the parser sets the <code>Document</code> to <span>quirks mode</span>.</p>

<tr>
<td><dfn data-x="parse-error-eof-in-script-html-comment-like-text">eof-in-script-html-comment-like-text</dfn>
Expand Down Expand Up @@ -104216,7 +104222,8 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
than "<code data-x="">PUBLIC</code>" and "<code data-x="">SYSTEM</code>" keywords after a <span
data-x="syntax-doctype">DOCTYPE</span> name. In such a case, the parser ignores any following
public or system identifiers, and if the DOCTYPE is correctly placed as a document preamble,
sets the <code>Document</code> to <span>quirks mode</span>.</p>
and if the <span>parser cannot change the mode flag</span> is false, sets the <code>Document</code>
to <span>quirks mode</span>.</p>

<tr>
<td><dfn data-x="parse-error-invalid-first-character-of-tag-name">invalid-first-character-of-tag-name</dfn>
Expand Down Expand Up @@ -104254,23 +104261,23 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
<td><p>This error occurs if the parser encounters a <span
data-x="syntax-doctype">DOCTYPE</span> that is missing a name (e.g., <code
data-x="">&lt;!DOCTYPE></code>). In such a case, if the DOCTYPE is correctly placed as a
document preamble, the parser sets the <code>Document</code> to <span>quirks mode</span>.</p>
document preamble, and if the <span>parser cannot change the mode flag</span> is false, the parser
sets the <code>Document</code> to <span>quirks mode</span>.</p>

<tr>
<td><dfn data-x="parse-error-missing-doctype-public-identifier">missing-doctype-public-identifier</dfn>
<td><p>This error occurs if the parser encounters a U+003E (>) <span>code point</span> where
start of the <span data-x="syntax-doctype">DOCTYPE</span> public identifier is expected (e.g.,
<code data-x="">&lt;!DOCTYPE html PUBLIC ></code>). In such a case, if the DOCTYPE is correctly
placed as a document preamble, the parser sets the <code>Document</code> to <span>quirks
mode</span>.</p>

placed as a document preamble, and if the <span>parser cannot change the mode flag</span> is false,
the parser sets the <code>Document</code> to <span>quirks mode</span>.</p>
<tr>
<td><dfn data-x="parse-error-missing-doctype-system-identifier">missing-doctype-system-identifier</dfn>
<td><p>This error occurs if the parser encounters a U+003E (>) <span>code point</span> where
start of the <span data-x="syntax-doctype">DOCTYPE</span> system identifier is expected (e.g.,
<code data-x="">&lt;!DOCTYPE html SYSTEM ></code>). In such a case, if the DOCTYPE is correctly
placed as a document preamble, the parser sets the <code>Document</code> to <span>quirks
mode</span>.</p>
placed as a document preamble, and if the <span>parser cannot change the mode flag</span> is false,
the parser sets the <code>Document</code> to <span>quirks mode</span>.</p>

<tr>
<td><dfn data-x="parse-error-missing-end-tag-name">missing-end-tag-name</dfn>
Expand All @@ -104285,7 +104292,8 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
data-x="syntax-doctype">DOCTYPE</span> public identifier that is not preceded by a quote (e.g.,
<code data-x="">&lt;!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01//EN"></code>). In such a case,
the parser ignores the public identifier, and if the DOCTYPE is correctly placed as a document
preamble, sets the <code>Document</code> to <span>quirks mode</span>.</p>
preamble, and if the <span>parser cannot change the mode flag</span> is false,
the parser sets the <code>Document</code> to <span>quirks mode</span>.</p>

<tr>
<td><dfn data-x="parse-error-missing-quote-before-doctype-system-identifier">missing-quote-before-doctype-system-identifier</dfn>
Expand All @@ -104294,7 +104302,8 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
<code data-x="">&lt;!DOCTYPE html SYSTEM
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></code>). In such a case, the parser
ignores the system identifier, and if the DOCTYPE is correctly placed as a document preamble,
sets the <code>Document</code> to <span>quirks mode</span>.</p>
and if the <span>parser cannot change the mode flag</span> is false,
the parser sets the <code>Document</code> to <span>quirks mode</span>.</p>

<tr>
<td><dfn data-x="parse-error-missing-semicolon-after-character-reference">missing-semicolon-after-character-reference</dfn>
Expand Down Expand Up @@ -109103,10 +109112,13 @@ document.body.appendChild(text);
<span>stack of open elements</span>.</p>


<h6>The <span>parser cannot change the mode flag</span></h6>

<h5 id="parsing-main-inhtml">The rules for parsing tokens in HTML content</h5>
<p>A <code>Document</code> object has an associated <dfn for="Document">parser cannot change the mode flag</dfn> (a boolean). It is initially false.</p>
mfreed7 marked this conversation as resolved.
Show resolved Hide resolved


<h5 id="parsing-main-inhtml">The rules for parsing tokens in HTML content</h5>

<h6>The "<dfn data-x="insertion mode: initial">initial</dfn>" insertion mode</h6>

<p>When the user agent is to apply the rules for the "<span data-x="insertion mode:
Expand Down Expand Up @@ -109145,7 +109157,8 @@ document.body.appendChild(text);
<code>Document</code> object.</p>

<p id="quirks-mode-doctypes">Then, if the document is <em>not</em> <span>an <code>iframe</code>
<code data-x="attr-iframe-srcdoc">srcdoc</code> document</span>, and the DOCTYPE token matches
<code data-x="attr-iframe-srcdoc">srcdoc</code> document</span>, and the <span>parser cannot change
the mode flag</span> is false, and the DOCTYPE token matches
one of the conditions in the following list, then set the <code>Document</code> to <span>quirks
mode</span>:</p>

Expand Down Expand Up @@ -109216,9 +109229,10 @@ document.body.appendChild(text);
</ul>

<p>Otherwise, if the document is <em>not</em> <span>an <code>iframe</code> <code
data-x="attr-iframe-srcdoc">srcdoc</code> document</span>, and the DOCTYPE token matches one of
the conditions in the following list, then set the <code>Document</code> to <span>limited-quirks
mode</span>:</p>
data-x="attr-iframe-srcdoc">srcdoc</code> document</span>, and the <span>parser cannot change
the mode flag</span> is false, and the DOCTYPE token matches one of
the conditions in the following list, then then set the <code>Document</code> to
<span>limited-quirks mode</span>:</p>

<ul class="brief">
<li> The public identifier starts with: "<code data-x="">-//W3C//DTD XHTML 1.0 Frameset//</code>" </li>
Expand All @@ -109240,7 +109254,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
error</span>; set the <code>Document</code> to <span>quirks mode</span>.</p>
error</span>; if the <span>parser cannot change the mode flag</span> is false,
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
html">before html</span>", then reprocess the token.</p>
Expand Down