Skip to content
Permalink
Browse files

[] (0) Filling in the rendering section: <body> margins; administrivia

git-svn-id: http://svn.whatwg.org/webapps@2749 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Feb 4, 2009
1 parent c30e66c commit 94445ca0205eef8618254db03a498e283834d242
Showing with 138 additions and 36 deletions.
  1. +58 −18 index
  2. +80 −18 source
76 index

</ol><h2 id=rendering><span class=secno>10 </span>Rendering</h2>

<p><em>This section all its subsections are non-normative.</em></p>
<p><em>User agents are not required present HTML documents in any
particular way. However, this section provides a set of suggestions
for rendering HTML documents that, if followed, are likely to lead
to a user experience that closely resembles the experience intended
by the documents' authors. So as to avoid confusion regarding the
normativity of this section, RFC2119 terms have not been used.
Instead, the term "expected" is used to indicate behavior that will
lead to this experience.</em></p>


<h3 id=introduction-8><span class=secno>10.1 </span>Introduction</h3>

<p>User agents are not required present HTML documents in any
particular way. This section merely provides a set of suggestions
for rendering HTML documents that, if followed, are likely to lead
to a user experience that closely resembles the experience intended
by the documents' authors.</p>

<p>In general, user agents are expected to support CSS, and many of
the suggestions in this section are expressed in CSS terms. User
agents that use other presentation mechanisms can derive their
<p>For the purposes of the CSS table model, the <code><a href=#the-col-element>col</a></code>
element is to be treated as if it was present as many times as its
<code title=attr-col-span><a href=#attr-col-span>span</a></code> attribute <a href=#rules-for-parsing-non-negative-integers title="rules
for parsing non-negative integers">specifies</a>.</p> <!-- XXX
link to dfn instead of parser -->
for parsing non-negative integers">specifies</a>.</p>

<p>For the purposes of the CSS table model, the
<code><a href=#the-colgroup-element>colgroup</a></code> element, if it contains no <code><a href=#the-col-element>col</a></code>
element, is to be treated as if it had as many such children as its
<code title=attr-colgroup-span><a href=#attr-colgroup-span>span</a></code> attribute <a href=#rules-for-parsing-non-negative-integers title="rules for parsing non-negative
integers">specifies</a>.</p> <!-- XXX link to dfn instead of
parser -->
integers">specifies</a>.</p>

<p>For the purposes of the CSS table model, the <code title=attr-tdth-colspan><a href=#attr-tdth-colspan>colspan</a></code> and <code title=attr-tdth-rowspan><a href=#attr-tdth-rowspan>rowspan</a></code> attributes on
<code><a href=#the-td-element>td</a></code> and <code><a href=#the-th-element>th</a></code> elements are expected to provide
the <i>special knowledge</i> regarding cells spanning rows and
columns.</p> <!-- XXX link to dfn instead of parser -->
<code><a href=#the-td-element>td</a></code> and <code><a href=#the-th-element>th</a></code> elements are expected to <a href=#rules-for-parsing-non-negative-integers title="rules for parsing non-negative integers">provide</a> the
<i>special knowledge</i> regarding cells spanning rows and
columns.</p>


<h4 id=margins-and-padding><span class=secno>10.3.3 </span>Margins and padding</h4>

<pre class=css>@namespace url(http://www.w3.org/1999/xhtml);

body { padding: 8px; }<!-- XXX or margin? -->

blockquote, dir, dl, listing, menu, ol, p, plaintext, pre, ul, xmp {
margin-top: 1em; margin-bottom: 1em;
}
bottom of the initial containing block are expected to be collapsed
to zero.</p>

<hr><p class=XXX>...body...</p>
<!-- marginwidth, marginheight -->
<hr><p>For a <code><a href=#the-body-element>body</a></code> element, the 'margin-top',
'margin-right', 'margin-bottom', and 'margin-left' properties are
expected to be set by presentational hints from a variety of source,
given in the table below in precedence order. If one of the
attributes listed is present, then the first such attribute's value
is expected to be parsed using the <a href=#rules-for-parsing-non-negative-integers>rules for parsing
non-negative integers</a>; if this does not result in an error,
then the parsed value is expected to be used as a pixel length for
the corresponding property. If no attribute is found, or if the
attribute's value cannot be parsed successfully, then a default
value of 8px is expected to be used.</p>

<!-- XXX so, uh, about the cross-site-styling hole below... -->

<table><thead><tr><th>Property
<th>Source
<tbody><tr><td rowspan=3>'margin-top'
<td><code><a href=#the-body-element>body</a></code> element's <code title=attr-body-marginheight>marginheight</code> attribute
<tr><td>The <code><a href=#the-body-element>body</a></code> element's <a href=#container-frame-element>container frame element</a>'s <code title=attr-frame-marginheight>marginheight</code> attribute
<tr><td><code><a href=#the-body-element>body</a></code> element's <code title=attr-body-topmargin>topmargin</code> attribute
<tbody><tr><td rowspan=3>'margin-right'
<td><code><a href=#the-body-element>body</a></code> element's <code title=attr-body-marginwidth>marginwidth</code> attribute
<tr><td>The <code><a href=#the-body-element>body</a></code> element's <a href=#container-frame-element>container frame element</a>'s <code title=attr-frame-marginwidth>marginwidth</code> attribute
<tr><td><code><a href=#the-body-element>body</a></code> element's <code title=attr-body-rightmargin>rightmargin</code> attribute
<tbody><tr><td rowspan=3>'margin-bottom'
<td><code><a href=#the-body-element>body</a></code> element's <code title=attr-body-marginheight>marginheight</code> attribute
<tr><td>The <code><a href=#the-body-element>body</a></code> element's <a href=#container-frame-element>container frame element</a>'s <code title=attr-frame-marginheight>marginheight</code> attribute
<tr><td><code><a href=#the-body-element>body</a></code> element's <code title=attr-body-bottommargin>topmargin</code> attribute
<tbody><tr><td rowspan=3>'margin-left'
<td><code><a href=#the-body-element>body</a></code> element's <code title=attr-body-marginwidth>marginwidth</code> attribute
<tr><td>The <code><a href=#the-body-element>body</a></code> element's <a href=#container-frame-element>container frame element</a>'s <code title=attr-frame-marginwidth>marginwidth</code> attribute
<tr><td><code><a href=#the-body-element>body</a></code> element's <code title=attr-body-leftmargin>rightmargin</code> attribute
</table><p>If the <code><a href=#the-body-element>body</a></code> element's <code>Document</code>'s
<a href=#browsing-context>browsing context</a> is a <a href=#nested-browsing-context>nested browsing
context</a>, and the <a href=#browsing-context-container>browsing context container</a> of
that <a href=#nested-browsing-context>nested browsing context</a> is a <code>frame</code> or
<code><a href=#the-iframe-element>iframe</a></code> element, then the the <dfn id=container-frame-element>container frame
element</dfn> of the <code><a href=#the-body-element>body</a></code> element is that
<code>frame</code> or <code><a href=#the-iframe-element>iframe</a></code> element. Otherwise, there
is no <a href=#container-frame-element>container frame element</a>.</p>

<hr><p class=XXX>...tables...</p>
<!-- cellspacing, cellpadding, height, width* (int/%; *width=0 => width:auto); <table hspace/vspace> (int); <table cols>; <table border> (border => border=1); -->

-->

<!-- XXX need to separate the author-level rules from the user-agent-level rules
so that the user-level rules can slide between them
the spec lists the attributes that should count as presentational:
http://www.w3.org/Style/Group/css2-src/cascade.html#preshint -->



<h2 id=obsolete-features><span class=secno>11 </span>Obsolete features</h2>
98 source

<h2 id="rendering">Rendering</h2>

<p><em>This section all its subsections are non-normative.</em></p>
<p><em>User agents are not required present HTML documents in any
particular way. However, this section provides a set of suggestions
for rendering HTML documents that, if followed, are likely to lead
to a user experience that closely resembles the experience intended
by the documents' authors. So as to avoid confusion regarding the
normativity of this section, RFC2119 terms have not been used.
Instead, the term "expected" is used to indicate behavior that will
lead to this experience.</em></p>


<h3>Introduction</h3>

<p>User agents are not required present HTML documents in any
particular way. This section merely provides a set of suggestions
for rendering HTML documents that, if followed, are likely to lead
to a user experience that closely resembles the experience intended
by the documents' authors.</p>

<p>In general, user agents are expected to support CSS, and many of
the suggestions in this section are expressed in CSS terms. User
agents that use other presentation mechanisms can derive their
<p>For the purposes of the CSS table model, the <code>col</code>
element is to be treated as if it was present as many times as its
<code title="attr-col-span">span</code> attribute <span title="rules
for parsing non-negative integers">specifies</span>.</p> <!-- XXX
link to dfn instead of parser -->
for parsing non-negative integers">specifies</span>.</p>

<p>For the purposes of the CSS table model, the
<code>colgroup</code> element, if it contains no <code>col</code>
element, is to be treated as if it had as many such children as its
<code title="attr-colgroup-span">span</code> attribute <span
title="rules for parsing non-negative
integers">specifies</span>.</p> <!-- XXX link to dfn instead of
parser -->
integers">specifies</span>.</p>

<p>For the purposes of the CSS table model, the <code
title="attr-tdth-colspan">colspan</code> and <code
title="attr-tdth-rowspan">rowspan</code> attributes on
<code>td</code> and <code>th</code> elements are expected to provide
the <i>special knowledge</i> regarding cells spanning rows and
columns.</p> <!-- XXX link to dfn instead of parser -->
<code>td</code> and <code>th</code> elements are expected to <span
title="rules for parsing non-negative integers">provide</span> the
<i>special knowledge</i> regarding cells spanning rows and
columns.</p>


<h4>Margins and padding</h4>

<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);

body { padding: 8px; }<!-- XXX or margin? -->

blockquote, dir, dl, listing, menu, ol, p, plaintext, pre, ul, xmp {
margin-top: 1em; margin-bottom: 1em;
}

<hr>

<p class="XXX">...body...</p>
<!-- marginwidth, marginheight -->
<p>For a <code>body</code> element, the 'margin-top',
'margin-right', 'margin-bottom', and 'margin-left' properties are
expected to be set by presentational hints from a variety of source,
given in the table below in precedence order. If one of the
attributes listed is present, then the first such attribute's value
is expected to be parsed using the <span>rules for parsing
non-negative integers</span>; if this does not result in an error,
then the parsed value is expected to be used as a pixel length for
the corresponding property. If no attribute is found, or if the
attribute's value cannot be parsed successfully, then a default
value of 8px is expected to be used.</p>

<!-- XXX so, uh, about the cross-site-styling hole below... -->

<table>
<thead>
<tr>
<th>Property
<th>Source
<tbody>
<tr>
<td rowspan="3">'margin-top'
<td><code>body</code> element's <code title="attr-body-marginheight">marginheight</code> attribute
<tr>
<td>The <code>body</code> element's <span>container frame element</span>'s <code title="attr-frame-marginheight">marginheight</code> attribute
<tr>
<td><code>body</code> element's <code title="attr-body-topmargin">topmargin</code> attribute
<tbody>
<tr>
<td rowspan="3">'margin-right'
<td><code>body</code> element's <code title="attr-body-marginwidth">marginwidth</code> attribute
<tr>
<td>The <code>body</code> element's <span>container frame element</span>'s <code title="attr-frame-marginwidth">marginwidth</code> attribute
<tr>
<td><code>body</code> element's <code title="attr-body-rightmargin">rightmargin</code> attribute
<tbody>
<tr>
<td rowspan="3">'margin-bottom'
<td><code>body</code> element's <code title="attr-body-marginheight">marginheight</code> attribute
<tr>
<td>The <code>body</code> element's <span>container frame element</span>'s <code title="attr-frame-marginheight">marginheight</code> attribute
<tr>
<td><code>body</code> element's <code title="attr-body-bottommargin">topmargin</code> attribute
<tbody>
<tr>
<td rowspan="3">'margin-left'
<td><code>body</code> element's <code title="attr-body-marginwidth">marginwidth</code> attribute
<tr>
<td>The <code>body</code> element's <span>container frame element</span>'s <code title="attr-frame-marginwidth">marginwidth</code> attribute
<tr>
<td><code>body</code> element's <code title="attr-body-leftmargin">rightmargin</code> attribute
</table>

<p>If the <code>body</code> element's <code>Document</code>'s
<span>browsing context</span> is a <span>nested browsing
context</span>, and the <span>browsing context container</span> of
that <span>nested browsing context</span> is a <code>frame</code> or
<code>iframe</code> element, then the the <dfn>container frame
element</dfn> of the <code>body</code> element is that
<code>frame</code> or <code>iframe</code> element. Otherwise, there
is no <span>container frame element</span>.</p>

<hr>


-->

<!-- XXX need to separate the author-level rules from the user-agent-level rules
so that the user-level rules can slide between them
the spec lists the attributes that should count as presentational:
http://www.w3.org/Style/Group/css2-src/cascade.html#preshint -->



<h2>Obsolete features</h2>

0 comments on commit 94445ca

Please sign in to comment.
You can’t perform that action at this time.