Skip to content

Commit 5e6312a

Browse files
committed
[css-layout-api] Commit derived constraint space from ages ago.
1 parent cd2e954 commit 5e6312a

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

css-layout-api/Overview.bs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,17 @@ TODO add example of exclusion usage.
531531
<pre class="idl">
532532
partial interface ConstraintSpace {
533533
// TODO add arguments to layoutOpportunities that make sense.
534-
ConstraintSpaceIterable layoutOpportunities();
534+
ConstraintSpaceIterable layoutOpportunities(optional LayoutOpportunitiesOptions);
535535
};
536536

537+
dictionary LayoutOpportunitiesOptions {
538+
optional sequence&lt;ExclusionTag> avoid = «»; // empty list is avoid everything. :)
539+
optional sequence&lt;ExclusionTag> clear = «»; // defaults to clear nothing.
540+
optional number jump; // defaults to 1em.
541+
};
542+
543+
enum LayoutDirection { "inline", "block" };
544+
537545
// TODO should be a generator function instead?
538546
interface ConstraintSpaceIterable {
539547
iterable&lt;DerivedConstraintSpace>;
@@ -560,7 +568,18 @@ The {{ConstraintSpace/inlineSize}} and {{ConstraintSpace/blockSize}} attributes
560568
{{ConstraintSpace/inlinePercentResolutionSize}} and {{ConstraintSpace/blockPercentResolutionSize}}
561569
should remain the same as the parent.
562570

563-
The {{DerivedConstraintSpace}} is used for "fitting" a child within a larger {{ConstraintSpace}}.
571+
The {{ConstraintSpace/layoutOpportunities()}} method takes an optional dictionary
572+
{{LayoutOpportunitiesOptions}}.
573+
574+
The {{LayoutOpportunitiesOptions/clear}} property is similar to the ''clear'' property. The returned
575+
generator will only return {{DerivedConstraintSpace}}s which lower (in the block direction) that any
576+
types of exclusions listed.
577+
578+
The {{LayoutOpportunitiesOptions/avoid}} property will return {{DerivedConstraintSpace}}s which wont
579+
have the listed exclusion types inside them.
580+
581+
The {{LayoutOpportunitiesOptions/jump}} property allows authors to specify the minimum jump for
582+
non-rectangular exclusions.
564583

565584
Issue: Add image showing a child "fitting" within a larger {{ConstraintSpace}}.
566585

0 commit comments

Comments
 (0)