- From: Simon Pieters via cvs-syncmail <cvsmail@w3.org>
- Date: Fri, 02 Mar 2012 15:07:39 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/html4-differences
In directory hutz:/tmp/cvs-serv2866
Modified Files:
Overview.src.html
Log Message:
content models
Index: Overview.src.html
===================================================================
RCS file: /sources/public/html5/html4-differences/Overview.src.html,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -d -r1.148 -r1.149
--- Overview.src.html 2 Mar 2012 13:38:25 -0000 1.148
+++ Overview.src.html 2 Mar 2012 15:07:37 -0000 1.149
@@ -719,9 +719,6 @@
<li><p>The <code data-anolis-spec=html>dl</code> element now represents an association list of
name-value groups, and is no longer said to be appropriate for dialogue.</p></li>
- <li><p>The <code data-anolis-spec=html>head</code> element no longer allows the
- <code data-anolis-spec=html>object</code> element as child.</p></li>
-
<li><p>The <code data-anolis-spec=html>hr</code> element now represents a paragraph-level
thematic break.
@@ -970,8 +967,133 @@
and <code data-anolis-spec=html>pre</code>.
</ul>
+ <h2 id="content-model">Content Model Changes</h2>
+
+ <p>Content model is what defines how elements may be nested — what is
+ allowed as children (or descendants) of a certain element.
+
+ <p>At a high level, HTML4 had two major categories of elements, "inline"
+ (e.g. <code>span</code>, <code>img</code>, text), and "block-level" (e.g.
+ <code>div</code>, <code>hr</code>, <code>table</code>). Some elements did
+ not fit in either category.
+
+ <p>Some elements allowed "inline" elements (e.g. <code>p</code>), some
+ allowed "block-level" elements (e.g. <code>body</code>, some allowed both
+ (e.g. <code>div</code>), while other elements did not allow either category
+ but only allowed other specific elements (e.g. <code>dl</code>,
+ <code>table</code>), or did now allow any children at all (e.g.
+ <code>link</code>, <code>img</code>, <code>hr</code>).
+
+ <p class=note>Notice the difference between an element itself being in a
+ certain category, and having a content model of a certain category. For
+ instance, the <code>p</code> element is itself a "block-level" element, but
+ has a content model of "inline".
+
+ <p>To make it more confusing, HTML4 had different content model rules in its
+ Strict, Transitional and Frameset flavors. For instance, in Strict, the
+ <code>body</code> element allowed only "block-level" elements, but in
+ Transitional, it allowed both "inline" and "block-level".
+
+ <p>To make things more confusing still, CSS uses the terms "block-level
+ element" and "inline-level element" for its visual formatting model, which
+ is related to CSS's 'display' property and has nothing to do with HTML's
+ content model rules.
+
+ <p>HTML5 does not use the terms "block-level" or "inline" as part of its
+ content model rules, to reduce confusion with CSS. However, it has more
+ <span data-anolis-spec=html title=concept-categories>categories</span> than
+ HTML4, and an element can be part of none of them, one of them, or several of them.
+
+ <ul>
+ <li>Metadata content, e.g. <code data-anolis-spec=html>link</code> and
+ <code data-anolis-spec=html>script</code>. <li>Flow content, e.g. <code
+ data-anolis-spec=html>span</code>, <code data-anolis-spec=html>div</code>,
+ text. This is roughly like HTML4's "block-level" and "inline" together.
+ <li>Sectioning content, e.g. <code data-anolis-spec=html>aside</code>,
+ <code data-anolis-spec=html>section</code>. <li>Heading content, e.g.
+ <code data-anolis-spec=html>h1</code> and <code
+ data-anolis-spec=html>hgroup</code>. <li>Phrasing content, e.g. <code
+ data-anolis-spec=html>span</code>, <code data-anolis-spec=html>img</code>,
+ text. This is roughly like HTML4's "inline". Elements that are phrasing
+ content are also flow content. <li>Embedded content, e.g. <code
+ data-anolis-spec=html>img</code>, <code
+ data-anolis-spec=html>iframe</code>, <code
+ data-anolis-spec=html>svg</code>. <li>Interactive content, e.g. <code
+ data-anolis-spec=html>a</code>, <code data-anolis-spec=html>button</code>,
+ <code data-anolis-spec=html>label</code>. Interactive content is not
+ allowed to be nested.
+ </ul>
+
+ <p>As broad changes from HTML4, HTML5 no longer has any element that only
+ accepts what HTML4 called "block-level" elements; e.g. the <code
+ data-anolis-spec=html>body</code> element now allows flow content. This is
+ thus closer to HTML4 Transitional than HTML4 Strict.
+
+ <p>The <code data-anolis-spec=html>address</code> element now allows flow
+ content, but with no heading content descendants, no sectioning content
+ descendants, and no <code data-anolis-spec=html>header</code>, <code
+ data-anolis-spec=html>footer</code>, or <code
+ data-anolis-spec=html>address</code> element descendants.
+
+ <p>HTML4 allowed <code>object</code> in <code>head</code>. HTML5 does not.
+
+ <p>WHATWG HTML allows <code>link</code> and <code>meta</code> as descendants
+ of <code>body</code> if they use microdata attributes.
+
+ <p>The <code data-anolis-spec=html>noscript</code> element was a
+ "block-level" element in HTML4, but is phrasing content in HTML5.
+
+ <p>The <code data-anolis-spec=html>table</code>, <code
+ data-anolis-spec=html>thead</code>, <code
+ data-anolis-spec=html>tbody</code>, <code
+ data-anolis-spec=html>tfoot</code>, <code data-anolis-spec=html>tr</code>,
+ <code data-anolis-spec=html>ol</code>, <code
+ data-anolis-spec=html>ul</code>, <code data-anolis-spec=html>dl</code> are
+ allowed to be empty in HTML5.
+
+ <p>Table elements have to conform to the <span data-anolis-spec=html>table
+ model</span> (e.g. two cells are not allowed to overlap).
+
+ <p>The <code data-anolis-spec=html>table</code> element now does not allow
+ <code data-anolis-spec=html>col</code> elements as direct children. However,
+ the HTML parser implies a <code data-anolis-spec=html>colgroup</code>
+ element, so this change should not affect <code>text/html</code> content.
+
+ <p>The <code data-anolis-spec=html>table</code> element now allows the <code
+ data-anolis-spec=html>tfoot</code> element to be the last child.
+
+ <p>The <code data-anolis-spec=html>th</code> element now allows flow
+ content, but with no <code data-anolis-spec=html>header</code>, <code
+ data-anolis-spec=html>footer</code>, sectioning content, or heading content
+ descendants.
+
+ <p>The <code data-anolis-spec=html>a</code> element now has a <span
+ data-anolis-spec=html>transparent</span> content model (except it does not
+ allow interactive content descendants), meaning that it has the same content
+ model as its parent. This means that the <code
+ data-anolis-spec=html>a</code> element can now contain e.g. <code
+ data-anolis-spec=html>div</code> elements, if its parent allows flow
+ content.
+
+ <p>The <code data-anolis-spec=html>ins</code> and <code
+ data-anolis-spec=html>del</code> elements also have a transparent content
+ model. HTML4 had similar rules in prose that could not be expressed in the
+ DTD.
+
+ <p>The <code data-anolis-spec=html>object</code> element also has a
+ transparent content model, after its <code
+ data-anolis-spec=html>param</code> children.
+ <p>The <code data-anolis-spec=html>map</code> element also has a transparent
+ content model. The <code data-anolis-spec=html>area</code> element is
+ considered phrasing content if there is a <code
+ data-anolis-spec=html>map</code> element ancestor, which means that they do
+ not need to be direct children of <code data-anolis-spec=html>map</code>.
+ <p>The <code data-anolis-spec=html>fieldset</code> element no longer
+ requires a <code data-anolis-spec=html>legend</code> child.
+
+
<h2 id="apis">New APIs</h2>
<p>HTML5 introduces a number of APIs that help in creating Web
Received on Friday, 2 March 2012 15:07:46 UTC