Skip to content

Commit c40da8f

Browse files
committed
Rewrite of position:marker to be more correct and handle differing writing-modes properly.
1 parent b5fcf53 commit c40da8f

2 files changed

Lines changed: 51 additions & 40 deletions

File tree

css3-lists/Overview.html

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,20 +1152,14 @@ <h3 id=position-marker><span class=secno>7.1. </span> The &lsquo;<code
11521152
href="http://www.w3.org/TR/CSS21/visuren.html#absolutely-positioned">absolutely
11531153
positioned</a>.
11541154

1155-
<p>The element's vertical position is calculated according to the <a
1156-
href="http://www.w3.org/TR/CSS21/visuren.html#normal-flow">normal
1157-
flow</a>. <span class=note>In the Positioned Layout Module this will be
1158-
defined more precisely in terms of placeholders.</span>
1159-
1160-
<p>To calculate the element's horizontal position, we must first define a
1161-
few terms:
1155+
<p>To calculate the marker's position, we must first define a few terms:
11621156

11631157
<dl>
11641158
<dt><dfn id=ancestor-list-item
11651159
title="ancestor list item|ancestor list item's">ancestor list item</dfn>
11661160

11671161
<dd>The <a href="#ancestor-list-item"><i>ancestor list item</i></a> is the
1168-
marker's nearest list item ancestor.
1162+
marker's nearest list item ancestor element.
11691163

11701164
<dt><dfn id=marker-positioning-reference-element>marker positioning
11711165
reference element</dfn>
@@ -1189,33 +1183,46 @@ <h3 id=position-marker><span class=secno>7.1. </span> The &lsquo;<code
11891183
href="#marker-positioning-reference-element"><i>marker positioning
11901184
reference element</i></a> is the <a
11911185
href="#ancestor-list-item"><i>ancestor list item</i></a>.</p>
1186+
1187+
<dt><dfn id=list-item-positioning-edge>list item positioning edge</dfn>
1188+
1189+
<dd>The border edge of the <a href="#ancestor-list-item"><i>ancestor list
1190+
item</i></a> corresponding to the "start" or "before" edge of the <a
1191+
href="#marker-positioning-reference-element"><i>marker positioning
1192+
reference element</i></a>, whichever is in the <a
1193+
href="#ancestor-list-item"><i>ancestor list item's</i></a> inline axis.
1194+
1195+
<dt><dfn id=marker-positioning-edge>marker positioning edge</dfn>
1196+
1197+
<dd>The opposing edge relative to the <a
1198+
href="#list-item-positioning-edge"><i>list item positioning edge</i></a>
1199+
on the marker's margin box. For example, if the <i>list item positioning
1200+
edge ended up being the left border edge of the <a
1201+
href="#ancestor-list-item"><i>ancestor list item</i></a>, the <a
1202+
href="#marker-positioning-edge"><i>marker positioning edge</i></a> would
1203+
be the right margin edge of the marker.</i>
11921204
</dl>
11931205

1194-
<p>The element's horizontal position must then be set such that the
1195-
element's margin edge that corresponds to the "end" edge of the <a
1196-
href="#marker-positioning-reference-element"><i>marker positioning
1197-
reference element</i></a> is flush with the <a
1198-
href="#ancestor-list-item"><i>ancestor list item's</i></a> border edge
1199-
that corresponds to the "start" edge of the <a
1200-
href="#marker-positioning-reference-element"><i>marker positioning
1201-
reference element</i></a>.
1206+
<p>The marker's position in the <a href="#ancestor-list-item"><i>ancestor
1207+
list item's</i></a> block axis is calculated according to the <a
1208+
href="http://www.w3.org/TR/CSS21/visuren.html#normal-flow">normal
1209+
flow</a>. <span class=note>In the Positioned Layout Module this will be
1210+
defined more precisely in terms of placeholders.</span>
1211+
1212+
<p>The marker's position in the <a href="#ancestor-list-item"><i>ancestor
1213+
list item's</i></a> inline axis must be set such that the <a
1214+
href="#marker-positioning-edge"><i>marker positioning edge</i></a> is
1215+
flush with the <a href="#list-item-positioning-edge"><i>list item
1216+
positioning edge</i></a>.
12021217

12031218
<p class=note>The purpose of this somewhat convoluted definition is to
12041219
position the marker flush against its list item, and then when
12051220
"marker-attachment:list-container", keep all the markers for a given list
12061221
on the same side of their list items even in mixed-direction text, so that
12071222
authors can specify padding on only one side and still ensure their
1208-
markers are visible.
1209-
1210-
<p class=issue>This handles ltr/rtl mixed-direction text, but not mixed
1211-
horizontal and vertical text. For example, if the <i>ancestor list
1212-
container</i> is vertical but the <a
1213-
href="#ancestor-list-item"><i>ancestor list item</i></a> is horizontal,
1214-
this definition is nonsensical, as it requires a vertical edge of the
1215-
marker to be flush against a horizontal edge of the <a
1216-
href="#ancestor-list-item"><i>ancestor list item</i></a>. Need to think on
1217-
what UI would be acceptable for such a crazy case, and how to state it in
1218-
non-crazy terms.
1223+
markers are visible. And on top of all that, do something sane in the face
1224+
of potentially differing writing-modes on the marker, list item, and
1225+
container.
12191226

12201227
<p>All elements or pseudo-elements with <code
12211228
class=css>"position:marker"</code> that share a common <a
@@ -5045,6 +5052,9 @@ <h2 class=no-num id=index>Index</h2>
50455052
<li>list item, <a href="#list-item"
50465053
title="list item"><strong>2.</strong></a>
50475054

5055+
<li>list item positioning edge, <a href="#list-item-positioning-edge"
5056+
title="list item positioning edge"><strong>7.1.</strong></a>
5057+
50485058
<li>list-style, <a href="#list-style"
50495059
title=list-style><strong>5.</strong></a>
50505060

@@ -5110,6 +5120,9 @@ <h2 class=no-num id=index>Index</h2>
51105120
<li>marker-attachment, <a href="#marker-attachment0"
51115121
title=marker-attachment><strong>7.2.</strong></a>
51125122

5123+
<li>marker positioning edge, <a href="#marker-positioning-edge"
5124+
title="marker positioning edge"><strong>7.1.</strong></a>
5125+
51135126
<li>marker positioning reference element, <a
51145127
href="#marker-positioning-reference-element"
51155128
title="marker positioning reference element"><strong>7.1.</strong></a>

css3-lists/Overview.src.html

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -671,13 +671,11 @@ <h3 id='position-marker'>
671671

672672
<p>The ''marker'' value for 'position' depends on the element it is set on having a list item ancestor. If the specified value of 'position' is ''marker'' and the element does not have a list item ancestor, 'position' must compute to 'relative' on the element. An element with <code class=css>position:marker</code> counts as <a href="http://www.w3.org/TR/CSS21/visuren.html#absolutely-positioned">absolutely positioned</a>.</p>
673673

674-
<p>The element's vertical position is calculated according to the <a href="http://www.w3.org/TR/CSS21/visuren.html#normal-flow">normal flow</a>. <span class='note'>In the Positioned Layout Module this will be defined more precisely in terms of placeholders.</span></p>
675-
676-
<p>To calculate the element's horizontal position, we must first define a few terms:</p>
674+
<p>To calculate the marker's position, we must first define a few terms:</p>
677675

678676
<dl>
679677
<dt><dfn title="ancestor list item|ancestor list item's">ancestor list item</dfn></dt>
680-
<dd>The <i>ancestor list item</i> is the marker's nearest list item ancestor.</dd>
678+
<dd>The <i>ancestor list item</i> is the marker's nearest list item ancestor element.</dd>
681679

682680
<dt><dfn>marker positioning reference element</dfn></dt>
683681
<dd>
@@ -687,19 +685,19 @@ <h3 id='position-marker'>
687685

688686
<p>Otherwise, the <i>marker positioning reference element</i> is the <i>ancestor list item</i>.</p>
689687
</dd>
688+
689+
<dt><dfn>list item positioning edge</dfn></dt>
690+
<dd>The border edge of the <i>ancestor list item</i> corresponding to the "start" or "before" edge of the <i>marker positioning reference element</i>, whichever is in the <i>ancestor list item's</i> inline axis.</dd>
691+
692+
<dt><dfn>marker positioning edge</dfn></dt>
693+
<dd>The opposing edge relative to the <i>list item positioning edge</i> on the marker's margin box. For example, if the <i>list item positioning edge ended up being the left border edge of the <i>ancestor list item</i>, the <i>marker positioning edge</i> would be the right margin edge of the marker.</dd>
690694
</dl>
691695

692-
<p>The element's horizontal position must then be set such that the element's margin edge that corresponds to the "end" edge of the <i>marker positioning reference element</i> is flush with the <i>ancestor list item's</i> border edge that corresponds to the "start" edge of the <i>marker positioning reference element</i>.</p>
696+
<p>The marker's position in the <i>ancestor list item's</i> block axis is calculated according to the <a href="http://www.w3.org/TR/CSS21/visuren.html#normal-flow">normal flow</a>. <span class='note'>In the Positioned Layout Module this will be defined more precisely in terms of placeholders.</span></p>
693697

694-
<p class='note'>The purpose of this somewhat convoluted definition is to position the marker flush against its list item, and then when "marker-attachment:list-container", keep all the markers for a given list on the same side of their list items even in mixed-direction text, so that authors can specify padding on only one side and still ensure their markers are visible.</p>
698+
<p>The marker's position in the <i>ancestor list item's</i> inline axis must be set such that the <i>marker positioning edge</i> is flush with the <i>list item positioning edge</i>.</p>
695699

696-
<p class='issue'>This handles ltr/rtl mixed-direction text, but not mixed
697-
horizontal and vertical text. For example, if the <i>ancestor list container</i>
698-
is vertical but the <i>ancestor list item</i> is horizontal, this definition
699-
is nonsensical, as it requires a vertical edge of the marker to be flush
700-
against a horizontal edge of the <i>ancestor list item</i>. Need to think
701-
on what UI would be acceptable for such a crazy case, and how to state it
702-
in non-crazy terms.</p>
700+
<p class='note'>The purpose of this somewhat convoluted definition is to position the marker flush against its list item, and then when "marker-attachment:list-container", keep all the markers for a given list on the same side of their list items even in mixed-direction text, so that authors can specify padding on only one side and still ensure their markers are visible. And on top of all that, do something sane in the face of potentially differing writing-modes on the marker, list item, and container.</p>
703701

704702
<p>All elements or pseudo-elements with <code class=css>"position:marker"</code> that share a common <i>ancestor list item</i> are known as <dfn title='associated-marker'>markers associated with that list item</dfn>.</p>
705703

0 commit comments

Comments
 (0)