Skip to content
Permalink
Browse files

[] (0) Define handling of <listing>, <plaintext>, <acronym>, <xmp>, <…

…dir>.

git-svn-id: http://svn.whatwg.org/webapps@3502 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Jul 30, 2009
1 parent 4cd1a88 commit 74c22f9103edfbf4f376bb183f80ee569674217b
Showing with 69 additions and 13 deletions.
  1. +35 −11 index
  2. +34 −2 source
46 index
"<code>text/html</code>", then act as if the tokenizer had emitted
a start tag token with the tag name "pre", then set the <a href=#html-parser>HTML
parser</a>'s <a href=#tokenization>tokenization</a> stage's <a href=#content-model-flag>content
model flag</a> to <i>PLAINTEXT</i>.</p>
model flag</a> to <i title="">PLAINTEXT</i>.</p>

<!--
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E...%3Ciframe%3E%3C%2Fiframe%3E%3Cscript%3Eonload%20%3D%20function%20()%20%7B%20%0D%0A%20%20var%20d%20%3D%20document.getElementsByTagName('iframe')%5B0%5D.contentDocument%3B%0D%0A%20%20d.open('image%2Fsvg%2Bxml')%3B%0D%0A%20%20d.write(%22%3Cinput%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml'%20value%3D'(x)html'%2F%3E%22)%3B%0D%0A%20%20d.close()%3B%0D%0A%7D%3B%3C%2Fscript%3E
parser</a>, associate it with the document, act as if the
tokenizer had emitted a start tag token with the tag name "pre", set
the <a href=#tokenization>tokenization</a> stage's <a href=#content-model-flag>content model
flag</a> to <i>PLAINTEXT</i>, and begin to pass the stream of
flag</a> to <i title="">PLAINTEXT</i>, and begin to pass the stream of
characters in the plain text document to that tokenizer.</p>

<p>The rules for how to convert the bytes of the plain text document
(commented out because this isn't an element that can end up on the
stack, so it doesn't matter) --> <code><a href=#the-img-element>img</a></code>,
<code><a href=#the-input-element>input</a></code>, <code><a href=#isindex-0>isindex</a></code>, <code><a href=#the-li-element>li</a></code>,
<code><a href=#the-link-element>link</a></code>, <code>listing</code>, <code><a href=#menus>menu</a></code>,
<code><a href=#the-link-element>link</a></code>, <code><a href=#listing>listing</a></code>, <code><a href=#menus>menu</a></code>,
<code><a href=#meta>meta</a></code>, <code><a href=#the-nav-element>nav</a></code>, <code><a href=#noembed>noembed</a></code>,
<code><a href=#noframes>noframes</a></code>, <code><a href=#the-noscript-element>noscript</a></code>, <code><a href=#the-ol-element>ol</a></code>,
<code><a href=#the-p-element>p</a></code>, <code><a href=#the-param-element>param</a></code>, <code>plaintext</code>,
<code><a href=#the-p-element>p</a></code>, <code><a href=#the-param-element>param</a></code>, <code><a href=#plaintext>plaintext</a></code>,
<code><a href=#the-pre-element>pre</a></code>, <code><a href=#script>script</a></code>, <code><a href=#the-section-element>section</a></code>,
<code><a href=#the-select-element>select</a></code>, <code><a href=#spacer>spacer</a></code>, <code><a href=#the-style-element>style</a></code>,
<code><a href=#the-tbody-element>tbody</a></code>, <code><a href=#the-textarea-element>textarea</a></code>, <code><a href=#the-tfoot-element>tfoot</a></code>,
thus we should never serialize them -->

<p>If <var title="">current node</var> is a <code><a href=#the-pre-element>pre</a></code>,
<code><a href=#the-textarea-element>textarea</a></code>, or <code>listing</code> element, append
<code><a href=#the-textarea-element>textarea</a></code>, or <code><a href=#listing>listing</a></code> element, append
a U+000A LINE FEED (LF) character.</p>

<p>Append the value of running the <a href=#html-fragment-serialization-algorithm>HTML fragment
<dd>

<p>If the parent of <var title="">current node</var> is a
<code><a href=#the-style-element>style</a></code>, <code><a href=#script>script</a></code>, <code>xmp</code>,
<code><a href=#the-style-element>style</a></code>, <code><a href=#script>script</a></code>, <code><a href=#xmp>xmp</a></code>,
<code><a href=#the-iframe-element>iframe</a></code>, <code><a href=#noembed>noembed</a></code>,
<code><a href=#noframes>noframes</a></code>, <code><a href=#the-noscript-element>noscript</a></code>, or
<code>plaintext</code> element, then append the value of <var title="">current node</var>'s <code title="">data</code> DOM
<code><a href=#plaintext>plaintext</a></code> element, then append the value of <var title="">current node</var>'s <code title="">data</code> DOM
attribute literally.</p> <!-- note about noscript: we're
assuming here that scripting is enabled. If this algorithm is
used with scripting disabled, this won't work


<dt>If it is a <code><a href=#the-style-element>style</a></code>, <code><a href=#script>script</a></code>,
<code>xmp</code>, <code><a href=#the-iframe-element>iframe</a></code>, <code><a href=#noembed>noembed</a></code>, or
<code><a href=#xmp>xmp</a></code>, <code><a href=#the-iframe-element>iframe</a></code>, <code><a href=#noembed>noembed</a></code>, or
<code><a href=#noframes>noframes</a></code> element</dt>

<dd>Set the <a href=#content-model-flag>content model flag</a> to
PCDATA state.</dd>


<dt>If it is a <code>plaintext</code> element</dt>
<dt>If it is a <code><a href=#plaintext>plaintext</a></code> element</dt>

<dd>Set the <a href=#content-model-flag>content model flag</a> to
PLAINTEXT.</dd>
<dt><dfn id=isindex-0><code>isindex</code></dfn></dt>
<dd><p>Use an explicit <code><a href=#the-form-element>form</a></code> and <a href=#text-state-and-search-state title=attr-input-type-text>text field</a> combination instead.</dd>

<dt><dfn id=listing><code>listing</code></dfn><dt>
</dt><dd><p>Use <code><a href=#the-pre-element>pre</a></code> and <code><a href=#the-code-element>code</a></code> instead.</dd>

<dt><dfn id=noembed><code>noembed</code></dfn></dt>
<dd><p>Use <code><a href=#the-object-element>object</a></code> instead of <code><a href=#the-embed-element>embed</a></code> when fallback is necessary.</dd>

<dt><dfn id=plaintext><code>plaintext</code></dfn><dt>
</dt><dd><p>Use the "<code>text/plain</code>" MIME type instead.</dd>

<dt><dfn id=xmp><code>xmp</code></dfn><dt>
</dt><dd><p>Use <code><a href=#the-code-element>code</a></code> instead.</dd>

<dt><dfn id=basefont><code>basefont</code></dfn></dt>
<dt><dfn id=big><code>big</code></dfn></dt>
<dt><dfn id=blink><code>blink</code></dfn></dt>

<h4 id=other-elements,-attributes-and-apis><span class=secno>12.3.4 </span>Other elements, attributes and APIs</h4> <!-- alphabetical by name and attribute -->

<pre class=idl>[Supplemental] interface <a href=#htmlanchorelement>HTMLAnchorElement</a> {
<p>User agents must treat <code><a href=#acronym>acronym</a></code> elements in a manner
equivalent to <code><a href=#the-abbr-element>abbr</a></code> elements.</p>

<hr><pre class=idl>[Supplemental] interface <a href=#htmlanchorelement>HTMLAnchorElement</a> {
attribute DOMString <a href=#dom-a-coords title=dom-a-coords>coords</a>;
attribute DOMString <a href=#dom-a-charset title=dom-a-charset>charset</a>;
attribute DOMString <a href=#dom-a-rev title=dom-a-rev>rev</a>;
the element's <code title=attr-col-valign><a href=#attr-col-valign>valign</a></code> content
attribute.</p>

<hr><p>The <code><a href=#dir>dir</a></code> element must implement the
<hr><p>User agents must treat <code><a href=#dir>dir</a></code> elements in a manner
equivalent to <code><a href=#the-ul-element>ul</a></code> elements.</p>

<p>The <code><a href=#dir>dir</a></code> element must implement the
<code><a href=#htmldirectoryelement>HTMLDirectoryElement</a></code> interface.</p>

<pre class=idl>interface <dfn id=htmldirectoryelement>HTMLDirectoryElement</dfn> : <a href=#htmlelement>HTMLElement</a> {
the <code><a href=#the-link-element>link</a></code> element must <a href=#reflect>reflect</a> the
respective content attributes of the same name.</p>

<hr><p>User agents must treat <code><a href=#listing>listing</a></code> elements in a manner
equivalent to <code><a href=#the-pre-element>pre</a></code> elements.</p>

<hr><pre class=idl>[Supplemental] interface <a href=#htmlmenuelement>HTMLMenuElement</a> {
attribute DOMString <a href=#dom-menu-compact title=dom-menu-compact>compact</a>;
};</pre>
DOM attribute of the <code><a href=#the-param-element>param</a></code> element must
<a href=#reflect>reflect</a> the element's <code title=attr-param-valuetype><a href=#attr-param-valuetype>valuetype</a></code> content attribute.</p>

<hr><p>User agents must treat <code><a href=#plaintext>plaintext</a></code> elements in a
manner equivalent to <code><a href=#the-pre-element>pre</a></code> elements.</p>

<hr><pre class=idl>[Supplemental] interface <a href=#htmlpreelement>HTMLPreElement</a> {
attribute unsigned long <a href=#dom-pre-width title=dom-pre-width>width</a>;
};</pre>
the <code><a href=#the-ul-element>ul</a></code> element must <a href=#reflect>reflect</a> the respective
content attributes of the same name.</p>

<hr><p>User agents must treat <code><a href=#xmp>xmp</a></code> elements in a manner
equivalent to <code><a href=#the-code-element>code</a></code> elements.</p>

<hr><pre class=idl>[Supplemental] interface <a href=#htmldocument>HTMLDocument</a> {
attribute DOMString <a href=#dom-document-fgcolor title=dom-document-fgColor>fgColor</a>;
attribute DOMString <a href=#dom-document-bgcolor title=dom-document-bgColor>bgColor</a>;
36 source
@@ -9414,7 +9414,7 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0
"<code>text/html</code>", then act as if the tokenizer had emitted
a start tag token with the tag name "pre", then set the <span>HTML
parser</span>'s <span>tokenization</span> stage's <span>content
model flag</span> to <i>PLAINTEXT</i>.</p>
model flag</span> to <i title="">PLAINTEXT</i>.</p>

<!--
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E...%3Ciframe%3E%3C%2Fiframe%3E%3Cscript%3Eonload%20%3D%20function%20()%20%7B%20%0D%0A%20%20var%20d%20%3D%20document.getElementsByTagName('iframe')%5B0%5D.contentDocument%3B%0D%0A%20%20d.open('image%2Fsvg%2Bxml')%3B%0D%0A%20%20d.write(%22%3Cinput%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml'%20value%3D'(x)html'%2F%3E%22)%3B%0D%0A%20%20d.close()%3B%0D%0A%7D%3B%3C%2Fscript%3E
parser</span>, associate it with the document, act as if the
tokenizer had emitted a start tag token with the tag name "pre", set
the <span>tokenization</span> stage's <span>content model
flag</span> to <i>PLAINTEXT</i>, and begin to pass the stream of
flag</span> to <i title="">PLAINTEXT</i>, and begin to pass the stream of
characters in the plain text document to that tokenizer.</p>

<p>The rules for how to convert the bytes of the plain text document
<dt><dfn><code>isindex</code></dfn></dt>
<dd><p>Use an explicit <code>form</code> and <span title="attr-input-type-text">text field</span> combination instead.</p></dd>

<dt><dfn><code>listing</code></dfn><dt>
<dd><p>Use <code>pre</code> and <code>code</code> instead.</p></dd>

<dt><dfn><code>noembed</code></dfn></dt>
<dd><p>Use <code>object</code> instead of <code>embed</code> when fallback is necessary.</p></dd>

<dt><dfn><code>plaintext</code></dfn><dt>
<dd><p>Use the "<code>text/plain</code>" MIME type instead.</p></dd>

<dt><dfn><code>xmp</code></dfn><dt>
<dd><p>Use <code>code</code> instead.</p></dd>

<dt><dfn><code>basefont</code></dfn></dt>
<dt><dfn><code>big</code></dfn></dt>
<dt><dfn><code>blink</code></dfn></dt>

<h4>Other elements, attributes and APIs</h4> <!-- alphabetical by name and attribute -->

<p>User agents must treat <code>acronym</code> elements in a manner
equivalent to <code>abbr</code> elements.</p>

<hr>

<pre class="idl">[Supplemental] interface <span>HTMLAnchorElement</span> {
attribute DOMString <span title="dom-a-coords">coords</span>;
attribute DOMString <span title="dom-a-charset">charset</span>;

<hr>

<p>User agents must treat <code>dir</code> elements in a manner
equivalent to <code>ul</code> elements.</p>

<p>The <code>dir</code> element must implement the
<code>HTMLDirectoryElement</code> interface.</p>


<hr>

<p>User agents must treat <code>listing</code> elements in a manner
equivalent to <code>pre</code> elements.</p>

<hr>

<pre class="idl">[Supplemental] interface <span>HTMLMenuElement</span> {
attribute DOMString <span title="dom-menu-compact">compact</span>;
};</pre>

<hr>

<p>User agents must treat <code>plaintext</code> elements in a
manner equivalent to <code>pre</code> elements.</p>

<hr>

<pre class="idl">[Supplemental] interface <span>HTMLPreElement</span> {
attribute unsigned long <span title="dom-pre-width">width</span>;
};</pre>

<hr>

<p>User agents must treat <code>xmp</code> elements in a manner
equivalent to <code>code</code> elements.</p>

<hr>

<pre class="idl">[Supplemental] interface <span>HTMLDocument</span> {
attribute DOMString <span title="dom-document-fgColor">fgColor</span>;
attribute DOMString <span title="dom-document-bgColor">bgColor</span>;

0 comments on commit 74c22f9

Please sign in to comment.
You can’t perform that action at this time.