Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

Commit

Permalink
Refines main element definition (#1154)
Browse files Browse the repository at this point in the history
* Refines main element definition
* Simplifies the wording to align with the WHATWG
* Fixes #1153

* Restores second note
  • Loading branch information
LJWatson authored and edent committed Jan 23, 2018
1 parent f54b948 commit 25aaa34
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions sections/semantics-grouping-content.include
Original file line number Diff line number Diff line change
Expand Up @@ -1644,8 +1644,7 @@
<dd><a>Flow content</a>.</dd>
<dd><a>Palpable content</a>.</dd>
<dt><a>Contexts in which this element can be used</a>:</dt>
<dd>Where <a>flow content</a> is expected, but with no <{article}>, <{aside}>, <{footer}>,
<{header}> or <{nav}> element ancestors.</dd>
<dd>Where <a>flow content</a> is expected, but only if it is a <dfn>hierarchically correct main element</dfn>.</dd>
<dt><a>Content model</a>:</dt>
<dd><a>Flow content</a>.</dd>
<dt><a>Tag omission in text/html</a>:</dt>
Expand All @@ -1664,19 +1663,20 @@
<dd>Uses <code>HTMLElement</code></dd>
</dl>

The <{main}> element <a>represents</a> the main content of the <{body}> of a document or application.
The <{main}> element <a>represents</a> the dominant contents of the document.

A document must not have more than one <{main}> element that does not have the [[#the-hidden-attribute]] attribute specified.

A <a>hierarchically correct main element</a> is one whose ancestor elements are limited to <{html}>, <{body}>, <{div}>, <{form}> without an <a>accessible name</a>, and <a>autonomous custom elements</a>. Each <{main}> element must be a <a>hierarchically correct main element</a>.

<p class="note">
The <{main}> element is not <a>sectioning content</a> and has no effect on the document
<a>outline</a>.
</p>
The main <a>content area</a> of a document includes content that is unique to that document and excludes
content that is repeated across a set of documents such as site navigation links, copyright
information, site logos and banners and search forms (unless the document or application's main
function is that of a search form).

There must not be more than one visible <{main}> element in a document. If more than one
<{main}> element is present in a document, all other instances must be hidden using [[#the-hidden-attribute]].
<p class="note">
The <{main}> element is not suitable for identifying the main <a>content areas</a> of sub-sections of a document. The simplest solution is not to mark up the main content of a sub-section at all (leaving it as implicit), but an author could use [[#grouping-content]] or a <a>sectioning content</a> element as appropriate.
</p>

<div class="example">
<pre highlight="html">
Expand All @@ -1692,17 +1692,6 @@
</pre>
</div>


Authors must not include the <{main}> element as a descendant of an <{article}>,
<{aside}>, <{footer}>, <{header}> or <{nav}> element.

<p class="note">
The <{main}> element is not suitable for use to identify the main <a>content areas</a> of sub
sections of a document or application. The simplest solution is to not mark up the main content
of a sub section at all, and just leave it as implicit, but an author could use a
[[#grouping-content]] or <a>sectioning content</a> element as appropriate.
</p>

In the following example, we see 2 articles about skateboards (the main topic of a Web page) the
main topic content is identified by the use of the <{main}> element.

Expand Down

0 comments on commit 25aaa34

Please sign in to comment.