Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[giow] (0) Allow XML documents to be rendered as DOM trees if they're…
… not being used by a script or something.

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=17980
Affected topics: Rendering

git-svn-id: http://svn.whatwg.org/webapps@7525 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Nov 22, 2012
1 parent 544d809 commit 9d26fcd
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 4 deletions.
38 changes: 36 additions & 2 deletions complete.html
Expand Up @@ -248,7 +248,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 21 November 2012</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 22 November 2012</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -1340,7 +1340,8 @@ <h2 class="no-num no-toc">Living Standard &mdash; Last Updated 21 November 2012<
<li><a href=#the-title-attribute-0><span class=secno>14.7.2 </span>The <code title=attr-title>title</code> attribute</a></li>
<li><a href=#editing-hosts><span class=secno>14.7.3 </span>Editing hosts</a></li>
<li><a href=#text-rendered-in-native-user-interfaces><span class=secno>14.7.4 </span>Text rendered in native user interfaces</a></ol></li>
<li><a href=#print-media><span class=secno>14.8 </span>Print media</a></ol></li>
<li><a href=#print-media><span class=secno>14.8 </span>Print media</a></li>
<li><a href=#unstyled-xml-documents><span class=secno>14.9 </span>Unstyled XML documents</a></ol></li>
<li><a href=#obsolete><span class=secno>15 </span>Obsolete features</a>
<ol>
<li><a href=#obsolete-but-conforming-features><span class=secno>15.1 </span>Obsolete but conforming features</a>
Expand Down Expand Up @@ -100597,6 +100598,39 @@ <h3 id=print-media><span class=secno>14.8 </span>Print media</h3>



<h3 id=unstyled-xml-documents><span class=secno>14.9 </span>Unstyled XML documents</h3>

<!-- http://hixie.ch/tests/evil/xml/ -->

<p>HTML user agents may, in certain circumstances, find themselves rendering non-HTML documents
that use vocabularies for which they lack any built-in knowledge. This section provides for a way
for user agents to handle such documents in a somewhat useful manner.</p>

<p>While a <code><a href=#document>Document</a></code> is an <a href=#unstyled-document>unstyled document</a>, the user agent is expected
to render <a href=#an-unstyled-document-view>an unstyled document view</a>.</p>

<p>A <code><a href=#document>Document</a></code> is an <dfn id=unstyled-document>unstyled document</dfn> while it matches the following
conditions:</p>

<ul><li>The <code><a href=#document>Document</a></code> has no author style sheets (whether referenced by HTTP headers, processing instructions, elements like <code><a href=#the-link-element>link</a></code>, inline elements like <code><a href=#the-style-element>style</a></code>, or any other mechanism).
<li>None of the elements in the <code><a href=#document>Document</a></code> have any <a href=#presentational-hints>presentational hints</a>.
<li>None of the elements in the <code><a href=#document>Document</a></code> have any <a href=#css-styling-attribute title="CSS styling attribute">CSS styling attributes</a>.
<li>None of the elements in the <code><a href=#document>Document</a></code> are in any of the following namespaces: <a href=#html-namespace-0>HTML namespace</a>, <a href=#svg-namespace>SVG namespace</a>, <a href=#mathml-namespace>MathML namespace</a>
<li>The <code><a href=#document>Document</a></code> has no <a href=#focusable>focusable</a> elements (e.g. from XLink).
<li>The <code><a href=#document>Document</a></code> has no <a href=#hyperlink title=hyperlink>hyperlinks</a> (e.g. from XLink).
<li>There exists no <a href=#concept-script title=concept-script>script</a> whose <a href="#script's-document" title="script's document">document</a> is this <code><a href=#document>Document</a></code>.
<li>None of the elements in the <code><a href=#document>Document</a></code> have any registered event listeners.
</ul><p><dfn id=an-unstyled-document-view>An unstyled document view</dfn> is one where the DOM is not rendered according to CSS
(which would, since there are no applicable styles in this context, just result in a wall of
text), but is instead rendered in a manner that is useful for a developer. This could consist of
just showing the <code><a href=#document>Document</a></code> object's source, maybe with syntax highlighting, or it
could consist of displaying just the DOM tree, or simply a message saying that the page is not a
styled document.</p>

<p class=note>If a <code><a href=#document>Document</a></code> stops being an <a href=#unstyled-document>unstyled document</a>, then the
conditions above stop applying, and thes a user agent following these requirements will switch to
using the regular CSS rendering.</p>

</div>


Expand Down
38 changes: 36 additions & 2 deletions index
Expand Up @@ -248,7 +248,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 21 November 2012</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 22 November 2012</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -1340,7 +1340,8 @@
<li><a href=#the-title-attribute-0><span class=secno>14.7.2 </span>The <code title=attr-title>title</code> attribute</a></li>
<li><a href=#editing-hosts><span class=secno>14.7.3 </span>Editing hosts</a></li>
<li><a href=#text-rendered-in-native-user-interfaces><span class=secno>14.7.4 </span>Text rendered in native user interfaces</a></ol></li>
<li><a href=#print-media><span class=secno>14.8 </span>Print media</a></ol></li>
<li><a href=#print-media><span class=secno>14.8 </span>Print media</a></li>
<li><a href=#unstyled-xml-documents><span class=secno>14.9 </span>Unstyled XML documents</a></ol></li>
<li><a href=#obsolete><span class=secno>15 </span>Obsolete features</a>
<ol>
<li><a href=#obsolete-but-conforming-features><span class=secno>15.1 </span>Obsolete but conforming features</a>
Expand Down Expand Up @@ -100597,6 +100598,39 @@ if (s = prompt('What is your name?')) {



<h3 id=unstyled-xml-documents><span class=secno>14.9 </span>Unstyled XML documents</h3>

<!-- http://hixie.ch/tests/evil/xml/ -->

<p>HTML user agents may, in certain circumstances, find themselves rendering non-HTML documents
that use vocabularies for which they lack any built-in knowledge. This section provides for a way
for user agents to handle such documents in a somewhat useful manner.</p>

<p>While a <code><a href=#document>Document</a></code> is an <a href=#unstyled-document>unstyled document</a>, the user agent is expected
to render <a href=#an-unstyled-document-view>an unstyled document view</a>.</p>

<p>A <code><a href=#document>Document</a></code> is an <dfn id=unstyled-document>unstyled document</dfn> while it matches the following
conditions:</p>

<ul><li>The <code><a href=#document>Document</a></code> has no author style sheets (whether referenced by HTTP headers, processing instructions, elements like <code><a href=#the-link-element>link</a></code>, inline elements like <code><a href=#the-style-element>style</a></code>, or any other mechanism).
<li>None of the elements in the <code><a href=#document>Document</a></code> have any <a href=#presentational-hints>presentational hints</a>.
<li>None of the elements in the <code><a href=#document>Document</a></code> have any <a href=#css-styling-attribute title="CSS styling attribute">CSS styling attributes</a>.
<li>None of the elements in the <code><a href=#document>Document</a></code> are in any of the following namespaces: <a href=#html-namespace-0>HTML namespace</a>, <a href=#svg-namespace>SVG namespace</a>, <a href=#mathml-namespace>MathML namespace</a>
<li>The <code><a href=#document>Document</a></code> has no <a href=#focusable>focusable</a> elements (e.g. from XLink).
<li>The <code><a href=#document>Document</a></code> has no <a href=#hyperlink title=hyperlink>hyperlinks</a> (e.g. from XLink).
<li>There exists no <a href=#concept-script title=concept-script>script</a> whose <a href="#script's-document" title="script's document">document</a> is this <code><a href=#document>Document</a></code>.
<li>None of the elements in the <code><a href=#document>Document</a></code> have any registered event listeners.
</ul><p><dfn id=an-unstyled-document-view>An unstyled document view</dfn> is one where the DOM is not rendered according to CSS
(which would, since there are no applicable styles in this context, just result in a wall of
text), but is instead rendered in a manner that is useful for a developer. This could consist of
just showing the <code><a href=#document>Document</a></code> object's source, maybe with syntax highlighting, or it
could consist of displaying just the DOM tree, or simply a message saying that the page is not a
styled document.</p>

<p class=note>If a <code><a href=#document>Document</a></code> stops being an <a href=#unstyled-document>unstyled document</a>, then the
conditions above stop applying, and thes a user agent following these requirements will switch to
using the regular CSS rendering.</p>

</div>


Expand Down
36 changes: 36 additions & 0 deletions source
Expand Up @@ -117768,6 +117768,42 @@ if (s = prompt('What is your name?')) {



<h3>Unstyled XML documents</h3>

<!-- http://hixie.ch/tests/evil/xml/ -->

<p>HTML user agents may, in certain circumstances, find themselves rendering non-HTML documents
that use vocabularies for which they lack any built-in knowledge. This section provides for a way
for user agents to handle such documents in a somewhat useful manner.</p>

<p>While a <code>Document</code> is an <span>unstyled document</span>, the user agent is expected
to render <span>an unstyled document view</span>.</p>

<p>A <code>Document</code> is an <dfn>unstyled document</dfn> while it matches the following
conditions:</p>

<ul>
<li>The <code>Document</code> has no author style sheets (whether referenced by HTTP headers, processing instructions, elements like <code>link</code>, inline elements like <code>style</code>, or any other mechanism).
<li>None of the elements in the <code>Document</code> have any <span>presentational hints</span>.
<li>None of the elements in the <code>Document</code> have any <span title="CSS styling attribute">CSS styling attributes</span>.
<li>None of the elements in the <code>Document</code> are in any of the following namespaces: <span>HTML namespace</span>, <span>SVG namespace</span>, <span>MathML namespace</span>
<li>The <code>Document</code> has no <span>focusable</span> elements (e.g. from XLink).
<li>The <code>Document</code> has no <span title="hyperlink">hyperlinks</span> (e.g. from XLink).
<li>There exists no <span title="concept-script">script</span> whose <span title="script's document">document</span> is this <code>Document</code>.
<li>None of the elements in the <code>Document</code> have any registered event listeners.
</ul>

<p><dfn>An unstyled document view</dfn> is one where the DOM is not rendered according to CSS
(which would, since there are no applicable styles in this context, just result in a wall of
text), but is instead rendered in a manner that is useful for a developer. This could consist of
just showing the <code>Document</code> object's source, maybe with syntax highlighting, or it
could consist of displaying just the DOM tree, or simply a message saying that the page is not a
styled document.</p>

<p class="note">If a <code>Document</code> stops being an <span>unstyled document</span>, then the
conditions above stop applying, and thes a user agent following these requirements will switch to
using the regular CSS rendering.</p>

</div>


Expand Down

0 comments on commit 9d26fcd

Please sign in to comment.