Skip to content

Commit f93dac9

Browse files
committed
[css2] Authors should put content property in @media, added limitation (no postion, float) to :before and :after, markers have no margins, added @media to examples where pertinent, height propety may be set for before/after content
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%401235
1 parent 55eb83b commit f93dac9

1 file changed

Lines changed: 53 additions & 39 deletions

File tree

css2/generate.src

Lines changed: 53 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ from the element to which they are attached.</p>
6262
specify content, and the style of that content, before and after an
6363
element's <a href="conform.html#doctree">document tree</a> content.
6464

65-
<!-- Do they allow the position and float properties? Probably
66-
not. Must say so. -IJ -->
67-
6865
<P>The :before and :after pseudo-elements elements allow
6966
values of the <span class="propinst-display">'display'</span>
7067
property as follows:
@@ -85,10 +82,19 @@ was 'inline'.
8582
</ul>
8683

8784
<div class="note"><P>
88-
<em><strong>Note.</strong>Other values may be permitted in
85+
<em><strong>Note.</strong> Other values may be permitted in
8986
future levels of CSS.</em>
9087
</div>
9188

89+
90+
<!-- Proposed -IJ -->
91+
92+
<P>User agents must ignore the following properties with :before and
93+
:after pseudo-elements: <span
94+
class="propinst-position">'position'</span>, <span
95+
class="propinst-float">'float'</span>, list properties, and table
96+
properties.
97+
9298
<P>The (inline or block) box created for the generated content
9399
precedes (or follows for :after) any box generated by the element's
94100
content. For block-level elements, the containing block established by
@@ -159,17 +165,13 @@ class="value-inst-string"><strong>&lt;string&gt;</strong></span></span>
159165
<dt><span class="index-inst" title="&lt;uri&gt;"><span
160166
class="value-inst-uri"><strong>&lt;uri&gt;</strong></span></span>
161167
<dd>The value is a URI that designates an external resource.
168+
If a user agent cannot support the resource because of the
169+
media types it supports, it must ignore the resource.
162170
<strong>Note.</strong> CSS2 offers no
163171
mechanism to change the size of the embedded object, or to provide a
164172
textual description, like the "alt" or "longdesc" attributes do for
165173
images in HTML. This may change in future levels of CSS.
166174

167-
<!-- Specify what media types are allowed? Media type must match
168-
current medium (or current @media?): aural rendering MUST ignore an
169-
image, etc. Text/html must be ignored by all. For efficiency, allow
170-
"visual-url(URL)" (or "visual(url())" or some other syntax)? 26/2/98
171-
-->
172-
173175
<dt><span class="index-inst" title="&lt;counter&gt;"><span
174176
class="value-inst-counter"><strong>&lt;counter&gt;</strong></span></span>
175177
<dd><a href="syndata.html#counter">Counters</a> have the form
@@ -223,7 +225,6 @@ is <em>not</em> replaced by a space).
223225
-->
224226
</dl>
225227

226-
227228
<div class="example">
228229
<p>This rule inserts the text of the HTML "alt" attribute before the
229230
image. If the image is not displayed, the reader will still see the
@@ -234,6 +235,14 @@ IMG:before {content: attr(alt)}
234235
</pre>
235236
</div>
236237

238+
<P>Authors should put <span class="propinst-content">'content'</span>
239+
declarations in <span class="index-inst" title="@media"><a
240+
href="media.html@at-media-rule">@media</a></span> rules when
241+
the content requires media consideration. For instance, literal
242+
text may be used for any media group, but images only
243+
apply to the visual, bitmap media groups, and sound files only
244+
apply to the aural media group.
245+
237246
<div class=note>
238247
<p><em><strong>Note.</strong> In future levels of CSS, the <span
239248
class="propinst-content">'content'</span> property may accept
@@ -476,7 +485,7 @@ the counter is set to on each occurrence of the element. The default
476485
is 0.
477486

478487
<p>If <span
479-
class="propinst-counter-increments">'counter-increments'</span> refers
488+
class="propinst-counter-increment">'counter-increment'</span> refers
480489
to a counter that is not in the <a href="#scope">scope</a> of any
481490
<span class="propinst-counter-reset">'counter-reset'</span>, the
482491
counter is assumed to have been reset to 0 by the root element.
@@ -660,11 +669,7 @@ content (i.e., one <a href="visuren.html#line-box">line box</a>), so
660669
they are not as flexible as <a href="visuren.html">floats</a>, which
661670
may be used to align entire blocks horizontally.
662671

663-
<P>Marker boxes have padding, borders, and margins.
664-
665-
<!-- Do they have margins? I would say no except that
666-
abs. positioned boxes now have margins, too -IJ -->
667-
<!-- I'd say no, too. BB -->
672+
<P>Marker boxes have padding and borders, but no margins.
668673

669674
<P>To create a marker box for :before or :after content, the <span
670675
class="propinst-display">'display'</span> property must be given the
@@ -688,9 +693,11 @@ principal box.
688693
specified with the <span
689694
class="propinst-vertical-align">'vertical-align'</span> property.
690695

691-
<p>The height of the :before marker and of the first line box of the
692-
principal box is computed as if they were a single line
693-
box. Analogously for the :after marker and the last line box.
696+
<p>By default, the height of the :before marker and of the first line
697+
box of the principal box is computed as if they were a single line
698+
box. Analogously for the :after marker and the last line box. However,
699+
the <span class="propinst-height">'height'</span> property may be
700+
specified for a marker box.
694701

695702
<P>The width of a marker box defaults to the natural width of its
696703
content, but may be specified with the <span
@@ -699,9 +706,10 @@ marker box's content is greater than the specified width, the <span
699706
class="propinst-overflow">'overflow'</span> property specifies
700707
overflow behavior. Marker boxes may overlap principal boxes.
701708

702-
<p>If the 'width' is not 'auto', and is larger than the natural width,
703-
the <span class="propinst-text-align">'text-align'</span> property
704-
determines the alignment of the text in the marker box.
709+
<p>If the <span class="propinst-width">'width'</span> is not 'auto',
710+
and is larger than the natural width, the <span
711+
class="propinst-text-align">'text-align'</span> property determines
712+
the alignment of the text in the marker box.
705713

706714
<P>The <span class="propinst-marker-offset">'marker-offset'</span>
707715
property specifies the horizontal offset between a marker box and the
@@ -711,9 +719,10 @@ href="visuren.html#border-edge">border edges</a>.
711719
<p class="note">[Is this offset kept constant, even if
712720
'overflow:visible'? I would say it gets smaller. BB]
713721

714-
<P>When the <span class="propinst-marker">'marker'</span> property is
715-
set for content generated by an element with 'display: list-item', a
716-
marker box generated for ':before' replaces the normal list item marker.
722+
<P>When the <span class="propinst-display">'display'</span> property
723+
has the value 'marker' for content generated by an element with
724+
'display: list-item', a marker box generated for ':before' replaces
725+
the normal list item marker.
717726

718727
<div class="example"><P>
719728
The following example illustrates how markers may
@@ -797,12 +806,14 @@ list items. This document:</p>
797806
&lt;HTML&gt;
798807
&lt;HEAD&gt;
799808
&lt;STYLE type="text/css"&gt;
800-
LI:before {
801-
display: marker;
802-
content: url(smiley.gif);
803-
LI:after {
804-
display: marker;
805-
content: url(sad.gif);
809+
@media screen, print {
810+
LI:before {
811+
display: marker;
812+
content: url(smiley.gif);
813+
LI:after {
814+
display: marker;
815+
content: url(sad.gif);
816+
}
806817
}
807818
&lt;/STYLE&gt;
808819
&lt;/HEAD&gt;
@@ -835,13 +846,16 @@ The following document:</p>
835846
&lt;HEAD&gt;
836847
&lt;STYLE type="text/css"&gt;
837848
P { margin-left: 12 em; }
838-
P.Note:before {
839-
display: marker;
840-
content: url(note.gif) "Note " numeric(note-counter) ":";
841-
counter-increment: note-counter;
842-
text-align: left;
843-
width: 10em;
844-
}
849+
@media screen, print {
850+
P.Note:before {
851+
display: marker;
852+
content: url(note.gif)
853+
"Note " numeric(note-counter) ":";
854+
counter-increment: note-counter;
855+
text-align: left;
856+
width: 10em;
857+
}
858+
}
845859
&lt;/STYLE&gt;
846860
&lt;/HEAD&gt;
847861
&lt;BODY&gt;

0 commit comments

Comments
 (0)