@@ -937,22 +937,40 @@ child to fragment.
937
937
Alignment {#interaction-alignment}
938
938
----------------------------------
939
939
940
- <div class="issue">
941
- Issue: We need to add the ability to request baselines on the input layout constraints, and have a
942
- fragment returned what was asked. E.g.
940
+ The first/last baseline sets of a <a>layout API contrainer</a> is generated exactly like block
941
+ containers do (see [[css-align-3#baseline-export]] ). Except that the order of the in-flow children
942
+ should be determined by the in which they are returned form the layout method (via
943
+ {{FragmentResultOptions/childFragments}} ) instead of the document order.
943
944
944
- <pre class="lang-javascript">
945
- const constraints = {
946
- inlineSize: availableInlineSize,
947
- baselines: ['alphabetic', 'middle'] ,
948
- };
949
945
950
- const fragment = yield child.layoutNextFragment(constraints);
951
- fragment.baselines.get('alphabetic' ) == /* something */;
946
+ <div class="note">
947
+ Note: In a future level of the specification there will be the ability for the author to define the
948
+ baselines themselves. This will be of the form:
949
+
950
+ To <em> query</em> baseline information from a {{LayoutChild}} .
951
+ <pre class="lang-javascript">
952
+ const fragment = yield child.layoutNextFragment({
953
+ fixedInlineSize: availableInlineSize,
954
+ baselineRequests: ['alphabetic', 'middle'] ,
955
+ });
956
+ fragment.baselines.get('alphabetic' ) === 25 /* or something */;
952
957
</pre>
953
958
954
- Do we want this in level 1? E.g. is it better to wait for implementations of [[css-align-3]] before
955
- doing this?
959
+ To <em> produce</em> baseline information for a <a>parent layout</a> :
960
+ <pre class="lang-javascript">
961
+ registerLayout('baseline-producing' , class {
962
+ *layout(children, edges, constraints, styleMap) {
963
+ const result = {baselines: {}};
964
+
965
+ for (let baselineRequest of constraints.baselineRequests) {
966
+ // baselineRequest === 'alphabetic' , or something else.
967
+ result.baselines[baselineRequest] = 25;
968
+ }
969
+
970
+ return result;
971
+ }
972
+ });
973
+ </pre>
956
974
</div>
957
975
958
976
Layout {#layout}
0 commit comments