[html5] r2930 - [act] (0) Discuss overlapping paragraphs. (bug 6507)
whatwg at whatwg.org
whatwg at whatwg.org
Mon Mar 30 20:38:47 PDT 2009
Author: ianh
Date: 2009-03-30 20:38:46 -0700 (Mon, 30 Mar 2009)
New Revision: 2930
Modified:
index
source
Log:
[act] (0) Discuss overlapping paragraphs. (bug 6507)
Modified: index
===================================================================
--- index 2009-03-31 01:48:06 UTC (rev 2929)
+++ index 2009-03-31 03:38:46 UTC (rev 2930)
@@ -8556,14 +8556,31 @@
since those elements, with their hybrid content models, can straddle
paragraph boundaries.</p>
+ <p class=note>Generally, having elements straddle paragraph
+ boundaries is best avoided. Maintaining such markup can be
+ difficult.</p>
+
+ <div class=impl>
+
<p>Let <var title="">view</var> be a view of the DOM that replaces
all <code><a href=#the-a-element>a</a></code>, <code><a href=#the-ins-element>ins</a></code> and <code><a href=#the-del-element>del</a></code> elements
- in the document with their contents. Then, in <var title="">view</var>, for each run of <a href=#phrasing-content-0>phrasing content</a>
- uninterrupted by other types of content, in an element that accepts
- content other than <a href=#phrasing-content-0>phrasing content</a>, let <var title="">first</var> be the first node of the run, and let <var title="">last</var> be the last node of the run. For each run, a
- paragraph exists in the original DOM from immediately before <var title="">first</var> to immediately after <var title="">last</var>. (Paragraphs can thus span across
+ in the document with their contents. Then, in <var title="">view</var>, for each run of sibling <a href=#phrasing-content-0>phrasing
+ content</a> nodes uninterrupted by other types of content, in an
+ element that accepts content other than <a href=#phrasing-content-0>phrasing
+ content</a>, let <var title="">first</var> be the first node of
+ the run, and let <var title="">last</var> be the last node of the
+ run. For each such run that consists of at least one node that is
+ neither <a href=#embedded-content-2>embedded content</a> nor <a href=#inter-element-whitespace>inter-element
+ whitespace</a>, a paragraph exists in the original DOM from
+ immediately before <var title="">first</var> to immediately after
+ <var title="">last</var>. (Paragraphs can thus span across
<code><a href=#the-a-element>a</a></code>, <code><a href=#the-ins-element>ins</a></code> and <code><a href=#the-del-element>del</a></code> elements.)</p>
+ <p>Conformance checkers may warn authors of cases where they have
+ paragraphs that overlap each other.</p>
+
+ </div>
+
<p>A <a href=#paragraph>paragraph</a> is also formed explicitly by
<code><a href=#the-p-element>p</a></code> elements.</p>
@@ -8577,7 +8594,7 @@
<p>In the following example, there are two paragraphs in a
section. There is also a header, which contains phrasing content
that is not a paragraph. Note how the comments and
- <span>intra-element whitespace</span> do not form paragraphs.</p>
+ <a href=#inter-element-whitespace>inter-element whitespace</a> do not form paragraphs.</p>
<pre><section>
<h1>Example of paragraphs</h1>
@@ -8632,12 +8649,59 @@
</div>
- <p class=note>Generally, having elements straddle paragraph
- boundaries is best avoided. Maintaining such markup can be
- difficult.</p>
+ <div class=example>
+ <!-- I don't know if there's a better way to deal with this, but if
+ there is, let me know... -->
+ <p>It is possible for paragraphs to overlap when using certain
+ elements that define fallback content. For example, in the
+ following section:</p>
+ <pre><section>
+ <h1>My Cats</h1>
+ You can play with my cat simulator.
+ <object data="cats.sim">
+ To see the cat simulator, use one of the following links:
+ <ul>
+ <li><a href="cats.sim">Download simulator file</a>
+ <li><a href="http://sims.example.com/watch?v=LYds5xY4INU">Use online simulator</a>
+ </ul>
+ Alternatively, upgrade to the Mellblom Browser.
+ </object>
+ I'm quite proud of it.
+</section></pre>
+
+ <p>There are five paragraphs:</p>
+
+ <ol class=brief><li>The paragraph that says "You can play with my cat
+ simulator. <i title="">object</i> I'm quite proud of it.", where
+ <i title="">object</i> is the <code><a href=#the-object-element>object</a></code> element.</li>
+
+ <li>The paragraph that says "To see the cat simulator, use one of
+ the following links:".</li>
+
+ <li>The paragraph that says "Download simulator file".</li>
+
+ <li>The paragraph that says "Use online simulator".</li>
+
+ <li>The paragraph that says "Alternatively, upgrade to the Mellblom Browser.".</li>
+
+ </ol><p>The first paragraph is overlapped by the other four. A user
+ agent that supports the "cats.sim" resource will only show the
+ first one, but a user agent that shows the fallback will
+ confusingly show the the first sentence of the first paragraph as
+ if it was in the same paragraph as the second one, and will show
+ the last paragraph as if it was at the start of the second sentence
+ of the the first paragraph.</p>
+
+ <p>To avoid this confusion, explicit <code><a href=#the-p-element>p</a></code> elements can be
+ used.</p>
+
+ </div>
+
+
+
<h3 id=apis-in-html-documents><span class=secno>3.6 </span>APIs in HTML documents</h3>
<p>For <a href=#html-documents>HTML documents</a>, and for <a href=#html-elements>HTML
Modified: source
===================================================================
--- source 2009-03-31 01:48:06 UTC (rev 2929)
+++ source 2009-03-31 03:38:46 UTC (rev 2930)
@@ -8885,19 +8885,32 @@
since those elements, with their hybrid content models, can straddle
paragraph boundaries.</p>
+ <p class="note">Generally, having elements straddle paragraph
+ boundaries is best avoided. Maintaining such markup can be
+ difficult.</p>
+
+ <div class="impl">
+
<p>Let <var title="">view</var> be a view of the DOM that replaces
all <code>a</code>, <code>ins</code> and <code>del</code> elements
in the document with their contents. Then, in <var
- title="">view</var>, for each run of <span>phrasing content</span>
- uninterrupted by other types of content, in an element that accepts
- content other than <span>phrasing content</span>, let <var
- title="">first</var> be the first node of the run, and let <var
- title="">last</var> be the last node of the run. For each run, a
- paragraph exists in the original DOM from immediately before <var
- title="">first</var> to immediately after <var
- title="">last</var>. (Paragraphs can thus span across
+ title="">view</var>, for each run of sibling <span>phrasing
+ content</span> nodes uninterrupted by other types of content, in an
+ element that accepts content other than <span>phrasing
+ content</span>, let <var title="">first</var> be the first node of
+ the run, and let <var title="">last</var> be the last node of the
+ run. For each such run that consists of at least one node that is
+ neither <span>embedded content</span> nor <span>inter-element
+ whitespace</span>, a paragraph exists in the original DOM from
+ immediately before <var title="">first</var> to immediately after
+ <var title="">last</var>. (Paragraphs can thus span across
<code>a</code>, <code>ins</code> and <code>del</code> elements.)</p>
+ <p>Conformance checkers may warn authors of cases where they have
+ paragraphs that overlap each other.</p>
+
+ </div>
+
<p>A <span>paragraph</span> is also formed explicitly by
<code>p</code> elements.</p>
@@ -8911,7 +8924,7 @@
<p>In the following example, there are two paragraphs in a
section. There is also a header, which contains phrasing content
that is not a paragraph. Note how the comments and
- <span>intra-element whitespace</span> do not form paragraphs.</p>
+ <span>inter-element whitespace</span> do not form paragraphs.</p>
<pre><section>
<h1>Example of paragraphs</h1>
@@ -8966,12 +8979,63 @@
</div>
- <p class="note">Generally, having elements straddle paragraph
- boundaries is best avoided. Maintaining such markup can be
- difficult.</p>
+ <div class="example">
+ <!-- I don't know if there's a better way to deal with this, but if
+ there is, let me know... -->
+ <p>It is possible for paragraphs to overlap when using certain
+ elements that define fallback content. For example, in the
+ following section:</p>
+ <pre><section>
+ <h1>My Cats</h1>
+ You can play with my cat simulator.
+ <object data="cats.sim">
+ To see the cat simulator, use one of the following links:
+ <ul>
+ <li><a href="cats.sim">Download simulator file</a>
+ <li><a href="http://sims.example.com/watch?v=LYds5xY4INU">Use online simulator</a>
+ </ul>
+ Alternatively, upgrade to the Mellblom Browser.
+ </object>
+ I'm quite proud of it.
+</section></pre>
+
+ <p>There are five paragraphs:</p>
+
+ <ol class="brief">
+
+ <li>The paragraph that says "You can play with my cat
+ simulator. <i title="">object</i> I'm quite proud of it.", where
+ <i title="">object</i> is the <code>object</code> element.</li>
+
+ <li>The paragraph that says "To see the cat simulator, use one of
+ the following links:".</li>
+
+ <li>The paragraph that says "Download simulator file".</li>
+
+ <li>The paragraph that says "Use online simulator".</li>
+
+ <li>The paragraph that says "Alternatively, upgrade to the Mellblom Browser.".</li>
+
+ </ol>
+
+ <p>The first paragraph is overlapped by the other four. A user
+ agent that supports the "cats.sim" resource will only show the
+ first one, but a user agent that shows the fallback will
+ confusingly show the the first sentence of the first paragraph as
+ if it was in the same paragraph as the second one, and will show
+ the last paragraph as if it was at the start of the second sentence
+ of the the first paragraph.</p>
+
+ <p>To avoid this confusion, explicit <code>p</code> elements can be
+ used.</p>
+
+ </div>
+
+
+
<h3>APIs in HTML documents</h3>
<p>For <span>HTML documents</span>, and for <span>HTML
More information about the Commit-Watchers
mailing list