@@ -2007,37 +2007,65 @@ <h3 id=logical-directions><span class=secno>6.2. </span> Flow-relative
20072007 < h3 id =line-directions > < span class =secno > 6.3. </ span > Line-relative
20082008 Directions</ h3 >
20092009
2010- < p > The < dfn id =line-relative-directions > line-relative directions</ dfn > < a
2011- href ="#over "> < i > over</ i > </ a > , < a href ="#under "> < i > under</ i > </ a > , < a
2012- href ="#line-left "> < i > line-left</ i > </ a > , and < a
2013- href ="#line-right "> < i > line-right</ i > </ a > are defined relative to the < dfn
2014- id =line-orientation > line orientation</ dfn > , which is given by a
2015- combination of ‘< a href ="#text-orientation0 "> < code
2010+ < p > The < dfn id =line-orientation > line orientation</ dfn > determines which
2011+ side of a line box is the logical “top” (ascender side). It is given
2012+ by a combination of ‘< a href ="#text-orientation0 "> < code
20162013 class =property > text-orientation</ code > </ a > ’ and ‘< a
20172014 href ="#writing-mode1 "> < code class =property > writing-mode</ code > </ a > ’.
2018- The < a href ="#line-orientation "> < i > line orientation</ i > </ a > determines
2019- which side of the line is the “top” and thus which sides are
2020- < dfn id =under > under</ dfn > (ascender side) and < dfn id =over > over</ dfn >
2021- (descender side) the line. The < i > line orientation< i > also affects the
2022- interpretation of alignment (‘< code
2023- class =property > vertical-align</ code > ’) in the transverse dimension
2024- of the line. </ i > </ i >
2025-
2026- < p > In addition to its < a href ="#over "> < i > over</ i > </ a > and < a
2027- href ="#under "> < i > under</ i > </ a > sides, a line box, even a
2028- vertically-oriented one, also has a "left" and "right" side, which we will
2029- call the < a href ="#line-left "> < i > line-left</ i > </ a > and < a
2030- href ="#line-right "> < i > line-right</ i > </ a > sides of the box (as distinct
2031- from the physical left and physical right sides of the box). The < dfn
2032- id =line-left > line-left</ dfn > side of a box is nominally the side from
2033- which < abbr title =left-to-right > LTR</ abbr > text would start. The < dfn
2034- id =line-right > line-right</ dfn > side of a box is nominally the side from
2035- which < abbr title =right-to-left > RTL</ abbr > text would start. Depending on
2036- the ‘< a href ="#writing-mode1 "> < code
2037- class =property > writing-mode</ code > </ a > ’ and ‘< a
2038- href ="#text-orientation0 "> < code
2039- class =property > text-orientation</ code > </ a > ’ properties, the
2040- line-left side of a box correspond to the physical left, top, or bottom.
2015+ Usually the line-relative “top” corresponds to the < a
2016+ href ="#before "> < i > before</ i > </ a > side, but this is not always the case: in
2017+ Mongolian typesetting (and thus by default in ‘< a
2018+ href ="#vertical-lr "> < code class =css > vertical-lr</ code > </ a > ’ writing
2019+ modes), the line-relative “top” corresponds to the < a
2020+ href ="#after "> < i > after</ i > </ a > side. Hence the need for distinct
2021+ terminology.
2022+
2023+ < div class =figure > < img alt ="Mongolian mixed with English "
2024+ src =mongolian-lr.jpg >
2025+ < p class =caption > A primarily Mongolian document, such as the one above, is
2026+ written in vertical lines stacking left to right, but lays its Latin text
2027+ with the tops of the glyphs towards the right. This makes the text run in
2028+ the same inline direction as Mongolian (top-to-bottom) and face the same
2029+ direction it does in other East Asian layouts (which have vertical lines
2030+ stacking right to left), but the glyphs' tops are facing the bottom of
2031+ the line stack rather than the top, which in an English paragraph would
2032+ be upside-down.
2033+ </ div >
2034+
2035+ < p > In addition to a line-relative “top” and “bottom” to map things
2036+ like ‘< code class =css > vertical-align: top</ code > ’, CSS also
2037+ needs to refer to a line-relative “left” and “right” in order to
2038+ map things like ‘< code class =css > text-align: left</ code > ’.
2039+ Thus there are four < dfn id =line-relative-directions > line-relative
2040+ directions</ dfn > , which are defined relative to the < a
2041+ href ="#line-orientation "> < i > line orientation</ i > </ a > as follows:
2042+
2043+ < dl >
2044+ < dt > < dfn id =over > over</ dfn >
2045+
2046+ < dd > Nominally the side that corresponds to the ascender side or “top”
2047+ side of a line box. (The side overlines are typically drawn on.)
2048+
2049+ < dt > < dfn id =under > under</ dfn >
2050+
2051+ < dd > Opposite of < a href ="#over "> < i > over</ i > </ a > : the line-relative
2052+ “bottom” or descender side. (The side underlines are typically drawn
2053+ on.)
2054+
2055+ < dt > < dfn id =line-left > line-left</ dfn >
2056+
2057+ < dd > Nominally the side from which < abbr title =left-to-right > LTR</ abbr >
2058+ text would start.
2059+
2060+ < dt > < dfn id =line-right > line-right</ dfn >
2061+
2062+ < dd > Nominally the side from which < abbr title =right-to-left > RTL</ abbr >
2063+ text would start. (Opposite of < a
2064+ href ="#line-left "> < i > line-left</ i > </ a > .)
2065+ </ dl >
2066+
2067+ < p > See the < a href =logical-to-physical > table below</ a > for the exact
2068+ mappings between physical and line-relative directions.
20412069
20422070 < div class =figure > < a href ="diagrams/line-orient-up.svg "
20432071 type ="image/svg+xml "> < img alt ="Line orientation compass " class =landscape
@@ -2061,14 +2089,6 @@ <h3 id=line-directions><span class=secno>6.3. </span> Line-relative
20612089 </ div >
20622090 </ div >
20632091
2064- < p class =note > Note also that while the < a href ="#over "> < i > over</ i > </ a > and
2065- < a href ="#under "> < i > under</ i > </ a > directions often map to the same
2066- directions as < a href ="#before "> before</ a > and < a href ="#after "> after</ a >
2067- respectively, this mapping is reversed for some combinations of ‘< a
2068- href ="#writing-mode1 "> < code class =property > writing-mode</ code > </ a > ’
2069- and ‘< a href ="#text-orientation0 "> < code
2070- class =property > text-orientation</ code > </ a > ’.
2071-
20722092 < h3 id =logical-to-physical > < span class =secno > 6.4. </ span >
20732093 Abstract-to-Physical Mappings</ h3 >
20742094
0 commit comments