8000 csswg-drafts/css3-text/Overview.src.html at eeb4030f9e4289b21d82a29475f027ae559cedca · w3c/csswg-drafts · GitHub
Skip to content

Latest commit

 

History

History
4216 lines (3780 loc) · 161 KB

File metadata and controls

4216 lines (3780 loc) · 161 KB
<!DOCTYPE html public '-//W3C//DTD HTML 4.01//EN'
'http://www.w3.org/TR/html4/strict.dtd'>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CSS Text Level 3</title>
<link rel="stylesheet" type="text/css" href="default.css">
<style type="text/css">
.data, .proptable {
margin: 1em auto;
border-collapse: collapse;
border: solid #005A9B;
}
.data caption {
width: 100%;
text-align: center;
}
.data td, .data th,
.proptable td, .proptable th {
border: thin solid;
padding: 0.2em;
text-align: center;
}
.data thead th[scope="row"],
.proptable thead th[scope="row"] {
text-align: right;
background: #A4C8E2;
color: inherit;
}
.data thead,
.proptable thead {
background: #EEEEEE;
color: inherit;
}
.data tbody th:first-child,
.proptable tbody th:first-child {
text-align: right;
background: #EEEEEE;
color: inherit;
}
.data thead,
.data tbody,
.data tfoot,
.data colgroup {
border: solid;
}
table.propdef {
table-layout: auto;
}
.propdef th {
font-style: italic;
font-weight: normal;
text-align: left;
width: 3em;
}
dt dfn code {
font-size: inherit;
}
</style>
<style type="text/css">
.egbidiwsaA,.egbidiwsbB,.egbidiwsaB,.egbidiwsbC
{ white-space:pre;font-size:80%;font-family:monospace; vertical-align:2px; margin:1px }
.egbidiwsaA { background:lime;padding:2px; }
.egbidiwsbB { border:2px solid blue }
.egbidiwsaB { background:yellow;border:2px dotted white }
.egbidiwsbC { border:2px dotted red }
.char { border: 1px dotted gray; }
tt[lang="ja"] { font-family: "MS Gothic", "Osaka", monospace }
</style>
<link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-ED.css">
</head>
<body>
<div class="head">
<!--logo-->
<h1>CSS Text Level 3</h1>
<h2 class="no-num no-toc">[LONGSTATUS] [DATE]</h2>
<dl>
<dt>This version:</dt>
<dd><a href="http://dev.w3.org/csswg/css3-text/Overview.html">$Date$ (CVS $Revision$)</a>
<!--
<dd><a href="http://www.w3.org/TR/[YEAR]/WD-css3-text-[CDATE]/">http://www.w3.org/TR/[YEAR]/WD-css3-text-[CDATE]/</a></dd>
-->
<dt>Latest version:</dt>
<dd><a
href="http://www.w3.org/TR/css3-text/">http://www.w3.org/TR/css3-text/</a></dd>
<dt>Previous version:</dt>
<dd><a
href="http://www.w3.org/TR/2010/WD-css3-text-20101005/">http://www.w3.org/TR/2010/WD-css3-text-20101005/</a></dd>
<dt>Editors:</dt>
<dd><a href="http://fantasai.inkedblade.net/contact">Elika J. Etemad</a> (Invited Expert)</dd>
<dd><a href="mailto:kojiishi@gluesoft.co.jp">Koji Ishii</a> (<a href="http://www.antenna.co.jp/">Antenna House</a>)</dd>
<dd><a href="mailto:murakami@antenna.co.jp">Shinyu Murakami</a> (<a href="http://www.antenna.co.jp/">Antenna House</a>)</dd>
</dl>
<!--begin-copyright-->
<p>[Here will be included the file "../copyright.inc"]</p>
<!--end-copyright-->
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc" id="abstract">Abstract</h2>
<p>This CSS3 module defines properties for text manipulation and
specifies their processing model. It covers line breaking, justification
and alignment, white space handling, text decoration and text
transformation.</p>
<h2 class="no-num no-toc" id="status">Status of This Document</h2>
<p><em>This section describes the status of this document at the time of
its publication. Other documents may supersede this document. A list of
current W3C publications and the latest revision of this technical report
can be found in the <a href="http://www.w3.org/TR/">W3C technical reports
index at http://www.w3.org/TR/.</a></em>
<p>Publication as a Working Draft does not imply endorsement by the W3C
Membership. This is a draft document and may be updated, replaced or
obsoleted by other documents at any time. It is inappropriate to cite this
document as other than work in progress.
<p>This CSS module has been produced as a combined effort of the <a
href="http://www.w3.org/International/Activity">W3C Internationalization Activity</a>,
and the <a href="http://www.w3.org/Style/Activity">Style Activity</a> and is maintained
by the <a href="http://www.w3.org/Style/CSS/members">CSS Working Group</a>. It also
includes contributions made by participants in the <a
href="http://www.w3.org/Style/XSL/Group/">XSL Working Group</a> (<a
href="http://cgi.w3.org/MemberAccess/AccessRequest">members
only</a>).
<p>This document was produced by a group operating under the <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
2004 W3C Patent Policy</a>. W3C maintains a <a
href="http://www.w3.org/2004/01/pp-impl/32061/status"
rel=disclosure>public list of any patent disclosures</a> made in
connection with the deliverables of the group; that page also includes
instructions for disclosing a patent. An individual who has actual
knowledge of a patent which the individual believes contains <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
Claim(s)</a> must disclose the information in ac 133E cordance with <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
6 of the W3C Patent Policy</a>.</p>
<p><strong>Feedback on this draft should be posted to the
(<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>)
public mailing list <a href="mailto:www-style@w3.org">www-style@w3.org</a></strong>
(see <a href="http://www.w3.org/Mail/Request">instructions</a>) <strong>with
<kbd>[css3-text]</kbd> in the subject line.</strong>
You are strongly encouraged to complain if you see something stupid
in this draft. The editors will do their best to respond to all feedback.</p>
<p><strong>If you have implemented properties from the
<a href="http://www.w3.org/TR/2003/CR-css3-text-20030514/">May 2003
CSS3 Text CR</a></strong>
<em>please</em> let us know so we can take that into account as
we redraft the spec. You can post to
<a href="http:// 8D6C lists.w3.org/Archives/Public/www-style/">www-style</a> (public),
post to the <a href="http://lists.w3.org/Archives/Member/w3c-css-wg/">CSS WG mailing list</a>
(<a href="http://cgi.w3.org/MemberAccess/AccessRequest">Member-restricted</a>),
or <a href="http://fantasai.inkedblade.net/contact">email fantasai directly</a> (personal).</p>
<p>The following features are at risk and may be cut from the spec during
its CR period:</p>
<ul>
<li>the 'text-outline' property
<li>the ''unrestricted'' value of 'text-wrap'
<li>the 'hanging-punctuation' property
<li>the 'text-trim' property
<li><span class="issue">audit draft and add more here</span>
</ul>
<h2 class="no-num no-toc" id="contents">Table of Contents</h2>
<!--toc-->
<h2 id="intro">
Introduction</h2>
<p>[document here]</p>
<h3 id="script-groups">Script Groups</h3>
<p>Typographic behavior varies somewhat by language, but varies drastically
by writing system. For convenience, CSS3 Text defines the following
script groups, which combine typographically-similar scripts together.
<dl>
<dt id="block-scripts"><dfn>block scripts</dfn></dt>
<dd>CJK (including Hangul and half-width kana) and by extension all
"wide" characters. (See [[!UAX11]])</dd>
<dt id="clustered-scripts"><dfn>clustered scripts</dfn></dt>
<dd>South-East Asian scripts that have discrete units but do not
use space between words (such as Thai, Lao, Khmer, Myanmar).
This category also includes the Tibetan script.</dd>
<dt id="discrete-scripts"><dfn>discrete scripts</dfn></dt>
<dd>Scripts that use spaces or visible word-separating
punctuation between words and have discrete,
unconnected (in print) units within words, such as Latin,
Greek, Ethiopic, Cyrillic, Hebrew.</dd>
<dt id="cursive-scripts"><dfn>cursive scripts</dfn></dt>
<dd>Arabic and similar cursive scripts.</dd>
<dt id="connected-scripts"><dfn>connected scripts</dfn></dt>
<dd>Devanagari, Ogham, and other scripts that use spaces between
words and baseline connectors within words.
By extension this group also includes Gurmukhi, Tamil and any
other Indic scripts whose typographic behavior is similar to
Devanagari.</dd>
</dl>
<p class="issue">Provide an appendix using Unicode script names.</p>
<p class="note">These definitions are used primarily in describing
<a href="#line-breaking">line-breaking</a> and
<a href="#text-justify">justification</a> behavior.
<h2 id="conformance">
Conformance</h2>
<p>Conformance requirements are expressed with a combination of
descriptive assertions and RFC 2119 terminology. The key words “MUST”,
“MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
“RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
document are to be interpreted as described in RFC 2119.
However, for readability, these words do not appear in all uppercase
letters in this specification. All of the text of this specification is
normative except sections explicitly marked as non-normative, examples,
and notes. [[!RFC2119]]</p>
<p>Examples in this specification are introduced with the words “for example”
or are set apart from the normative text with <code>class="example"</code>,
like this:
<div class="example">
<p>This is an example of an informative example.</p>
</div>
<p>Informative notes begin with the word “Note” and are set apart from the
normative text with <code>class="note"</code>, like this:
<p class="note">Note, this is an informative note.</p>
<p>Conformance to CSS Text Level 3 is defined for three conformance classes:</p>
<dl>
<dt><dfn title="style sheet!!as conformance class">style sheet</dfn>
<dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
style sheet</a>.
<dt><dfn>renderer</dfn></dt>
<dd>A UA that interprets the semantics of a style sheet and renders
<span>documents</span> that use them.
<dt><dfn id="authoring-tool">authoring tool</dfn></dt>
<dd>A UA that writes a style sheet.
</dl>
<p>A style sheet is conformant to CSS Text Level 3
if all of its declarations that use properties defined in this module
have values that are valid according to the generic CSS grammar and the
individual grammars of each property as given in this module.
<p>A renderer is conformant to CSS Text Level 3
if, in addition to interpreting the style sheet as defined by the
appropriate specifications, it supports all the properties defined
by CSS Text Level 3 by parsing them correctly
and rendering the document accordingly. However, the inability of a
UA to correctly render a document due to limitations of the device
does not make the UA non-conformant. (For example, a UA is not
required to render color on a monochrome monitor.)
<p>An authoring tool is conformant to CSS Text
Level 3 if it writes syntactically correct style sheets, according
to the generic CSS grammar and the individual grammars of each
property in this module.</p>
<h3 id="partial-impl">
Partial and Experimental Implementations</h3>
<p>UAs must treat as invalid any properties or values they do not support.
Experimental implementations of a feature should support only a
vendor-prefixed syntax for the property/value.</p>
<h2 id="transforming">
Transforming Text</h2>
<h3 id="text-transform">
<a name="caps-prop"></a>
Transforming Text: the 'text-transform' property</h3>
<table class="propdef">
<tbody> 7E54 ;
<tr>
<th>Name:</th>
<td><dfn>text-transform</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td>none |
[ [ capitalize | uppercase | lowercase ] || fullwidth || large-kana ]
</td>
</tr>
<tr>
<th>Initial:</th>
<td>none</td>
</tr>
<tr>
<th>Applies to:</th>
<td>all elements</td>
</tr>
<tr>
<th>Inherited:</th>
<td>yes</td>
</tr>
<tr>
<th>Percentages:</th>
<td>N/A</td>
</tr>
<tr>
<th>Media:</th>
<td>visual</td>
</tr>
<tr>
<th>Computed&#160;value:</th>
<td>as specified</td>
</tr>
</tbody>
</table>
<p>This property transforms text for styling purposes.
Values have the following meanings:</p>
<dl>
<dt><dfn title="text-transform:none"><code>none</code></dfn></dt>
<dd>No effects.</dd>
<dt><dfn title="text-transform:capitalize"><code>capitalize</code></dfn></dt>
<dd>Puts the first character of each word in titlecase; other characters
are unaffected.</dd>
<dt><dfn title="text-transform:uppercase"><code>uppercase</code></dfn></dt>
<dd>Puts all characters in uppercase.</dd>
<dt><dfn title="text-transform:lowercase"><code>lowercase</code></dfn></dt>
<dd>Puts all characters in lowercase.</dd>
<dt><dfn title="text-transform:fullwidth"><code>fullwidth</code></dfn></dt>
<dd>Puts all characters in fullwidth form.
If the character does not have a corresponding fullwidth form,
it is left as is.
This value is typically used to typeset Latin characters and digits
like ideographic characters.
<dt><dfn title="text-transform:large-kana"><code>large-kana</code></dfn></dt>
<dd>Converts all small Kana characters to normal Kana.
This value is typically used for ruby annotation text,
where all small Kana should be drawn as large Kana.
<p class="note">Authors using this for ruby text may also
want to use ''font-variant: ruby''. [[CSS3FONT]]</p></dd>
</dl>
<p>Although limited, the case mapping process has some language dependencies.
Some well known examples are Turkish and Greek. If the content language
is known then any such language-specific rules must be used.</p>
<p>The case mapping rules for the character repertoire specified by the
Unicode Standard can be found on the Unicode Consortium Web site.
[[!UNICODE]] Only characters belonging to bicameral scripts are
affected.</p>
<p>The definition of fullwidth and halfwidth forms can be found on the
Unicode consortium web site at [[!UAX11]].</p>
<p>The definition of "word" used for ''captilize'' is UA-dependent;
[[UAX29]] is suggested (but not required) for determining such word
boundaries. Authors should not expect ''capitalize'' to follow
language-specific titlecasing conventions (such as skipping articles
in English).
<!-- www-style notes that UAX29 won't work for 'Tis and similar, so
the UA might want to use UAX29 to split into words, but skip forward
past any starting non-letters (as an example of why UAX29 is not ideal) -->
<p>Text transformation happens after <a href="#white-space-rules">white
space processing</a>. (This only matters when ''fullwidth'' transforms
U+0020 space characters to U+3000.) <span class="issue">This requirement
may need to be relaxed during CR, so mark at-risk.</span>
<div class="example">
<p>The following example converts the ASCII characters in abbreviations
in Japanese to their fullwidth variants so that they lay out and line
break like ideographs:
<pre>abbr:lang(ja) { text-transform: fullwidth; }</pre>
</div>
<h2 id="white-space-processing">
White Space Processing</h2>
<p>The source text of a document often contains formatting that
is not relevant to the final rendering: for example, breaking
the source into segments (lines) for ease of editing or adding
white space characters such as tabs and spaces to indent the
source code. CSS white space processing allows the author to
control interpretation of such formatting: to preserve or
collapse it away when rendering the document.
<p>White space processing in CSS interprets white space characters
for rendering: it has no effect on the underlying document data.
<p>In the context of CSS, the document white space set is defined
to be any space characters (Unicode value U+0020), tab characters
(U+0009), and line feeds (U+000A).
<p>However in the document source, segments can be delimited by carriage
returns (U+000D), linefeeds (U+000A) or a combination (U+000D U+000A),
or by some other mechanism, such as the SGML RECORD-START
and RECORD-END tokens. In CSS, each such segment break is treated as
a single line feed character (U+000A).
If no segmentation rules are specified for the document language,
each line feed (U+000A), carriage return (U+000D) and CRLF sequence
(U+000D U+000A) in the text is considered a segment break. (This
default rule also applies to generated content.)
<p class="note">Note that the document parser may have not only normalized
segment breaks, but also collapsed other space characters or
otherwise processed white space according to markup rules. Because CSS
processing occurs <em>after</em> the parsing stage, it is not possible
to restore these characters for styling. Therefore, some of the
behavior specified below can be affected by these limitations and
may be user agent dependent.</p>
<p>Control characters other than U+0009 (tab), U+000A (line feed),
U+0020 (space), and U+202x (bidi formatting characters) are treated
as characters to render in the same way as any normal character.
<span class="issue">Copied from CSS2.1 but this has got to be wrong.</span>
<h3 id="white-space-collapsing">
White Space Collapsing: the 'white-space-collapsing' property</h3>
<p class="issue">This section is still under discussion and may change in future drafts.</p>
<table class="propdef">
<tbody>
<tr>
<th>Name:</th>
<td><dfn>white-space-collapsing</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td>collapse | discard | [ [preserve | preserve-breaks] && trim-inner ]</td>
</tr>
<tr>
<th>Initial:</th>
<td>collapse</td>
</tr>
<tr>
<th>Applies to:</th>
<td>all elements</td>
</tr>
<tr>
<th>Inherited:</th>
<td>yes</td>
</tr>
<tr>
<th>Percentages:</th>
<td>N/A</td>
</tr>
<tr>
<th>Media:</th>
<td>visual</td>
</tr>
<tr>
<th>Computed&#160;value:</th>
<td>specified value</td>
</tr>
</tbody>
</table>
<p class="issue">Rename to white-space-trim or white-space-adjust? white-space-collapsing has an 'ing' and is confusing with XSL</p>
<p>This property declares whether and how
<a href="#white-space-processing">white space</a> inside the element is
collapsed. Values have the following meanings, which must be interpreted
according to the <a href="#white-space-rules">white space processing
rules</a>:</p>
<dl>
<dt><dfn title="white-space-collapsing:collapse"><code>collapse</code></dfn></dt>
<dd>This value directs user agents to collapse sequences of white space
into a single character (or <a href="#line-break-transform">in some
cases</a>, no character).</dd>
<dt><dfn title="white-space-collapsing:preserve"><code>preserve</code></dfn></dt>
<dd>This value prevents user agents from collapsing sequences
of white space. Line feeds are preserved as forced line breaks.</dd>
<dt><dfn title="white-space-collapsing:preserve-breaks"><code>preserve-breaks</code></dfn></dt>
<dd>This value collapses white space as for ''collapse'', but preserves
line feeds as forced line breaks.</dd>
<dt><dfn title="white-space-collapsing:discard"><code>discard</code></dfn></dt>
<dd>This value directs user agents to "discard" all white space in the
element.
<dt><dfn title="white-space-collapsing:trim-inner"><code>trim-inner</code></dfn></dt>
<dd>This value directs UAs to discard all whitespace at the beginning of
a block up to and including the last line feed before the first
non-white-space character in the block as well as to discard all white
space at the end of a block starting with the first line feed after
the last non-white-space character in the block.</dd>
</dl>
<h3 id="white-space-collapsing">
Tab Character Size: the 'tab-size' property</h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:</th>
<td><dfn>tab-size</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td>&lt;integer&gt;</td>
</tr>
<tr>
<th>Initial:</th>
<td>8</td>
</tr>
<tr>
<th>Applies to:</th>
<td>block containers</td>
</tr>
<tr>
<th>Inherited:</th>
<td>yes</td>
</tr>
<tr>
<th>Percentages:</th>
<td>N/A</td>
</tr>
<tr>
<th>Media:</th>
<td>visual</td>
</tr>
<tr>
<th>Computed&#160;value:</th>
<td>specified value</td>
</tr>
</tbody>
</table>
<p>This property determines the width of the tab character (U+0009),
in space characters (U+0020), when rendered. Only positive integers
are allowed.
<h3 id="white-space-rules">
The White Space Processing Rules</h3>
<p>For each inline (including anonymous inlines), white space
characters are handled as follows, ignoring bidi formatting
characters as if they were not there:</p>
<ul>
<li id="collapse"><p>If <span class="property">'white-space-collapsing'</span>
is set to 'collapse' or 'preserve-breaks', white space characters
are considered <dfn>collapsible</dfn> and are processed by
performing the following steps:</p>
<ol>
<li>All spaces and tabs immediately preceding or following a line
feed character are removed.</li>
<li>If <span class="property">'white-space-collapsing'</span> is not
'preserve-breaks', line feed characters are transformed for
rendering according to the <a href="#line-break-transform">line
break transformation rules</a>.
</li>
<li>Every tab (U+0009) is converted to a space (U+0020)</li>
<li>Any space (U+0020) following another collapsible space
(U+0020)&mdash;even a space before the inline&mdash;is removed.
However, if removing this space would eliminate a line breaking
opportunity in the text, that opportunity is still considered
to exist.</li>
</ol>
</li>
<li><p>If <span class="property">'white-space-collapsing'</span> is set to
'preserve', any sequence of spaces (U+0020) unbroken by an element
boundary is treated as a sequence of non-breaking spaces. However,
a line breaking opportunity exists at the end of the sequence.</p></li>
<li><p>If <span class="property">'white-space-collapsing'</span> is set to
'discard', the first white space character in every white space
sequence is converted to a zero width non-joiner (U+200C) and
the rest of the sequence is removed.</p>
</ul>
<p>Then, the entire block is rendered. Inlines are laid out, taking bidi
reordering into account, and wrapping as specified by the
<span class="property">'text-wrap'</span> property.</p>
<p>As each line is laid out,</p>
<ol>
<li>A sequence of collapsible spaces (U+0020) at the beginning of a
line is removed.</li>
<li>Each tab (U+0009) is rendered as a horizontal shift that lines up
the start edge of the next glyph with the next tab stop.
Tab stops occur at points that are multiples of the width of a
space (U+0020) rendered in the block's font from the block's
starting content edge. How many spaces is given by the 'tab-size'
property.</li>
<li>A sequence of collapsible spaces (U+0020) at the end of a line
is removed.</li>
<li>If spaces (U+0020) or tabs (U+0009) at the end of a line are
non-collapsible but have 'text-wrap' set to 'normal' or 'avoid'
the UA may visually collapse them.
</ol>
<div class="example">
<h4 id="egbidiwscollapse">
Example of bidirectionality with white space collapsing</h4>
<p>Consider the following markup fragment, taking special note of spaces
(with varied backgrounds and borders for emphasis and identification):
</p>
<pre><code>&lt;ltr&gt;A<span class="egbidiwsaA">&#160;</span>&lt;rtl&gt;<span class="egbidiwsbB">&#160;</span>B<span class="egbidiwsaB">&#160;</span>&lt;/rtl&gt;<span class="egbidiwsbC">&#160;</span>C&lt;/ltr&gt;</code></pre>
<p>where the <code>&lt;ltr&gt;</code> element represents a left-to-right
embedding and the <code>&lt;rtl&gt;</code> element represents a
right-to-left embedding. If the 'white-space-collapsing' property is set
to 'collapse', the above processing model would result in the
following:</p>
<ul style="line-height:1.3">
<li>The space before the B (<span class="egbidiwsbB">&#160;</span>)
would collapse with the space after the A (<span
class="egbidiwsaA">&#160;</span>).</li>
<li>The space before the C (<span class="egbidiwsbC">&#160;</span>)
would collapse with the space after the B (<span
class="egbidiwsaB">&#160;</span>).</li>
</ul>
<p>This would leave two spaces, one after the A in the left-to-right
embedding level, and one after the B in the right-to-left embedding
level. This is then ordered according to the Unicode bidirectional
algorithm, with the end result being:</p>
<pre>A<span class="egbidiwsaA">&#160;</span><span class="egbidiwsaB">&#160;</span>BC</pre>
<p>Note that there are two spaces between A and B, and none between B
and C. This is best avoided by putting spaces outside the element
instead of just inside the opening and closing tags and, where
practical, by relying on implicit bidirectionality instead of explicit
embedding levels.</p>
</div>
<h4 id="line-break-transform">
Line Break Transformation Rules</h4>
<p>When line feeds are <a href="#collapse">collapsible</a>, they are
either transformed into a space (U+0020) or removed depending on the
script context before and after the line break.</p>
<p class="note">Note that the white space processing rules have already
removed any tabs and spaces after the line feed before these checks
take place.</p>
<ul>
<li>If the character immediately before or immediately after the line
feed is the zero width space character (U+200B), then the line feed
is removed.
<li>Otherwise, if the script context on one 23A side of the line feed is
Hangul, then the line feed is converted to a space (U+0020).
<li>Otherwise, 10986 if the East Asian Width property [[!UAX11]] of both
the character before and after the line feed is F, W, or H (not A),
then the line feed is removed.
<li>Otherwise, if 'text-autospace' property is set to add extra spaces
for the combination of the character before the line feed and after,
then the line break is removed.
<li>Otherwise, the line feed is converted to a space (U+0020).
</ul>
<p class="issue">Comments on how well this would work in practice would
be very much appreciated, particularly from people who work with
Thai and similar scripts.</p>
<h4 id="white-space-summary">
Informative Summary of White Space Collapsing Effects</h4>
<ul>
<li>Consecutive white space collapses into a single space.
<li>A sequence of newlines and other white space between
two ideographic characters collapses into nothing unless
there is a space before the first newline in the sequence.
<li>A zero width space within a white space sequence containing
a newline causes the entire sequence of white space
to collapse into a zero width space.
</ul>
<h3 id="white-space">
White Space and Text Wrapping Shorthand: the 'white-space' property</h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:</th>
<td><dfn>white-space</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td>normal | pre | nowrap | pre-wrap | pre-line</td>
</tr>
<tr>
<th>Initial:</th>
<td>not defined for shorthand properties</td>
</tr>
<tr>
<th>Applies to:</th>
<td>all elements</td>
</tr>
<tr>
<th>Inherited:</th>
<td>yes</td>
</tr>
<tr>
<th>Percentages:</th>
<td>N/A</td>
</tr>
<tr>
<th>Media:</th>
<td>visual</td>
</tr>
<tr>
<th>Computed&#160;value:</th>
<td>see individual properties</td>
</tr>
</tbody>
</table>
<p>The 'white-space' property is a shorthand for the
<a href="#white-space-collapsing">'white-space-collapsing'</a>
and <a href="#text-wrap">'text-wrap'</a> properties.
Not all combinations are represented.
Values have the following meanings:</p>
<dl>
<dt><dfn title="white-space:normal"><code>normal</code></dfn></dt>
<dd>Sets 'white-space-collapsing' to 'collapse' and
'text-wrap' to 'normal'</dd>
<dt><dfn title="white-space:pre"><code>pre</code></dfn></dt>
<dd>Sets 'white-space-collapsing' to 'preserve' and
'text-wrap' to 'none'</dd>
<dt><dfn title="white-space:nowrap"><code>nowrap</code></dfn></dt>
<dd>Sets 'white-space-collapsing' to 'collapse' and
'text-wrap' to 'none'</dd>
<dt><dfn title="white-space:pre-wrap"><code>pre-wrap</code></dfn></dt>
<dd>Sets 'white-space-collapsing' to 'preserve' and
'text-wrap' to 'normal'</dd>
<dt><dfn title="white-space:pre-line"><code>pre-line</code></dfn></dt>
<dd>Sets 'white-space-collapsing' to 'preserve-breaks' and
'text-wrap' to 'normal'</dd>
</dl>
<p>The following informative table summarizes the behavior of various
'white-space' values:</p>
<table class="data">
<thead>
<tr>
<th></th>
<th>New Lines</th>
<th>Spaces and Tabs</th>
<th>Text Wrapping</th>
</tr>
</thead>
<tbody>
<tr>
<th>normal</th>
<td>Collapse</td>
<td>Collapse</td>
<td>Wrap</td>
</tr>
<tr>
<th>pre</th>
<td>Preserve</td>
<td>Preserve</td>
<td>No wrap</td>
</tr>
<tr>
<th>nowrap</th>
<td>Collapse</td>
<td>Collapse</td>
<td>No wrap</td>
</tr>
<tr>
<th>pre-wrap</th>
<td>Preserve</td>
<td>Preserve</td>
<td>Wrap</td>
</tr>
<tr>
<th>pre-line</th>
<td>Preserve</td>
<td>Collapse</td>
<td>Wrap</td>
</tbody>
</table>
<h2 id="line-breaking">
Line Breaking and Word Boundaries</h2>
<p>In most writing systems, in the absence of hyphenation a line break occurs
only at word boundaries. Many writing systems use spaces or
punctuation to explicitly separate words, and line break opportunities
can be identified by these characters. Scripts such as Thai, Lao, and
Khmer, however, do not use spaces or punctuation to separate words.
Although the zero width space (U+200B) can be used as an explicit word
delimiter in these scripts, this practice is not common. As a result,
a lexical resource is needed to correctly identify break points in such
texts.
<p>In several other writing systems, (including Chinese, Japanese, Yi,
and sometimes also Korean) a line break opportunity is based on
character boundaries, not word boundaries. In these systems a line can break
anywhere <em>except</em> between certain character combinations.
Additionally the level of strictness in these restrictions can vary
with the typesetting style.</p>
<p>CSS does not fully define where line breaking opportunities occur,
however some controls are provided to distinguish common variations.
<p class="note">Further information on line breaking conventions can be
found in
[[JIS4051]] for Japanese,
[[ZHMARK]] for Chinese, and [?] for Korean, and
in [[!UAX14]] for all scripts in Unicode.
<!-- The CSS Working Group notes that although UAX 14 contains a wealth of
information about line breaking conventions, a literal implementation
of its algorithm has been found to be inadequate in multiple situations. --></p>
<p class="issue">Any guidance for appropriate references here would be
much appreciated.</p>
<p class="issue">Information on line-breaking in the absence of dictionaries:
<a href="http://lists.w3.org/Archives/Public/www-style/2011Feb/0126.html">for Thai</a>
<p>Floated and absolutely-positioned elements do not introduce a line
breaking opportunity. The line breaking behavior of a replaced element
is equivalent to that of a Latin character.</p>
<p class="issue">It is not clear whether this section handles Southeast Asian
scripts well. Additionally, some guidance should be provided on how to
break or not break Southeast Asian in the absence of a dictionary.</p>
<h3 id="line-break">
Line Breaking Strictness: the 'line-break' property</h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:</th>
<td><dfn>line-break</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td>auto | loose | normal | strict</td>
</tr>
<tr>
<th>Initial:</th>
<td>auto</td>
</tr>
<tr>
<th>Applies to:</th>
<td>all elements</td>
</tr>
<tr>
<th>Inherited:</th>
<td>yes</td>
</tr>
<tr>
<th>Percentages:</th>
<td>N/A</td>
</tr>
<tr>
<th>Media:</th>
<td>visual</td>
</tr>
<tr>
<th>Computed&#160;value:</th>
<td>specified value</td>
</tr>
</tbody>
</table>
<p>This property specifies the strictness of line-breaking rules applied
within an element: particularly how line-breaking interacts with
punctuation. Values have the following meanings:</p>
<dl>
<dt><dfn title="line-break:auto"><code>auto</code></dfn></dt>
<dd>The UA determines the set of line-breaking restrictions to use,
and it may vary the restrictions based on the length of the line; e.g.,
use a less restrictive set of line-break rules for short lines.</dd>
<dt><dfn title="line-break:loose"><code>loose</code></dfn></dt>
<dd>Breaks text using the least restrictive set of line-breaking
rules. Typically used for short lines, such as in newspapers.</dd>
<dt><dfn title="line-break:normal"><code>normal</code></dfn></dt>
<dd>Breaks text using the most common set of line-breaking rules.</dd>
<dt><dfn title="line-break:strict"><code>strict</code></dfn></dt>
<dd>Breaks text using the most stringent set of line-breaking
rules.</dd>
</dl>
<p>CSS distinguishes between three levels of strictness in the rules for
implicit line breaking. The precise set of rules in effect for each
level is up to the UA and should follow language conventions. However,
this specification does recommend that:</p>
<ul>
<li>Following breaks be forbidden in ''strict'' line breaking and
allowed in ''normal'':
<ul>
<li>breaks before Japanese small kana
<li>breaks before the KATAKANA-HIRAGANA PROLONGED SOUND MARK (U+30FC)
</ul>
Additionally, if the language is known to be Chinese or Japanese,
breaks before hyphens (U+2010, U+2013, U+301C, U+30A0) may be allowed
in ''normal''.
<li>Following breaks be forbidden in ''normal'' and ''strict'' line
breaking and allowed in ''loose'':
<ul>
<li>breaks before iteration marks (U+3005, U+303B, U+309D, U+309E, U+30FD, U+30FE)</li>
<li>breaks between inseparatable characters (U+2014, U+2025, U+2026, U+3033, U+3034, U+3035)</li>
</ul>
If the language is known to be Chinese or Japanese, then additionally
the following breaks may be allowed in ''loose'':
<ul>
<li>breaks before middle dots (U+003A, U+003B, U+30FB, U+FF1A, U+FF1B, U+FF65)</li>
<li>breaks before dividing punctuation marks (U+0021, U+003F, U+203C, U+2047, U+2048, U+2049, U+FF01, U+FF1F)</li>
<li>breaks before postfixes (U+0025, U+00A2, U+00B0, U+2030, U+2032, U+2033, U+2103, U+FF05, U+FFE0)</li>
<li>breaks after prefixes (U+0024, U+00A3, U+00A5, U+20AC, U+2116, U+FF04, U+FFE1, U+FFE5)</li>
</ul>
</ul>
<h3 id="word-break">
Word Breaking Rules: the 'word-break' property</h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:</th>
<td><dfn>word-break</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td>normal | keep-all | break-all | keep-words</td>
</tr>
<tr>
<th>Initial:</th>
<td>normal</td>
</tr>
<tr>
<th>Applies to:</th>
<td>all elements</td>
</tr>
<tr>
<th>Inherited:</th>
<td>yes</td>
</tr>
<tr>
<th>Percentages:</th>
<td>N/A</td>
</tr>
<tr>
<th>Media:</th>
<td>visual</td>
</tr>
<tr>
<th>Computed&#160;value:</th>
<td>specified value</td>
</tr>
</tbody>
</table>
<p>This property specifies line break opportunities within words.
Values have the following meanings:</p>
<dl>
<dt><dfn title="word-break:normal"><code>normal</code></dfn></dt>
<dd>Break lines according to their usual rules.</dd>
<dt><dfn title="word-break:break-all"><code>break-all</code></dfn></dt>
<dd>Lines may break between any two grapheme clusters within words.
Hyphenation is not applied. This option is used mostly in a context where
the text is predominantly using CJK characters with few non-CJK excerpts
and it is desired that the text be better distributed on each line.</dd>
<dt><dfn title="word-break:keep-all"><code>keep-all</code></dfn></dt>
<dd><a href="#block-scripts">Block</a> characters can no longer create
implied break points. Otherwise this option is equivalent to
''normal''.
This option is mostly used where the presence of word separator
characters still creates line-breaking opportunities, as in Korean.</dd>
<dt><dfn title="word-break:keep-words"><code>keep-words</code></dfn></dt>
<dd>Lines may not break within words, even in