Skip to content

Commit 9ab5c66

Browse files
committed
[css-text] Various editorial fixes
1 parent 7b900d8 commit 9ab5c66

2 files changed

Lines changed: 128 additions & 54 deletions

File tree

css-text/Overview.bs

Lines changed: 66 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,8 @@ Languages and Typesetting</h4>
361361
</div>
362362

363363
<p class="note">
364-
As defined in <a href="#order">Text Processing Order of Operations</a>,
365-
this property affects line breaks and other CSS properties.
364+
Note that, as defined in <a href="#order">Text Processing Order of Operations</a>,
365+
transforming text affects line-breaking and other formatting operations.
366366

367367
<p>
368368
The UA must use the full case mappings for Unicode
@@ -865,7 +865,7 @@ Line Breaking Details</h3>
865865
<li>For <i>soft wrap opportunities</i> before the first or after the last character of a box,
866866
the break occurs immediately before/after the box (at its margin edge)
867867
rather than breaking the box between its content edge and the content.
868-
<li>Line breaking in/around Ruby is defined in Ruby box and line breaking [[!CSS3RUBY]].
868+
<li>Line breaking in/around Ruby is defined in <a href="http://www.w3.org/TR/css-ruby-1/#line-breaks">CSS Ruby</a> [[!CSS3RUBY]].
869869
</ul>
870870

871871
<h3 id="word-break-property">
@@ -1211,38 +1211,39 @@ Line Breaking Details</h3>
12111211
<dl dfn-for=hyphens dfn-type=value>
12121212
<dt><dfn>none</dfn>
12131213
<dd>Words are not hyphenated, even if characters inside
1214-
the word explicitly define hyphenation opportunities.
1214+
the word explicitly define <i>hyphenation opportunities</i>.
12151215
<dt><dfn>manual</dfn>
12161216
<dd>Words are only hyphenated where there are characters inside the word
1217-
that explicitly suggest hyphenation opportunities.
1217+
that explicitly suggest <i>hyphenation opportunities</i>.
12181218
<div class="example">
12191219
<p>In Unicode, U+00AD is a conditional "soft hyphen" and U+2010 is an
12201220
unconditional hyphen. Unicode Standard Annex #14 describes the
12211221
<a href="http://unicode.org/reports/tr14/#SoftHyphen">role of soft hyphens in</a>
12221222
Unicode line breaking. [[!UAX14]]
1223-
In HTML, &amp;shy; represents the soft hyphen character which
1224-
suggests a hyphenation opportunity.
1223+
In HTML, &amp;shy; represents the soft hyphen character,
1224+
which suggests a hyphenation opportunity.
12251225
<pre>ex&amp;shy;ample</pre>
12261226
</div>
12271227
<dt><dfn>auto</dfn>
1228-
<dd>Words may be broken at appropriate hyphenation points either
1229-
as determined by hyphenation characters inside the word or
1230-
as determined automatically by a language-appropriate hyphenation resource.
1231-
Conditional hyphenation characters inside a word, if present,
1232-
suppress the use of automatic resources
1233-
when determining hyphenation opportunities within the word.
1228+
<dd>Words may be broken at <i>hyphenation opportunities</i>
1229+
determined automatically by a language-appropriate hyphenation resource
1230+
in addition to those indicated explicitly by a conditional hyphen.
1231+
Automatic <i>hyphenation opportunities</i> within a word are ignored
1232+
if it contains a conditional hyphen (&amp;shy; or U+00AD).
12341233
</dl>
12351234

12361235
<p>Correct automatic hyphenation requires a hyphenation resource
1237-
appropriate to the language of the text being broken. The UA is
1238-
therefore only required to automatically hyphenate text for which
1239-
the author has declared a language (e.g. via HTML <code>lang</code>
1240-
or XML <code>xml:lang</code>) and for which it has an appropriate
1241-
hyphenation resource.
1236+
appropriate to the language of the text being broken.
1237+
The UA is therefore only required to automatically hyphenate text
1238+
for which the <i>content language</i> is known
1239+
and for which it has an appropriate hyphenation resource.
12421240

1243-
<p>
1244-
Automatic hyphenation points within a word are ignored
1245-
when it contains soft hyphens (&amp;shy; or U+00AD.)
1241+
<p class="advisement">
1242+
Authors should correctly tag their content’s <i title="content language">language</i>
1243+
(e.g. using the HTML ''lang'' attribute)
1244+
in order to obtain correct automatic hyphenation.
1245+
UAs may refuse to automatically hyphenate untagged content
1246+
regardless of the 'hyphens' property value.
12461247

12471248
<p>When shaping scripts such as Arabic are allowed to break within words
12481249
due to hyphenation, the characters must still be shaped as if the word
@@ -2229,12 +2230,50 @@ Word Spacing: the 'word-spacing' property</h3>
22292230
left-to-right text with no floats present, then first line of text
22302231
will start 5em into the block:</p>
22312232

2232-
<pre><!--
2233-
--> Since CSS1 it has been possible
2234-
<!-- -->to indent the first line of a block
2235-
<!-- -->element using the 'text-indent'
2236-
<!-- -->property.<!--
2237-
--></pre>
2233+
<pre class="output">
2234+
Since CSS1 it has been possible to
2235+
indent the first line of a block element
2236+
5em by setting the 'text-indent' property&nbsp;
2237+
to '5em'.
2238+
</pre>
2239+
<p>If we add the ''text-indent/hanging'' keyword,
2240+
then the first line will start flush,
2241+
but other lines will be indented 5em:
2242+
<pre class="output">
2243+
In CSS3 we can instead indent all other
2244+
lines of the block element by 5em
2245+
by setting the 'text-indent' property
2246+
to 'hanging 5em'.
2247+
</pre>
2248+
</div>
2249+
2250+
<div class="example">
2251+
<p>Since the 'text-indent' property only affects the “first formatted line”,
2252+
a line after a forced break will not be indented.
2253+
<pre class="output">
2254+
For example, in the middle of
2255+
this paragraph is an equation,
2256+
which is centered:
2257+
x + y = z
2258+
The first line after the equation
2259+
is flush (else it would look like
2260+
we started a new paragraph).
2261+
</pre>
2262+
<p>However, sometimes (as in poetry or code),
2263+
it is appropriate to indent each line
2264+
that happens to be long enough to wrap.
2265+
In the following example, 'text-indent'
2266+
is given a value of ''3em hanging each-line'',
2267+
giving the third line of the poem a hanging indent
2268+
where it soft-wraps at the block's right boundary:
2269+
<pre class="output">
2270+
In a short line of text
2271+
There need be no wrapping,
2272+
But when we go on and on and on&nbsp;&nbsp;
2273+
and on,
2274+
Sometimes a soft break
2275+
Can help us stay on the page.
2276+
</pre>
22382277
</div>
22392278

22402279
<p class="note">Note that since the 'text-indent' property inherits,
@@ -2583,7 +2622,6 @@ Characters and Properties</h2>
25832622
They are assumed to have the same East Asian Width property as the base,
25842623
but take their other properties from the first combining character in the sequence.
25852624
</ul>
2586-
<p>The
25872625

25882626
<h2 class="no-num" id="acknowledgements">
25892627
Acknowledgements</h2>

css-text/Overview.html

Lines changed: 62 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,8 @@ <h3 class="heading settled heading" data-level=2.1 id=text-transform-property><s
535535
</div>
536536

537537
<p class=note>
538-
As defined in <a href=#order>Text Processing Order of Operations</a>,
539-
this property affects line breaks and other CSS properties.
538+
Note that, as defined in <a href=#order>Text Processing Order of Operations</a>,
539+
transforming text affects line-breaking and other formatting operations.
540540

541541
<p>
542542
The UA must use the full case mappings for Unicode
@@ -1038,7 +1038,7 @@ <h3 class="heading settled heading" data-level=5.1 id=line-break-details><span c
10381038
<li>For <a data-link-type=dfn href=#soft-wrap-opportunity title="soft wrap opportunities">soft wrap opportunities</a> before the first or after the last character of a box,
10391039
the break occurs immediately before/after the box (at its margin edge)
10401040
rather than breaking the box between its content edge and the content.
1041-
<li>Line breaking in/around Ruby is defined in Ruby box and line breaking <a data-biblio-type=normative data-link-type=biblio href=#biblio-css3ruby title=biblio-css3ruby>[CSS3RUBY]</a>.
1041+
<li>Line breaking in/around Ruby is defined in <a href=http://www.w3.org/TR/css-ruby-1/#line-breaks>CSS Ruby</a> <a data-biblio-type=normative data-link-type=biblio href=#biblio-css3ruby title=biblio-css3ruby>[CSS3RUBY]</a>.
10421042
</ul>
10431043

10441044
<h3 class="heading settled heading" data-level=5.2 id=word-break-property><span class=secno>5.2 </span><span class=content>
@@ -1373,38 +1373,39 @@ <h3 class="heading settled heading" data-level=6.1 id=hyphens-property><span cla
13731373
<dl data-dfn-for=hyphens data-dfn-type=value>
13741374
<dt><dfn class=css-code data-dfn-for=hyphens data-dfn-type=value data-export="" id=valdef-hyphens.none>none<a class=self-link href=#valdef-hyphens.none></a></dfn>
13751375
<dd>Words are not hyphenated, even if characters inside
1376-
the word explicitly define hyphenation opportunities.
1376+
the word explicitly define <a data-link-type=dfn href=#hyphenation-opportunity title="hyphenation opportunities">hyphenation opportunities</a>.
13771377
<dt><dfn class=css-code data-dfn-for=hyphens data-dfn-type=value data-export="" id=valdef-hyphens.manual>manual<a class=self-link href=#valdef-hyphens.manual></a></dfn>
13781378
<dd>Words are only hyphenated where there are characters inside the word
1379-
that explicitly suggest hyphenation opportunities.
1379+
that explicitly suggest <a data-link-type=dfn href=#hyphenation-opportunity title="hyphenation opportunities">hyphenation opportunities</a>.
13801380
<div class=example>
13811381
<p>In Unicode, U+00AD is a conditional "soft hyphen" and U+2010 is an
13821382
unconditional hyphen. Unicode Standard Annex #14 describes the
13831383
<a href=http://unicode.org/reports/tr14/#SoftHyphen>role of soft hyphens in</a>
13841384
Unicode line breaking. <a data-biblio-type=normative data-link-type=biblio href=#biblio-uax14 title=biblio-uax14>[UAX14]</a>
1385-
In HTML, &amp;shy; represents the soft hyphen character which
1386-
suggests a hyphenation opportunity.
1385+
In HTML, &amp;shy; represents the soft hyphen character,
1386+
which suggests a hyphenation opportunity.
13871387
<pre>ex&amp;shy;ample</pre>
13881388
</div>
13891389
<dt><dfn class=css-code data-dfn-for=hyphens data-dfn-type=value data-export="" id=valdef-hyphens.auto>auto<a class=self-link href=#valdef-hyphens.auto></a></dfn>
1390-
<dd>Words may be broken at appropriate hyphenation points either
1391-
as determined by hyphenation characters inside the word or
1392-
as determined automatically by a language-appropriate hyphenation resource.
1393-
Conditional hyphenation characters inside a word, if present,
1394-
suppress the use of automatic resources
1395-
when determining hyphenation opportunities within the word.
1390+
<dd>Words may be broken at <a data-link-type=dfn href=#hyphenation-opportunity title="hyphenation opportunities">hyphenation opportunities</a>
1391+
determined automatically by a language-appropriate hyphenation resource
1392+
in addition to those indicated explicitly by a conditional hyphen.
1393+
Automatic <a data-link-type=dfn href=#hyphenation-opportunity title="hyphenation opportunities">hyphenation opportunities</a> within a word are ignored
1394+
if it contains a conditional hyphen (&amp;shy; or U+00AD).
13961395
</dl>
13971396

13981397
<p>Correct automatic hyphenation requires a hyphenation resource
1399-
appropriate to the language of the text being broken. The UA is
1400-
therefore only required to automatically hyphenate text for which
1401-
the author has declared a language (e.g. via HTML <code>lang</code>
1402-
or XML <code>xml:lang</code>) and for which it has an appropriate
1403-
hyphenation resource.
1398+
appropriate to the language of the text being broken.
1399+
The UA is therefore only required to automatically hyphenate text
1400+
for which the <a data-link-type=dfn href=#content-language title="content language">content language</a> is known
1401+
and for which it has an appropriate hyphenation resource.
14041402

1405-
<p>
1406-
Automatic hyphenation points within a word are ignored
1407-
when it contains soft hyphens (&amp;shy; or U+00AD.)
1403+
<p class=advisement>
1404+
Authors should correctly tag their content’s <a data-link-type=dfn href=#content-language title="content language">language</a>
1405+
(e.g. using the HTML <span class=css data-link-type=maybe title=lang>lang</span> attribute)
1406+
in order to obtain correct automatic hyphenation.
1407+
UAs may refuse to automatically hyphenate untagged content
1408+
regardless of the <a class=property data-link-type=propdesc href=#propdef-hyphens title=hyphens>hyphens</a> property value.
14081409

14091410
<p>When shaping scripts such as Arabic are allowed to break within words
14101411
due to hyphenation, the characters must still be shaped as if the word
@@ -2365,10 +2366,46 @@ <h3 class="heading settled heading" data-level=9.1 id=text-indent-property><span
23652366
left-to-right text with no floats present, then first line of text
23662367
will start 5em into the block:</p>
23672368

2368-
<pre> Since CSS1 it has been possible
2369-
to indent the first line of a block
2370-
element using the 'text-indent'
2371-
property.</pre>
2369+
<pre class=output> Since CSS1 it has been possible to
2370+
indent the first line of a block element
2371+
5em by setting the 'text-indent' property 
2372+
to '5em'.
2373+
</pre>
2374+
<p>If we add the <a class=css data-link-for=text-indent data-link-type=maybe href=#valdef-text-indent.hanging title=hanging>hanging</a> keyword,
2375+
then the first line will start flush,
2376+
but other lines will be indented 5em:
2377+
<pre class=output>In CSS3 we can instead indent all other
2378+
lines of the block element by 5em
2379+
by setting the 'text-indent' property
2380+
to 'hanging 5em'.
2381+
</pre>
2382+
</div>
2383+
2384+
<div class=example>
2385+
<p>Since the <a class=property data-link-type=propdesc href=#propdef-text-indent title=text-indent>text-indent</a> property only affects the “first formatted line”,
2386+
a line after a forced break will not be indented.
2387+
<pre class=output> For example, in the middle of
2388+
this paragraph is an equation,
2389+
which is centered:
2390+
x + y = z
2391+
The first line after the equation
2392+
is flush (else it would look like
2393+
we started a new paragraph).
2394+
</pre>
2395+
<p>However, sometimes (as in poetry or code),
2396+
it is appropriate to indent each line
2397+
that happens to be long enough to wrap.
2398+
In the following example, <a class=property data-link-type=propdesc href=#propdef-text-indent title=text-indent>text-indent</a>
2399+
is given a value of <span class=css data-link-type=maybe title="3em hanging each-line">3em hanging each-line</span>,
2400+
giving the third line of the poem a hanging indent
2401+
where it soft-wraps at the block’s right boundary:
2402+
<pre class=output>In a short line of text
2403+
There need be no wrapping,
2404+
But when we go on and on and on  
2405+
and on,
2406+
Sometimes a soft break
2407+
Can help us stay on the page.
2408+
</pre>
23722409
</div>
23732410

23742411
<p class=note>Note that since the <a class=property data-link-type=propdesc href=#propdef-text-indent title=text-indent>text-indent</a> property inherits,
@@ -2708,7 +2745,6 @@ <h2 class="no-num heading settled heading" id=character-properties><span class=c
27082745
They are assumed to have the same East Asian Width property as the base,
27092746
but take their other properties from the first combining character in the sequence.
27102747
</ul>
2711-
<p>The
27122748

27132749
<h2 class="no-num heading settled heading" id=acknowledgements><span class=content>
27142750
Acknowledgements</span><a class=self-link href=#acknowledgements></a></h2>

0 commit comments

Comments
 (0)