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

Latest commit

 

History

History
3188 lines (2854 loc) · 130 KB

File metadata and controls

3188 lines (2854 loc) · 130 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">
<p><a href="http://www.w3.org/"><img height="48" width="72" alt="W3C" src="http://www.w3.org/Icons/w3c_home"></a></p>
<h1>CSS Text Level 3</h1>
<h2 class="no-num no-toc">Editor's Draft $Date$</h2>
<!--
<h2 class="no-num no-toc">W3C Working Draft 6 March 2007</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/2007/WD-css3-text-20070306/">http://www.w3.org/TR/2007/WD-css3-text-20070306/</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/2007/WD-css3-text-20070306/">http://www.w3.org/TR/2007/WD-css3-text-20070306/</a></dd>
<dt>Editors:</dt>
<dd><a href="http://fantasai.inkedblade.net/contact">Elika J. Etemad</a></dd>
<dd><a href="mailto:paulnel@microsoft.com">Paul Nelson</a> (<a href="http://www.mic 5DBA rosoft.com/">Microsoft</a>)</dd>
</dl>
<p class="copyright"><a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">
Copyright</a> &copy; 2007 <a href="http://www.w3.org/"><abbr title="World
Wide Web Consortium">W3C</abbr></a><sup>&reg;</sup> (<a
href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of
Technology">MIT</abbr></a>, <a href="http://www.ercim.org/"><acronym
title="European Research Consortium for Informatics and
Mathematics">ERCIM</acronym></a>, <a
href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a
href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
and <a
href="http://www.w3.org/Consortium/Legal/copyright-documents">document
use</a> rules apply.</p>
<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">
<a name="TextLayout"></a>
<a name="text-layout"></a>
<a name="Progression"></a>
<a name="direction"></a>
<a name="block-progression"></a>
<a name="writing-mode"></a>
<a name="GlyphOrientation"></a>
<a name="glyph-orientation-vertical"></a>
<a name="glyph-orientation-horizontal"></a>
<a name="embedding"></a>
<a name="unicode-bidi"></a>
<a name="dtd"></a>
<a name="text-script-prop"></a>
<a name="conforming"></a>
<a name="min-max-font-size-prop"></a>
<a name="min-font-size"></a>
<a name="max-font-size"></a>
<a name="text-justify-trim-prop"></a>
<a name="text-justify-trim"></a>
<a name="kashida-prop"></a>
<a name="text-kashida-space"></a>
<a name="text-autospace-prop"></a>
<a name="text-autospace"></a>
<a name="kerning-props"></a>
<a name="kerning-mode"></a>
<a name="kerning-pair-threshold"></a>
<a name="document-grid"></a>
<a name="grid-introduction"></a>
<a name="line-grid-mode-prop"></a>
<a name="line-grid-mode"></a>
<a name="line-grid-progression-prop"></a>
<a name="line-grid-progression"></a>
<a name="line-grid-prop"></a>
<a name="line-grid"></a>
<a name="misc-text-formatting"></a>
<a name="caps-prop"></a>
<a name="text-transform"></a>
<a name="text-combine-prop"></a>
<a name="text-combine"></a>
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</a> at http://www.w3.org/TR/.</em></p>
<p>This Text module and a separate (upcoming) Text Layout module
replace and obsolete the <a href="http://www.w3.org/TR/2003/CR-css3-text-20030514/">May
2003 CSS3 Text Module Candidate Recommendation</a>. Since this is a
thorough overhaul of the previous version, a <a href="#changes">list
of changes</a> has been provided instead of a diff.</p>
<p>This document is a <strong>Working Draft</strong>, and it is still
very incomplete. In fact, <em>many of its sections have not
been added in</em>. <!--This draft has not been approved or endorsed by
the W3C or the CSS Working Group in any way and you may not use it
as a reference or cite it other than as a work in progress. It may
be updated, replaced or rendered obsolete at any time by subsequent
publications. --></p>
<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 a work in progress.</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>
(see <a href="http://www.w3.org/Mail/Request">instructions</a>) with
<kbd>[CSS3 Text]</kbd> in the subject line.</strong>
You are strongly encouraged to complain if you see something stupid
in this draft. I will do my best to respond to all feedback.</p>
<p><strong>If you have implemented properties from CSS3 Text CR</strong>
<em>please</em> let me know so I can take that into account as
I redraft the spec. You can post to
<a href="http://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>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/">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>). 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/Style/CSS/Disclosures" 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 accordance with <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the
W3C Patent Policy</a>.</p>
<p>The following features are at risk and may be cut from the spec during
its CR period: multiple text shadows, the 'text-outline' property, the
'break-strict' value of 'word-break'</p>
<h2 class="no-num no-toc" id="contents">Table of Contents</h2>
<!--begin-toc-->
<ul class="toc">
<li><a href="#intro"><span class="secno">1.</span> Introduction</a>
<li><a href="#conformance"><span class="secno">2.</span> Conformance</a>
<ul class="toc">
<li><a href="#partial-impl"><span class="secno">2.1.</span>
Partial and Experimental Implementations</a>
</ul>
<li><a href="#white-space-processing"><span class="secno">3.</span> White
Space Processing</a>
<ul class="toc">
<li><a href="#white-space-collapsing"><span class="secno">3.1.</span>
White Space Collapsing: the 'white-space-collapsing' property</a>
<li><a href="#white-space-rules"><span class="secno">3.2.</span> The
White Space Processing Rules</a>
<ul class="toc">
<li><a href="#egbidiwscollapse"><span class="secno">3.2.1.</span>
Example of bidirectionality with white space collapsing</a>
<li><a href="#line-break-transform"><span class="secno">3.2.2.</span>
Line Break Transformation Rules</a>
<li><a href="#white-space-summary"><span class="secno">3.2.3.</span>
Informative Summary of White Space Collapsing Effects</a>
</ul>
<li><a href="#white-space"><span class="secno">3.3.</span> White Space
and Text Wrapping Shorthand: the 'white-space' property</a>
</ul>
<li><a href="#line-breaking"><span class="secno">4.</span> Line Breaking
and Word Boundaries</a>
<ul class="toc">
<li><a href="#word-break"><span class="secno">4.1.</span> Line Breaking
Restrictions: the 'word-break' property</a>
<li><a href="#hyphenate"><span class="secno">4.2.</span> Hyphenation</a>
</ul>
<li><a href="#wrapping"><span class="secno">5.</span> Text Wrapping</a>
<ul class="toc">
<li><a href="#text-wrap"><span class="secno">5.1.</span> Text Wrap
Settings: the 'text-wrap' property</a>
<ul class="toc">
<li><a href="#example-suppress"><span class="secno">5.1.1.</span>
Example of using 'text-wrap: suppress' in presenting a
footer</a>
</ul>
<li><a href="#word-wrap"><span class="secno">5.2.</span> Force Wrapping:
the 'word-wrap' property</a>
</ul>
<li><a href="#justification"><span class="secno">6.</span> Alignment and
Justification</a>
<ul class="toc">
<li><a href="#text-align"><span class="secno">6.1.</span> Text
Alignment: the 'text-align' property</a>
<li><a href="#text-align-last"><span class="secno">6.2.</span> Last Line
Alignment: the 'text-align-last' property</a>
<li><a href="#text-justify"><span class="secno">6.3.</span>
Justification Method: the 'text-justify' property</a>
</ul>
<li><a href="#spacing"><span class="secno">7.</span> Spacing</a>
<ul class="toc">
<li><a href="#word-spacing"><span class="secno">7.1.</span> Word
Spacing: the 'word-spacing' property</a>
<li><a href="#letter-spacing"><span class="secno">7.2.</span> Tracking:
the 'letter-spacing' property</a>
<li><a href="#punctuation-trim"><span class="secno">7.3.</span>
Fullwidth Punctuation Kerning: the 'punctuation-trim' property</a>
</ul>
<li><a href="#decoration"><span class="secno">8.</span> Text Decoration</a>
<ul class="toc">
<li><a href="#line-decoration"><span class="secno">8.1.</span>
Line Decoration: Underline, Overline, and Strike-Through</a>
<ul class="toc">
<li><a href="#text-decoration-line"><span class="secno">8.1.1</span>
Text Decoration Lines: the 'text-decoration-line' property</a>
<li><a href="#text-decoration-color"><span class="secno">8.1.2</span>
Text Decoration Color: the 'text-decoration-color' property</a>
<li><a href="#text-decoration-style"><span class="secno">8.1.3</span>
Text Decoration Style: the 'text-decoration-style' property</a>
<li><a href="#text-decoration"><span class="secno">8.1.4</span>
Text Decoration Shorthand: the 'text-decoration' property</a>
<li><a href="#text-decoration-skip"><span class="secno">8.1.5</span>
Text Decoration Line Continuity: the 'text-decoration-skip' property</a>
<li><a href="#text-underline-position"><span class="secno">8.1.6</span>
Text Underline Position: the 'text-underline-position' property</a>
</ul>
<li><a href="#text-emphasis"><span class="secno">8.2.</span>
Emphasis Marks: the 'text-emphasis' property</a>
<li><a href="#text-shadow"><span class="secno">8.3.</span> Text Shadows:
the 'text-shadow' property</a>
<li><a href="#text-outline"><span class="secno">8.4.</span> Text Outlines:
the 'text-outline' property</a>
</ul>
<li><a href="#edge-effects"><span class="secno">9.</span> Edge Effects</a>
<ul class="toc">
<li><a href="#text-indent"><span class="secno">9.1</span> First Line
Indentation: the 'text-indent' property</a>
<li><a href="#hanging-punctuation"><span class="secno">9.2</span>
Hanging Punctuation: the 'hanging-punctuation' property</a>
<li><a href="#text-overflow">Overflow Ellipsis: the 'text-overflow' property</a>
</ul>
<li><a href="#changes"><span class="secno">10</span>
Changes from the May 2003 CSS3 Text CR</a>
<li><a href="#recent-changes"><span class="secno">11</span>
Changes from the June 2005 CSS3 Text WD</a>
<li><a href="#acknowledgements"><span class="secno">12</span>
Acknowledgements</a>
<li><a href="#references"><span class="secno">13.</span> References</a>
<ul class="toc">
<li><a href="#normative-ref"><span class="secno">13.1.</span> Normative
References</a>
<li><a href="#informative-ref"><span class="secno">13.2.</span>
Informative References</a>
</ul>
</ul>
<!--end-toc-->
<h2 id="intro"><span class="secno">1.</span>
Introduction</h2>
<p>[document here]</p>
<h2 id="conformance"><span class="secno">2.</span>
Conformance</h2>
<p>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 (see
<a href="#RFC2119">[RFC2119]</a>). However, for readability, these words
do not typically appear in all uppercase letters in this specification.</p>
<p>Additional key words, e.g. "User agent (UA)", are defined by CSS 2.1
(<a href="#CSS21">[CSS21]</a>, section 3.1).
<h3 id="partial-impl"><span class="secno">2.1.</span> 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="white-space-processing"><span class="secno">3.</span>
White Space Processing</h2>
<p>White space processing in CSS interprets white space characters
for rendering: it has no effect on the underlying document data.
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),
or line break characters (defined by the document format: typically
line feed, U+000A). Control characters besides the white space
characters and the bidi formatting characters (U+202x) are treated as
normal characters and rendered according to the same rules.
<p>The document parser must normalize line break character sequences
according to its own format rules before CSS processing takes effect.
However, in generated content strings the line feed character (U+000A)
and only the line feed character is considered a line break sequence.
For CSS white space processing all line breaks must be normalized to a
single character representation&#8212;usually the line feed character
(U+000A)&#8212;here called a "line break". This way, all recognized
line breaks are treated the same and style rules behave consistently
across systems.</p>
<p class="note">Note that the document parser may have not only normalized
line break characters, 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>
<h3 id="white-space-collapsing"><span class="secno">3.1.</span>
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 breaks are preserved.</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 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 break 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 break after
the last non-white-space character in the block.</dd>
</dl>
<h3 id="white-space-rules"><span class="secno">3.2.</span>
The White Space Processing Rules</h3>
<p>Any text that is directly contained inside a block (not inside
an inline) is treated as being inside an anonymous inline element.</p>
<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 non-line-break white space characters immediately following
a line break character are removed. (This has the effect of
discarding all white space at the start of a line but preserving
a trailing space if one exists at the end.)</li>
<li>If <span class="property">'white-space-collapsing'</span> is not
'preserve-breaks', line break 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 space (U+0020)&mdash;even
a space before the inline, if that space is also collapsible&mdash;is
removed.</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>A 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 8 times the width
of a space (U+0020) rendered in the block's font from the block's
starting content edge.</li>
<li>A sequence of collapsible spaces (U+0020) or ideographic spaces
(U+3000) 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 'suppress'
the UA may visually collapse them.
</ol>
<div class="example">
<h4 id="egbidiwscollapse"><span class="secno">3.2.1.</span>
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"><span class="secno">3.2.2.</span>
Line Break Transformation Rules</h4>
<p>When line breaks 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>The script context is determined by the Unicode-given script value
[UAX24] of the first character that side of the line break. However,
characters such as punctuation that belong to the COMMON and INHERITED
scripts are ignored in this check; the next character is examined
instead. The UA must not examine characters outside the block and may
limit its examination to as few as four characters on each side of the
line break. If the check fails to find an acceptable script value
(i.e. it has hit the check limits), then the script context is neutral.</p>
<ul>
<li>If the character immediately before or immediately after the line
break is the zero width space character (U+200B), then the line break
is removed.
<li>Otherwise, if the script context on one side of the line break is
Han, Yi, Hiragana, or Katakana and the context on the other side is
Han, Yi, Hiragana, Katakana, or neutral, then the line break is removed.
<li>Otherwise, the line break 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"><span class="secno">3.2.3.</span>
Informative Summary of White Space Collapsing Effects</h4>
<ul>
<li>Consecutive white space collapses into a single space.
<li>A sequence of line breaks and other white space between
two ideographic characters collapses into nothing unless
there is a space before the first line break in the sequence.
<li>A zero width space immediately before or anywhere after
a line break causes the entire sequence of white space
beginning with the line break to collapse into a zero width
space.
</ul>
<h3 id="white-space"><span class="secno">3.3.</span>
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 22D5 >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 8096 ="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"><span class="secno">4.</span>
Line Breaking and Word Boundaries</h2>
<p>For most scripts, 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 opportunities are based on
syllable boundaries, not words. 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 class="issue">Specify that out-of-flow elements do not introduce line
breaking opportunities. Specify whether images introduce line breaking
opportunities. Specify that CSS3 Text does not otherwise specify line
breaking opportunities.</p>
<h3 id="word-break"><span class="secno">4.1.</span>
Line Breaking Restrictions: the 'word-break' property</h3>
<p>CSS distinguishes between two levels of strictness in the rules for
implicit line breaking in CJK text. The precise set of rules in effect
for the strict and loose levels is up to the UA and should follow
language conventions. However, this specification does recommend that
the following breaks be forbidden in strict line breaking and allowed
in loose:</p>
<ul>
<li>breaks before Japanese small kana
<li>breaks before Japanese iteration marks (U+3005, U+303B, U+309D, U+309E, U+30FD, U+30FE)
<li>breaks before the katakana lengthening mark (U+30FC)
<li class="issue">???
</ul>
<p>Breaks between Hangul syllable blocks are allowed in both strict and
loose rules: to restrict breaks in Korean to spaces, the 'keep-all'
value of 'word-break' can be specified.</p>
<p class="note">Information on line breaking conventions can be found in
[<a href="#JIS4051">JIS4051</a>] for Japanese,
[<a href="#ZHMARK">标点符号</a>] for Chinese, and [?] for Korean, and
in [<a href="#UAX14">UAX14</a>] 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>
<table class="propdef">
<tbody>
<tr>
<th>Name:</th>
<td><dfn>word-break</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td>normal | keep-all | loose | break-strict | break-all</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 what set of line breaking restrictions are in
effect within the element.
Values have the following meanings:</p>
<dl>
<dt><dfn title="word-break:normal"><code>normal</code></dfn></dt>
<dd>Breaks non-CJK scripts according to their own rules while using a
strict set of line breaking restrictions for CJK scripts (Hangul,
Japanese Kana, and CJK ideographs).</dd>
<dt><dfn title="word-break:keep-all"><code>keep-all</code></dfn></dt>
<dd>Same as 'normal' for all non-CJK scripts. However, sequences of
CJK characters can no longer break on implied break points.
This option should only be used where the presence of white space
characters still creates line-breaking opportunities, as in Korean.</dd>
<dt><dfn title="word-break:loose"><code>loose</code></dfn></dt>
<dd>As for 'normal', but CJK scripts use a less restrictive set of
line-breaking restrictions.</dd>
<dt><dfn title="word-break:break-strict"><code>break-strict</code></dfn></dt>
<dd>Same as 'normal' for CJK scripts, but non-CJK scripts can break
anywhere. This option is used mostly when the text is predominantly
CJK characters with few non-CJK excerpts and it is desired that
the text be more evenly distributed on each line.</dd>
<dt><dfn title="word-break:break-all"><code>break-all</code></dfn></dt>
<dd>As for 'break-strict', except CJK scripts break according to the
rules for 'loose'.</dd>
</dl>
<p>When shaping scripts such as Arabic are allowed to break within words
due to 'break-all' or 'break-strict', the characters must still be
shaped as if the word were not broken.</p>
<h3 id="hyphenate"><span class="secno">4.2.</span>
Hyphenation</h3>
<div class="issue">
<p>The definition of the hyphenation feature is very much up-in-the-air
at the moment. The WG plans to discuss it at our next face-to-face
meeting at the end of March. Comments and suggestions for consideration
are welcome.</p>
<p>Some of the syntax proposals so far are to
<ul>
<li>Have a boolean 'hyphenate' property that turns hyphenation on or
off, and have separate properties for advanced controls such as
limits on the number of characters before/after the break and the
number of consecutive hyphens allowed.
<li>Add a 'hyphenate' value to the 'word-break' property that turns
hyphenation on, and have separate properties for the advanced
controls.
<li>Make 'hyphenate' a shorthand for the advanced controls, such that
either 'hyphenate: auto' or 'hyphenate: 2 2 3' and similar would
turn hyphenation on.
</ul>
<p>A current proposal for advanced hyphenation controls is published
in the <a href="http://www.w3.org/TR/2007/WD-css3-gcpm-20070205/#hyphenation">Generated
Content for Paged Media</a> draft.</p>
</div>
<dl>
<dt><var>insert value name here</var></dt>
<dd>Words may be broken at an appropriate hyphenation point. This requires
that the user agent have an hyphenation resource appropriate to the
language of the text being broken.
</dl>
<p>If hyphenation is applied to a shaped script such as Arabic then the
shaping process must ignore the hyphenation break and shape as if the
word were still whole and unhyphenated.</p>
<h2 id="wrapping"><span class="secno">5.</span>
Text Wrapping</h2>
<p>Text wrapping is controlled by the 'text-wrap' and 'word-wrap' properties:</p>
<h3 id="text-wrap"><span class="secno">5.1.</span>
Text Wrap Settings: the 'text-wrap' property</h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:</th>
<td><dfn>text-wrap</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td>normal | unrestricted | none | suppress</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 the mode for text wrapping. Possible values:</p>
<dl>
<dt><dfn title="text-wrap:normal"><code>normal</code></dfn></dt>
<dd>Lines may break at allowed break points, as determined by the
line-breaking rules in effect. Line breaking behavior defined
for the WJ, ZW, and GL line-breaking classes in
[<a href="#UAX14">UAX14</a>] must be honored.
<dt><dfn title="text-wrap:none"><code>none</code></dfn></dt>
<dd>Lines may not break; text that does not fit within the block box
overflows it.</dd>
<dt><dfn title="text-wrap:unrestricted"><code>unrestricted</code></dfn></dt>
<dd>Lines may break between any two grapheme clusters. Line-breaking
restrictions have no effect and hyphenation does not take place.
Character shaping is performed on each side of the break as if
the break had not occurred.</dd>
<dt><dfn title="text-wrap:suppress"><code>suppress</code></dfn></dt>
<dd>Line breaking is suppressed within the element: the UA may only break
within the element if there are no other valid break points in the
line. If the text breaks, line-breaking restrictions are honored as for
'normal'.
</dl>
<p>For all values, line-breaking behavior defined for the BK, CR, LF, CM
NL, and SG line breaking classes in [<a href="#UAX14-norm">UAX14</a>] must
be honored.</p>
<p>When <span class="property">'text-wrap'</span> is set to 'normal' or
'suppress', UAs that allow breaks at punctuation other than spaces
should prioritize breakpoints.
For example, if breaks after slashes have a lower priority than spaces,
the sequence "check /etc" will never break between the '/' and the 'e'.
The UA may use the width of the containing block, the text's language,