Skip to content

Commit f5365a8

Browse files
committed
[css2] Tantek's edits (after Ian's comments).
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%402014
1 parent 00bcfed commit f5365a8

3 files changed

Lines changed: 242 additions & 158 deletions

File tree

css2/images/supercal.png

3.85 KB
Loading

css2/text.src

Lines changed: 112 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
22
"http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd">
33
<html lang="en">
4-
<!-- $Id: text.src,v 2.33 2002-11-29 20:21:05 bbos Exp $ -->
4+
<!-- $Id: text.src,v 2.34 2003-01-21 12:51:31 bbos Exp $ -->
55
<head>
66
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
77
<title>Text</title>
8-
<!-- Changed by: Tantek Celik, 2002-11-16 -->
8+
<!-- Changed by: Tantek Celik, 2003-01-20 -->
99
<style type="text/css">
1010
.current,.proposed { background:#feb }
1111
ins.proposed { background:#bfb }
@@ -62,14 +62,12 @@ p { text-indent: 3em }
6262
</pre>
6363
</div>
6464

65-
<ins class="proposed">
6665
<p class="note">
6766
Note: Since the 'text-indent' property inherits, when specified on
6867
a block element, it will affect descendent inline-block elements.
6968
For this reason, it is often wise to specify '<code>text-indent: 0</code>'
7069
on elements that are specified '<code>display:inline-block</code>'.
7170
</p>
72-
</ins>
7371

7472
<h2><a name="alignment-prop">Alignment:</a> the <span
7573
class="propinst-text-align">'text-align'</span> property</h2>
@@ -100,7 +98,7 @@ In this example, note that since <span
10098
class="propinst-text-align">'text-align'</span> is inherited, all
10199
block-level elements inside the DIV element with 'class=important' will
102100
have their inline content centered.
103-
101+
</p>
104102
<pre>
105103
div.important { text-align: center }
106104
</pre>
@@ -110,12 +108,13 @@ div.important { text-align: center }
110108
<em><strong>Note.</strong>
111109
The actual justification algorithm used depends on the user-agent and the language/script
112110
of the text.</em>
113-
111+
</p>
114112
<p><em><span class="index-inst" title="conformance"><a
115113
href="conform.html#conformance">Conforming user agents</a></span> may
116114
interpret the value 'justify' as 'left' or 'right', depending on
117115
whether the element's default writing direction is left-to-right or
118116
right-to-left, respectively.</em>
117+
</p>
119118
</div>
120119

121120
<h2>Decoration</h2>
@@ -135,35 +134,35 @@ affects) an <a href="visuren.html#inline-level">inline-level</a> element, it
135134
affects all boxes generated by the element. If the element has no
136135
content or no text content (e.g., the IMG element in HTML), user
137136
agents must <a href="syndata.html#ignore">ignore</a> this property.
138-
137+
</p>
139138
<p>Values have the following meanings:</p>
140139

141140
<dl>
142-
<dt>none
143-
<dd>Produces no text decoration.
144-
<dt>underline
145-
<dd>Each line of text is underlined.
146-
<dt>overline
147-
<dd>Each line of text has a line above it.
148-
<dt>line-through
149-
<dd>Each line of text has a line through the middle
150-
<dt>blink
141+
<dt>none</dt>
142+
<dd>Produces no text decoration.</dd>
143+
<dt>underline</dt>
144+
<dd>Each line of text is underlined.</dd>
145+
<dt>overline</dt>
146+
<dd>Each line of text has a line above it.</dd>
147+
<dt>line-through</dt>
148+
<dd>Each line of text has a line through the middle.</dd>
149+
<dt>blink</dt>
151150
<dd>Text blinks (alternates between visible and invisible).
152151
<a href="conform.html#conformance">Conforming user agents</a>
153152
may simply not blink the text. Note that not blinking the text
154153
is one technique to satisfy
155-
<a href="http://www.w3.org/TR/UAAG/guidelines.html#tech-on-off-blinking-text">checkpoint 3.3 of WAI-UAAG</a>.
154+
<a href="http://www.w3.org/TR/UAAG/guidelines.html#tech-on-off-blinking-text">checkpoint 3.3 of WAI-UAAG</a>.</dd>
156155
</dl>
157156

158157
<p> The color(s) required for the text decoration must be derived
159158
from the <span class="propinst-color">'color'</span> property value.
160-
159+
</p>
161160
<p> This property is not inherited, but descendant boxes of a
162161
block box should be formatted with the same decoration (e.g.,
163162
they should all be underlined). The color of decorations should remain
164163
the same even if descendant elements have different <span
165164
class="propinst-color">'color'</span> values.
166-
165+
</p>
167166
<div class="example"><p>
168167
In the following example for HTML, the text content of all
169168
A elements acting as hyperlinks (whether visited or not) will be underlined:</p>
@@ -184,28 +183,28 @@ class="propinst-word-spacing">'word-spacing'</span> properties</h2>
184183
text characters. Values have the following meanings:</p>
185184

186185
<dl>
187-
<dt>normal
186+
<dt>normal</dt>
188187
<dd>The spacing is the normal spacing for the current font.
189188
This value allows the user agent to alter the space
190-
between characters in order to justify text.
189+
between characters in order to justify text.</dd>
191190
<dt><span class="index-inst" title="&lt;length&gt;"><span
192-
class="value-inst-length">&lt;length&gt;</span></span>
191+
class="value-inst-length">&lt;length&gt;</span></span></dt>
193192
<dd>This value indicates inter-character space <em>in
194193
addition to</em> the default space between
195194
characters. Values may be negative, but there may be
196195
implementation-specific limits.
197196
User agents may not further increase or decrease the inter-character
198-
space in order to justify text.
197+
space in order to justify text.</dd>
199198
</dl>
200199

201200
<p>Character spacing algorithms are user agent-dependent. Character
202201
spacing may also be influenced by justification (see the <span
203202
class="propinst-text-align">'text-align'</span> property).
204-
203+
</p>
205204
<div class="example"><p>
206205
In this example, the space between characters in
207206
BLOCKQUOTE elements is increased by '0.1em'.
208-
207+
</p>
209208
<pre>
210209
blockquote { letter-spacing: 0.1em }
211210
</pre>
@@ -221,32 +220,34 @@ blockquote { letter-spacing: 0cm } /* Same as '0' */
221220
<p> When the resultant space between two characters is not the same as
222221
the default space, user agents should not use
223222
<span class="index-inst" title="ligatures">ligatures.</span>
223+
</p>
224224

225225
<!-- #include src=properties/word-spacing.srb -->
226226

227227
<p>This property specifies spacing behavior between words.
228228
Values have the following meanings:</p>
229229

230230
<dl>
231-
<dt>normal
231+
<dt>normal</dt>
232232
<dd>The normal inter-word space, as defined by the current font and/or
233-
the <abbr title="user agent">UA</abbr>.
233+
the <abbr title="user agent">UA</abbr>.</dd>
234234
<dt><span class="index-inst" title="&lt;length&gt;"><span
235-
class="value-inst-length">&lt;length&gt;</span></span>
235+
class="value-inst-length">&lt;length&gt;</span></span></dt>
236236
<dd>This value indicates inter-word space <em>in
237237
addition to</em> the default space between
238238
words. Values may be negative, but there may be
239-
implementation-specific limits.
239+
implementation-specific limits. </dd>
240240
</dl>
241241

242242
<p>Word spacing algorithms are user agent-dependent. Word spacing is
243243
also influenced by justification (see the <span
244244
class="propinst-text-align">'text-align'</span> property).
245+
</p>
245246

246247
<div class="example"><p>
247248
In this example, the word-spacing between each word in H1 elements is
248249
increased by '1em'.
249-
250+
</p>
250251
<pre>
251252
h1 { word-spacing: 1em }
252253
</pre>
@@ -261,20 +262,20 @@ class="propinst-text-transform">'text-transform'</span> property</h2>
261262
an element's text. Values have the following meanings:</p>
262263

263264
<dl>
264-
<dt>capitalize
265-
<dd>Puts the first character of each word in uppercase.
266-
<dt>uppercase
267-
<dd>Puts all characters of each word in uppercase.
268-
<dt>lowercase
269-
<dd>Puts all characters of each word in lowercase.
270-
<dt>none
271-
<dd>No capitalization effects.
265+
<dt>capitalize</dt>
266+
<dd>Puts the first character of each word in uppercase.</dd>
267+
<dt>uppercase</dt>
268+
<dd>Puts all characters of each word in uppercase.</dd>
269+
<dt>lowercase</dt>
270+
<dd>Puts all characters of each word in lowercase.</dd>
271+
<dt>none</dt>
272+
<dd>No capitalization effects.</dd>
272273
</dl>
273274

274275
<p> The actual transformation in each case is written language
275276
dependent. See RFC 2070 ([[RFC2070]]) for ways to find the language of
276277
an element.
277-
278+
</p>
278279
<p><span class="index-inst" title="conformance"><a
279280
href="conform.html#conformance">Conforming user agents</a></span>
280281
may consider the value of <span
@@ -283,10 +284,11 @@ for characters that are not from the Latin-1 repertoire and for
283284
elements in languages for which the transformation is different from
284285
that specified by the case-conversion tables of ISO 10646
285286
([[ISO10646]]).
286-
287+
</p>
287288
<div class="example"><p>
288289
In this example, all text in an H1 element is transformed to uppercase
289290
text.
291+
</p>
290292
<pre>
291293
h1 { text-transform: uppercase }
292294
</pre>
@@ -304,43 +306,103 @@ handled. Values have the following meanings:</p>
304306

305307
<!-- See the HTML definition of whitespace -IJ -->
306308
<dl>
307-
<dt>normal
309+
<dt>normal</dt>
308310
<dd>This value directs user agents to collapse sequences
309-
of whitespace, and break lines as necessary to fill line boxes.
310-
<dt>pre
311+
of whitespace, and break lines as necessary to fill line boxes.</dd>
312+
<dt>pre</dt>
311313
<dd>This value prevents user agents from collapsing sequences
312314
of whitespace. Lines are only broken at newlines in the source, or
313-
at occurrences of "\A" in generated content.
314-
<dt>nowrap
315+
at occurrences of "\A" in generated content.</dd>
316+
<dt>nowrap</dt>
315317
<dd>This value collapses whitespace as for 'normal', but suppresses
316-
line breaks within text.
317-
<dt>pre-wrap
318+
line breaks within text.</dd>
319+
<dt>pre-wrap</dt>
318320
<dd>This value prevents user agents from collapsing sequences
319321
of whitespace. Lines are broken at newlines in the source,
320322
at occurrences of "\A" in generated content,
321-
and as necessary to fill line boxes.
322-
<dt>pre-line
323+
and as necessary to fill line boxes.</dd>
324+
<dt>pre-line</dt>
323325
<dd>This value collapses whitespace as for 'normal', except
324326
occurrences of newlines in the source or "\A" in generated content
325-
do cause line breaks.
327+
do cause line breaks.</dd>
326328
</dl>
327329

328330
<div class="example"><p> The following examples show what <a
329331
href="syndata.html#whitespace">whitespace</a> behavior is expected
330332
from the PRE and P elements, the "nowrap" attribute in HTML, and
331333
in generated content.
334+
</p>
332335
<pre>
333336
pre { white-space: pre }
334337
p { white-space: normal }
335338
td[nowrap] { white-space: nowrap }
336339
:before,:after { white-space: pre-line }
337340
</pre>
338341
<p>In addition, the effect of an HTML PRE element with the <em>non-standard</em> "wrap" attribute is demonstrated by the following example:
342+
</p>
339343
<pre>
340344
pre[wrap] { white-space: pre-wrap }
341345
</pre>
342346
</div>
343347

348+
<ins class="proposed">
349+
<h3 id="white-space-model">The 'white-space' processing model</h3>
350+
<p>
351+
Any text that is directly contained inside a block (not inside an
352+
inline) should be treated as an anonymous inline element.
353+
</p>
354+
<p>
355+
For each inline (including anonymous inlines), the following steps are
356+
performed, ignoring bidi formatting characters as if they were not
357+
there:
358+
</p>
359+
<ol>
360+
<li>Each non-linefeed whitespace character surrounding a linefeed
361+
character is removed if 'white-space' is set to 'normal',
362+
'no-wrap', or 'pre-line'.
363+
</li>
364+
<li>If 'white-space' is set to 'pre' or 'pre-wrap', any sequence of
365+
spaces (U+0020) unbroken by an element boundary is treated as a
366+
sequence of non-breaking spaces. However, a line breaking
367+
opportunity exists at the end of the sequence.
368+
</li>
369+
<li>If 'white-space' is set to 'normal' or 'nowrap', linefeed
370+
characters are transformed for rendering purpose into one of the
371+
following characters: a space character, a zero width space
372+
character (U+200B), or no character (i.e. not rendered),
373+
according to UA-specific algorithms based on the content script.
374+
</li>
375+
<li>If 'white-space' is set to 'normal', 'nowrap', or 'pre-line',
376+
<ol><li> every tab (U+0009) is converted to a space (U+0020)</li>
377+
<li> any space (U+0020) following another space (U+0020) -- even
378+
a space before the inline, if that space also has
379+
'white-space set to 'normal', 'nowrap' or 'pre-line' -- is removed.</li>
380+
</ol>
381+
</li>
382+
</ol>
383+
<p>
384+
Then, the entire block is rendered. Inlines are laid out, taking bidi
385+
reordering into account, and wrapping as specified by the
386+
'white-space' property.
387+
</p>
388+
<p>
389+
As each line is laid out,
390+
</p>
391+
<ol>
392+
<li>If a space (U+0020) at the beginning of a line has 'white-space'
393+
set to 'normal', 'nowrap', or 'pre-line', it is removed.
394+
</li>
395+
<li>All tabs (U+0009) are rendered as a horizontal shift that lines
396+
up the start edge of the next glyph with the next tab stop. Tab
397+
stops occur at points that are mutiples of 8 times the width of
398+
a space (U+0020) rendered in the block's font from the block's
399+
starting content edge.
400+
</li>
401+
<li>If a space (U+0020) at the end of a line has 'white-space' set to
402+
'normal', 'nowrap', or 'pre-line', it is also removed.
403+
</li>
404+
</ol>
405+
</ins>
344406

345407
</body>
346408
</html>

0 commit comments

Comments
 (0)