Skip to content

Commit dcef922

Browse files
committed
[css2] Bidi fixes based on Martin comments in msg 0274
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%401077
1 parent 7abc099 commit dcef922

1 file changed

Lines changed: 51 additions & 36 deletions

File tree

css2/visuren.src

Lines changed: 51 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
22
<html lang="en">
3-
<!-- $Id: visuren.src,v 2.19 1998-02-21 04:36:09 ijacobs Exp $ -->
3+
<!-- $Id: visuren.src,v 2.20 1998-02-23 21:25:00 ijacobs Exp $ -->
44
<HEAD>
55
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
66
<TITLE>Visual rendering model</TITLE>
@@ -984,8 +984,8 @@ semantics of the <a href="conform.html#doclanguage">document
984984
language</a>, these properties should in most cases be used only by
985985
designers of document type descriptions (DTDs), or authors of special
986986
documents. A typical exception would be to override bidi behavior in
987-
a user agent if that user agent translates Yiddish to Latin
988-
letters at the user's request.
987+
a user agent if that user agent transliterates Yiddish (usually
988+
written with Hebrew letters) to Latin letters at the user's request.
989989

990990
<P>If a document contains right-to-left characters, and if the user
991991
agent displays these characters (with appropriate glyphs, not
@@ -1077,7 +1077,13 @@ as value either 'embed' or 'override'.
10771077

10781078

10791079
<p>The following example shows an XML document with bidirectional
1080-
text.</p>
1080+
text. It illustrates an important design principle: <span
1081+
class="index-inst" title="DTD">DTD</span> designers should take bidi
1082+
into account both in the language proper (elements and attributes) and
1083+
in any accompanying style sheets. The style sheets should be designed
1084+
so that bidi rules are separate from other style rules. The bidi rules
1085+
should not be overridden by other style sheets so that the language's
1086+
bidi behavior is preserved.
10811087

10821088
<div class="example"><P>
10831089
In this example,
@@ -1097,15 +1103,16 @@ uppercase letters represent inherently right-to-left characters:
10971103
</pre>
10981104

10991105
<p>Since this is XML, the style sheet is responsible for setting the
1100-
writing direction. (Another possibility is to use the Unicode
1101-
characters LRE, RTF, PDF, in the text.) This is the style sheet:</p>
1106+
writing direction. This is the style sheet:</p>
11021107

11031108
<pre class="example">
1104-
HEBREW {display: block; direction: rtl}
1105-
ENGLISH {display: block; direction: ltr}
1106-
PAR {display: block}
1107-
EMPH {font-weight: bold}
1108-
HE-QUO {direction: rtl; unicode-bidi: embed}
1109+
/* Rules for bidi */
1110+
HEBREW, HE-QUO {direction: rtl; unicode-bidi: embed}
1111+
ENGLISH {direction: ltr; unicode-bidi: embed}
1112+
1113+
/* Rules for presentation */
1114+
HEBREW, ENGLISH, PAR {display: block}
1115+
EMPH {font-weight: bold}
11091116
</pre>
11101117

11111118
<p>The HEBREW element is a block with a right-to-left base direction,
@@ -1161,9 +1168,18 @@ english17 18WERBEH
11611168
<p>Because HEBREW18 must be read before english19, it is on the line
11621169
above english19. Just breaking the long line from the earlier
11631170
rendering would not have worked. Note also that the first syllable
1164-
from english19 might have fit on the previous line, but one cannot
1165-
hyphenate left-to-right words in a left-to-right context, and vice
1166-
versa.
1171+
from english19 might have fit on the previous line, but hyphenation of
1172+
left-to-right words in a right-to-left context, and vice versa, is
1173+
usually suppressed to avoid having to display a hyphen in the middle
1174+
of a line.
1175+
1176+
<P>Note that the default style sheet "states" that the HEWBREW, HE-QUO,
1177+
and ENGLISH elements all create embeddings. This bidi behavior
1178+
should be preserved even if a user decides to change 'display: inline'
1179+
for these elements. The rules that specify 'unicode-bidi: embed'
1180+
achieve this as long as they are not overridden by user rules.
1181+
1182+
<!-- Should we "enforce" this with !important in the example? -IJ -->
11671183

11681184
</div><!-- example -->
11691185

@@ -1173,36 +1189,35 @@ versa.
11731189
determines the direction of several types of flow:</p>
11741190

11751191
<ol>
1176-
<li>When set for an <a href="#inline">inline</a>
1177-
element or <a href="#block-level">block-level</a> element,
1178-
it specifies the base writing direction of inline
1179-
text generated by the element.
1180-
<li>When set for an <a href="#inline">inline</a>
1181-
element, it specifies the direction that generated inline
1182-
boxes will flow into line boxes.
1183-
<li>When set for a <a href="#block-level">block-level</a>
1184-
element, it specifies the direction that descendant
1185-
inline and anonymous boxes will flow into line boxes.
1186-
<li>When set for a <a href="tables.html">table</a>
1187-
element, it specifies the direction of table layout.
1188-
<li>It specifies the direction that a <a
1189-
href="visudet.html#containing-block">containing block</a> will grow
1190-
in certain cases of content
1192+
<li>When set for a block-level element, it specifies the base writing
1193+
direction of inline text generated by the element. It also
1194+
determines the position of an incomplete last line in a block
1195+
in case of 'text-align: justify'.
1196+
1197+
<li> When set for an inline element, in coordination with a value of
1198+
'embed' or 'bidi-override' for the <span
1199+
class="propinst-unicode-bidi">'unicode-bidi'</span> property, it
1200+
specifies an additional embedding level.
1201+
1202+
<li> When set for a table element, it specifies the direction of table
1203+
layout.
1204+
1205+
<li> It specifies the direction that a containing block will grow in
1206+
certain cases of content (i.e. overflow).
11911207
</ol>
11921208

11931209
<P>In order to ensure the proper application of the bidirectional
1194-
algorithm, all inline boxes within the same containing block must flow
1195-
in the same direction (be that left-to-right or right-to-left). Even
1196-
if a block of text contains text in both directions, inline boxes flow
1197-
in the direction specified for the containing block. In an inline
1198-
formatting context, non-textual entities such as images are treated as
1199-
neutral characters, unless they are included by an element whose <span
1210+
algorithm, inline boxes (including anonymous inline boxes) must be
1211+
constructed, split up if necessary, and flowed so that the final order
1212+
of the characters on each line conforms to the Unicode bidirectional
1213+
algorithm. This means that left-to-right flow and right-to-left flow
1214+
can occur within the same element. Non-textual entities such as images
1215+
are treated as neutral characters, unless their <span
12001216
class="propinst-unicode-bidi">'unicode-bidi'</span> property has a
12011217
value other than 'normal', in which case they are treated as strong
12021218
characters in the <span class="propinst-direction">'direction'</span>
12031219
specified for the element.
12041220

1205-
12061221
<div class="bidi-example"><P>
12071222
For instance, suppose that in the middle
12081223
of a paragraph of Hebrew (right-to-left) text, we

0 commit comments

Comments
 (0)