Skip to content

Commit 1fcaa26

Browse files
committed
[css-layout-api] Ensure that we have a valid child.
Ensure that we have a LayoutChild attached to the box tree during layout.
1 parent fdf018c commit 1fcaa26

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

css-layout-api/Overview.bs

+22-7
Original file line numberDiff line numberDiff line change
@@ -2016,6 +2016,9 @@ When the user agent wants to <dfn>run a generator</dfn> given |generator|, and |
20162016
9. Let |result| be the result of <a>produce a generator result</a> given |request|,
20172017
|generator|, |generatorType|.
20182018

2019+
If <a>produce a generator result</a> returns failure, return failure, and abort all
2020+
these steps.
2021+
20192022
10. Set |nextValue| to be |result|.
20202023

20212024
11. Continue.
@@ -2040,10 +2043,16 @@ When the user agent wants to <dfn>produce a generator result</dfn> given |reques
20402043
1. Let |layoutChild| be the result of looking up the internal slot
20412044
{{IntrinsicSizesRequest/[[layoutChild]]}} on |request|.
20422045

2043-
2. Let |internalIntrinsicSizes| be the result of the user agent calculating the <b>border
2046+
2. If |layoutChild| is <em>not</em> attached to the <a>box tree</a>, return failure and
2047+
abort all these steps.
2048+
2049+
Note: The author may hold onto a {{LayoutChild}} from a previous invocation. It is
2050+
assumed that a box is only ever attached to the box-tree once, and not re-used.
2051+
2052+
3. Let |internalIntrinsicSizes| be the result of the user agent calculating the <b>border
20442053
box</b> min/max content contribution of |layoutChild|.
20452054

2046-
3. Return the result of <a>create an intrinsic sizes object</a> given |request|, and
2055+
4. Return the result of <a>create an intrinsic sizes object</a> given |request|, and
20472056
|internalIntrinsicSizes|.
20482057

20492058
2. If |request| is a {{LayoutFragmentRequest}} and |generatorType| is <code>"layout"</code>
@@ -2052,18 +2061,24 @@ When the user agent wants to <dfn>produce a generator result</dfn> given |reques
20522061
1. Let |layoutChild| be result of looking up the internal slot
20532062
{{LayoutFragmentRequest/[[layoutChild]]}} on |request|.
20542063

2055-
2. Let |childLayoutConstraints| be the result of looking up the internal slot
2064+
2. If |layoutChild| is <em>not</em> attached to the <a>box tree</a>, return failure and
2065+
abort all these steps.
2066+
2067+
Note: The author may hold onto a {{LayoutChild}} from a previous invocation. It is
2068+
assumed that a box is only ever attached to the box-tree once, and not re-used.
2069+
2070+
3. Let |childLayoutConstraints| be the result of looking up the internal slot
20562071
{{LayoutFragmentRequest/[[layoutConstraints]]}} on |request|.
20572072

2058-
3. Let |childBreakToken| be the result of looking up the internal slot
2073+
4. Let |childBreakToken| be the result of looking up the internal slot
20592074
{{LayoutFragmentRequest/[[breakToken]]}} on |request|.
20602075

2061-
4. Let |internalFragment| be the result of the user agent producing a <a>fragment</a> based
2076+
5. Let |internalFragment| be the result of the user agent producing a <a>fragment</a> based
20622077
on |layoutChild|, |childLayoutConstraints|, and |childBreakToken|.
20632078

2064-
5. Let |targetRealm| be |generator|'s <a>Realm</a>.
2079+
6. Let |targetRealm| be |generator|'s <a>Realm</a>.
20652080

2066-
6. Return the result of <a>create a layout fragment</a> given |targetRealm|, |request|, and
2081+
7. Return the result of <a>create a layout fragment</a> given |targetRealm|, |request|, and
20672082
|internalFragment|.
20682083

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

0 commit comments

Comments
 (0)