Skip to content

Commit d5fff69

Browse files
committed
[css-layout-api] Check child fragments were produced in the current layout pass.
Make the layout api container fallback to flow layout if the child fragment was produce from a previous generator.
1 parent 1fcaa26 commit d5fff69

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

css-layout-api/Overview.bs

+17-8
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,8 @@ interface LayoutFragment {
409409
The {{LayoutFragment}} has internal slot(s):
410410
- <dfn attribute for=LayoutFragment>\[[layoutFragmentRequest]]</dfn> a
411411
{{LayoutFragmentRequest}}, this is the fragment request which generated this fragment.
412+
- <dfn attribute for=LayoutFragment>\[[generator]]</dfn> the generator which produced this
413+
fragment.
412414

413415
<hr>
414416

@@ -501,13 +503,16 @@ If the <a>current layout</a> requires a different {{LayoutFragment/breakToken}}
501503
{{LayoutChild/layoutNextFragment()}} again with different arguments.
502504

503505
<div algorithm>
504-
When the user agent wants to <dfn>create a layout fragment</dfn> given |targetRealm|,
505-
|layoutFragmentRequest|, and |internalFragment|, it <em>must</em> run the following steps:
506+
When the user agent wants to <dfn>create a layout fragment</dfn> given |generator|,
507+
|layoutFragmentRequest|, and |internalFragment|, it <em>must</em> run the following steps:
508+
1. Let |targetRealm| be |generator|'s <a>Realm</a>.
506509

507-
1. Let |fragment| be a new {{LayoutFragment}} with:
510+
2. Let |fragment| be a new {{LayoutFragment}} with:
508511

509512
- The {{[[layoutFragmentRequest]]}} internal slot being |layoutFragmentRequest|.
510513

514+
- The {{[[generator]]}} internal slot being |generator|.
515+
511516
- {{LayoutFragment/inlineSize}} being |internalFragment|'s <a>inline size</a> relative to
512517
the <a>current layout's</a> writing mode.
513518

@@ -525,7 +530,7 @@ When the user agent wants to <dfn>create a layout fragment</dfn> given |targetRe
525530
{{LayoutFragment/data}} being the result of
526531
<a>StructuredDeserialize</a>(|clonedData|, |targetRealm|), otherwise null.
527532

528-
2. Return |fragment|.
533+
3. Return |fragment|.
529534
</div>
530535

531536
Intrinsic Sizes {#intrinsic-sizes}
@@ -1873,7 +1878,13 @@ following steps:
18731878
{{FragmentResultOptions}}. If an exception is <a>thrown</a>, let |box| fallback to the
18741879
<a>flow layout</a> and abort all these steps.
18751880

1876-
15. Create a <a>fragment</a> for |box| with:
1881+
15. <a for=list>For each</a> |childFragment| in |fragment|'s
1882+
{{FragmentResultOptions/childFragments}}, perform the following stubsteps:
1883+
1884+
1. If |childFragment|'s {{[[generator]]}} internal slot is not equal to |layoutGenerator|,
1885+
then let |box| fallback to the <a>flow layout</a> and abort all these steps.
1886+
1887+
16. Create a <a>fragment</a> for |box| with:
18771888

18781889
- The <a>inline size</a> set to |fragment|'s {{FragmentResultOptions/inlineSize}}.
18791890

@@ -2076,9 +2087,7 @@ When the user agent wants to <dfn>produce a generator result</dfn> given |reques
20762087
5. Let |internalFragment| be the result of the user agent producing a <a>fragment</a> based
20772088
on |layoutChild|, |childLayoutConstraints|, and |childBreakToken|.
20782089

2079-
6. Let |targetRealm| be |generator|'s <a>Realm</a>.
2080-
2081-
7. Return the result of <a>create a layout fragment</a> given |targetRealm|, |request|, and
2090+
6. Return the result of <a>create a layout fragment</a> given |generator|, |request|, and
20822091
|internalFragment|.
20832092

20842093
3. Return failure (neither of the above branches was taken).

0 commit comments

Comments
 (0)