HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2930[Authors] [Conformance Checkers] [Tools] Discuss overlapping paragraphs. (bug 6507)2009-03-31 03:38
@@ -8878,47 +8878,60 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0
   also be used for more general thematic grouping. For instance, an
   address is also a paragraph, as is a part of a form, a byline, or a
   stanza in a poem.</p>
 
   <p>Paragraphs in <span>flow content</span> are defined relative to
   what the document looks like without the <code>a</code>,
   <code>ins</code> and <code>del</code> elements complicating matters,
   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>
 
   <p class="note">The <code>p</code> element can be used to wrap
   individual paragraphs when there would otherwise not be any content
   other than phrasing content to separate the paragraphs from each
   other.</p>
 
   <div class="example">
 
    <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>&lt;section>
   &lt;h1>Example of paragraphs&lt;/h1>
   This is the &lt;em>first&lt;/em> paragraph in this example.
   &lt;p>This is the second.&lt;/p>
   &lt;!-- This is not a paragraph. -->
 &lt;/section></pre>
 
    <p>The following example takes that markup and puts
    <code>ins</code> and <code>del</code> elements around some of the
@@ -8959,23 +8972,74 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0
    <pre>&lt;aside>
  &lt;p>Welcome! &lt;a href="about.html">This is home of...&lt;/a>&lt;/p>
  &lt;h1>&lt;a href="about.html">The Falcons!&lt;/a>&lt;/h1>
  &lt;p>&lt;a href="about.html">The Lockheed Martin multirole jet
  fighter aircraft!&lt;/a> This page discusses the F-16 Fighting
  Falcon's innermost secrets.&lt;/p>
 &lt;/aside></pre>
 
   </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>&lt;section>
+ &lt;h1>My Cats&lt;/h1>
+ You can play with my cat simulator.
+ &lt;object data="cats.sim">
+  To see the cat simulator, use one of the following links:
+  &lt;ul>
+   &lt;li>&lt;a href="cats.sim">Download simulator file&lt;/a>
+   &lt;li>&lt;a href="http://sims.example.com/watch?v=LYds5xY4INU">Use online simulator&lt;/a>
+  &lt;/ul>
+  Alternatively, upgrade to the Mellblom Browser.
+ &lt;/object>
+ I'm quite proud of it.
+&lt;/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
   elements</span> in <span>HTML documents</span>, certain APIs defined
   in DOM3 Core become case-insensitive or case-changing, as sometimes
   defined in DOM3 Core, and as summarized <span class="impl">or
   required</span> below. <a href="#refsDOM3CORE">[DOM3CORE]</a>.</p>

|