Skip to content

Commit 97d8432

Browse files
authored
Adjust the definition of the main element and various examples
This changes examples involving the main element as they do not lead to a good experience with assistive technology. It also adjusts the definition of the main element a bit and suggests it's best to be used at most once. See #100 for context.
1 parent b5f9ad6 commit 97d8432

File tree

1 file changed

+17
-29
lines changed

1 file changed

+17
-29
lines changed

source

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15648,10 +15648,10 @@ interface <dfn>HTMLBodyElement</dfn> : <span>HTMLElement</span> {};
1564815648
&lt;header>
1564915649
&lt;h1 itemprop="headline">My Day at the Beach&lt;/h1>
1565015650
&lt;/header>
15651-
&lt;main itemprop="articleBody">
15651+
&lt;div itemprop="articleBody">
1565215652
&lt;p>Today I went to the beach and had a lot of fun.&lt;/p>
1565315653
<em>...more content...</em>
15654-
&lt;/main>
15654+
&lt;/div>
1565515655
&lt;footer>
1565615656
&lt;p>Posted &lt;time itemprop="datePublished" datetime="2009-10-10">Thursday&lt;/time>.&lt;/p>
1565715657
&lt;/footer>
@@ -15669,10 +15669,6 @@ interface <dfn>HTMLBodyElement</dfn> : <span>HTMLElement</span> {};
1566915669
&lt;/footer>
1567015670
&lt;/body></pre>
1567115671

15672-
<p>Notice the <code>main</code> elements being used to wrap all the contents of the page other
15673-
than the header and footer, and all the contents of the blog entry other than its header and
15674-
footer.</p>
15675-
1567615672
<p>You can also see microdata annotations in the above example that use the schema.org vocabulary
1567715673
to provide the publication date and other metadata about the blog post.</p>
1567815674

@@ -17287,11 +17283,9 @@ Space is not the only void</pre>
1728717283
&lt;/nav>
1728817284
&lt;h1>We're adopting a child!&lt;/h1>
1728917285
&lt;/header>
17290-
&lt;main>
17291-
&lt;p>As of today, Janine and I have signed the papers to become
17292-
the proud parents of baby Diane! We've been looking forward to
17293-
this day for weeks.&lt;/p>
17294-
&lt;/main>
17286+
&lt;p>As of today, Janine and I have signed the papers to become
17287+
the proud parents of baby Diane! We've been looking forward to
17288+
this day for weeks.&lt;/p>
1729517289
&lt;/article>
1729617290
&lt;/html></pre>
1729717291

@@ -17308,8 +17302,8 @@ Space is not the only void</pre>
1730817302
</ol>
1730917303
</ol>
1731017304

17311-
<p>Also worthy of note in this example is that the <code>header</code> and <code>main</code>
17312-
elements have no effect whatsoever on the document outline.</p>
17305+
<p>Also worthy of note in this example is that the <code>header</code> element has no effect
17306+
whatsoever on the document outline.</p>
1731317307

1731417308
</div>
1731517309

@@ -19203,17 +19197,15 @@ included with Exhibit B.
1920319197
<dd>Uses <code>HTMLElement</code>.</dd>
1920419198
</dl>
1920519199

19206-
<p>The <code>main</code> element can be used as a container for the dominant contents of another
19207-
element. It <span>represents</span> its children.</p>
19200+
<p>The <code>main</code> element can be used as a container for the dominant contents of the
19201+
document. It <span>represents</span> its children.</p>
1920819202

1920919203
<p class="note">The <code>main</code> element is distinct from the <code>section</code> and
1921019204
<code>article</code> elements in that the <code>main</code> element does not contribute to the
1921119205
document <span>outline</span>.</p>
1921219206

19213-
<p class="note">There is no restriction as to the number of <code>main</code> elements in a
19214-
document. Indeed, there are many cases where it would make sense to have multiple
19215-
<code>main</code> elements. For example, a page with multiple <code>article</code> elements might
19216-
need to indicate the dominant contents of each such element.</p>
19207+
<p class="note">While there is no restriction as to the number of <code>main</code> elements in a
19208+
document, web developers are encouraged to stick to a single element.</p>
1921719209

1921819210
<div class="example">
1921919211

@@ -29926,10 +29918,8 @@ interface <dfn>HTMLIFrameElement</dfn> : <span>HTMLElement</span> {
2992629918
&lt;p>&lt;img src="/usericons/1627591962735"> &lt;b>Fred Flintstone&lt;/b>&lt;/p>
2992729919
&lt;p>&lt;a href="/posts/3095182851" rel=bookmark>12:44&lt;/a> &mdash; &lt;a href="#acl-3095182851">Private Post&lt;/a>&lt;/p>
2992829920
&lt;/header>
29929-
&lt;main>
29930-
&lt;p>Check out my new ride!&lt;/p>
29931-
<strong>&lt;iframe src="https://video.example.com/embed?id=92469812" allowfullscreen>&lt;/iframe></strong>
29932-
&lt;/main>
29921+
&lt;p>Check out my new ride!&lt;/p>
29922+
<strong>&lt;iframe src="https://video.example.com/embed?id=92469812" allowfullscreen>&lt;/iframe></strong>
2993329923
&lt;/article></pre>
2993429924

2993529925
</div>
@@ -57136,15 +57126,13 @@ interface <dfn>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
5713657126

5713757127
<div class="example">
5713857128

57139-
<p>This dialog box has some small print. The <code>main</code> element is used to draw the user's
57140-
attention to the more important parts.</p>
57129+
<p>This dialog box has some small print. The <code>strong</code> element is used to draw the
57130+
user's attention to the more important part.</p>
5714157131

5714257132
<pre>&lt;dialog>
5714357133
&lt;h1>Add to Wallet&lt;/h1>
57144-
&lt;main>
57145-
&lt;p>How many gold coins do you want to add to your wallet?&lt;/p>
57146-
&lt;p>&lt;input name=amt type=number min=0 step=0.01 value=100>&lt;/p>
57147-
&lt;/main>
57134+
&lt;p>&lt;strong>&lt;label for=amt>How many gold coins do you want to add to your wallet?&lt;/label>&lt;/strong>&lt;/p>
57135+
&lt;p>&lt;input id=amt name=amt type=number min=0 step=0.01 value=100>&lt;/p>
5714857136
&lt;p>&lt;small>You add coins at your own risk.&lt;/small>&lt;/p>
5714957137
&lt;p>&lt;label>&lt;input name=round type=checkbox> Only add perfectly round coins &lt;/label>&lt;/p>
5715057138
&lt;p>&lt;input type=button onclick="submit()" value="Add Coins">&lt;/p>

0 commit comments

Comments
 (0)