Skip to content

Commit b10eced

Browse files
committed
[css-layout-api] Alignment section.
1 parent b90e037 commit b10eced

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

css-layout-api/Overview.bs

+57
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,34 @@ dictionary ConstraintSpaceOptions {
443443
enum BlockFragmentationType { "none", "page", "column", "region" };
444444
</pre>
445445

446+
<div class="issue">
447+
Issue: Should {{ConstraintSpaceOptions}} be instead:
448+
449+
<pre class="lang-javascript">
450+
const options = {
451+
availableInlineSize: 100,
452+
availableBlockSize: Infinity,
453+
454+
fixedInlineSize: 150, // This makes the engine ignore availableInlineSize.
455+
fixedBlockSize: 150, // This makes the engine ignore availableBlockSize.
456+
457+
percentageInlineSize: 100, // This defaults to fixedInlineSize,
458+
// then availableInlineSize if not set.
459+
percentageBlockSize: 100, // This defaults to fixedBlockSize,
460+
// then availableBlockSize if not set.
461+
462+
blockFragmentationOffset: 200,
463+
blockFragmentationType: 'column',
464+
465+
data: {floatPositions: [{x: 20, y: 30}]}, // Author data.
466+
};
467+
</pre>
468+
469+
The constraint space would mirror this, additionally with the blockSize, and inlineSize attributes
470+
which represent the resolved inline and block sizes for the fragment.
471+
472+
</div>
473+
446474
A {{ConstraintSpace}} is passed into the layout method which represents the available space for the
447475
<a>current layout</a> to perform layout inside. It is also used to pass information about the
448476
available space into a <a>child layout</a>.
@@ -948,12 +976,41 @@ this level of the specification.
948976
A <a>layout API container</a> should calculate its scrollable overflow exactly like block
949977
containers do.
950978

979+
Even if the author's <a>layout API container</a> positions a fragment into the <a>scrollable
980+
overflow</a> region, relative positioning or transforms may cause the fragment to shift such that
981+
its <a>scrollable overflow</a> region, causing no overflow to occur.
982+
951983
Fragmentation {#interaction-fragmentation}
952984
------------------------------------------
953985

986+
A <a>parent layout</a> can ask the <a>current layout</a> to <a>fragment</a> by setting the
987+
{{ConstraintSpace/blockFragmentationType}} and {{ConstraintSpace/blockFragmentationOffset}}.
988+
989+
E.g. [[css-multicol-1]] layout would set a {{ConstraintSpace/blockFragmentationType}} to
990+
<code>"column"</code> and set the {{ConstraintSpace/blockFragmentationOffset}} to where it needs the
991+
child to fragment.
992+
954993
Alignment {#interaction-alignment}
955994
----------------------------------
956995

996+
<div class="issue">
997+
Issue: We need to add the ability to request baselines on the constraint space, and have a fragment
998+
returned what was asked. E.g.
999+
1000+
<pre class="lang-javascript">
1001+
const spaceOptions = {
1002+
inlineSize: availableInlineSize,
1003+
baselines: ['alphabetic', 'middle'],
1004+
};
1005+
1006+
const fragment = yield child.layoutNextFragment(spaceOptions);
1007+
fragment.baselines.get('alphabetic') == /* something */;
1008+
</pre>
1009+
1010+
Do we want this in level 1? E.g. is it better to wait for implementations of [[css-align-3]] before
1011+
doing this?
1012+
</div>
1013+
9571014
Layout {#layout}
9581015
================
9591016

0 commit comments

Comments
 (0)