@@ -64,6 +64,7 @@ urlPrefix: https://heycam.github.io/webidl/; type: dfn;
64
64
urlPrefix: https://tc39.github.io/ecma262/#sec-; type: dfn;
65
65
text: constructor
66
66
text: Construct
67
+ text: GetMethod
67
68
text: IsArray
68
69
text: IsCallable
69
70
text: IsConstructor
@@ -1530,6 +1531,9 @@ interface IntrinsicSizesRequest {
1530
1531
[Exposed=LayoutWorklet]
1531
1532
interface LayoutFragmentRequest {
1532
1533
};
1534
+
1535
+ typedef (IntrinsicSizesRequest or LayoutFragmentRequest)
1536
+ LayoutFragmentRequestOrIntrinsicSizesRequest;
1533
1537
</pre>
1534
1538
1535
1539
The {{IntrinsicSizesRequest}} has internal slot(s):
@@ -1960,57 +1964,61 @@ When the user agent wants to <dfn>get a layout class instance</dfn> given |box|,
1960
1964
When the user agent wants to <dfn>run a generator</dfn> given |generator|, and |generatorType|, it
1961
1965
<em> must</em> run the following steps:
1962
1966
1963
- 1. Let |nextResult| be the result of calling <a>Invoke</a> (<code> next</code> , |generator|).
1967
+ 1. Let |done| be a <a>boolean</a> initialized to <code> false</code> .
1968
+
1969
+ 2. Let |nextValue| be undefined.
1970
+
1971
+ 3. Perform the following substeps until |done| is <code> true</code> :
1972
+
1973
+ 1. Let |nextFunction| be the result of <a>Get</a> (|generator|, <code> "next"</code> ).
1974
+
1975
+ 2. If the result of <a>IsCallable</a> (|nextFunction|) is false, <a>throw</a> a
1976
+ <a>TypeError</a> and abort all these steps.
1964
1977
1965
- If an exception is <a>thrown</a> return failure, and abort all these steps.
1978
+ 3. Let |nextResult| be the result of calling <a>Invoke</a> (|nextFunction|, |generator|,
1979
+ «|nextValue|»).
1966
1980
1967
- 2. Perform the following substeps until the result of <a>Get</a> (|nextResult|,
1968
- <code> "done"</code> ) is <code> true</code> .
1981
+ If an exception is <a>thrown</a> return failure, and abort all these steps.
1969
1982
1970
- 1. Let |requests| be the result of <a>Get</a> (|nextResult|, <code> "value"</code> ).
1983
+ 4. If the result of <a>Type</a> (|nextResult|) is not Object, <a>throw</a> a <a>TypeError</a>
1984
+ and abort all these steps.
1971
1985
1972
- 2 . Let |results | be an <a for=list>empty </a> <a>list</a> .
1986
+ 5 . Let |requestOrRequests | be the result of <a>Get </a>(nextResult|, <code> "value" </code> ) .
1973
1987
1974
- 3. <a for=list>For each </a> |request| in |requests| perform the following substeps:
1988
+ 6. Let |done| be the result of <a>Get </a>(|nextResult|, <code> "done" </code> ).
1975
1989
1976
- 1. Let |result| be null.
1990
+ 7. If the result of <a>GetMethod</a> (|requestOrRequests|, <code> @@iterable</code> ) exists
1991
+ then:
1977
1992
1978
- 2. If |request| is a {{IntrinsicSizesRequest}} then:
1993
+ 1. Set |results| to be a new <a for=list>empty</a> <a>list</a> .
1979
1994
1980
- 1 . Let |layoutChild | be the result of looking up the internal slot
1981
- <code> \ [[layoutChild]] </code> on |request| .
1995
+ 2 . Let |requests | be the result of <a>converting</a> |requestOrRequests| to a
1996
+ <code> sequence<LayoutFragmentRequestOrIntrinsicSizesRequest> </code> .
1982
1997
1983
- 2. Let |internalIntrinsicSizes| be the result of the user agent calculating the
1984
- <b> border box</b> min/max content contribution of |layoutChild|.
1998
+ If an exception is <a>thrown</a> , rethrow the exception and abort all these steps.
1985
1999
1986
- 3. Let |result| be the result of <a>create an intrinsic sizes object</a> given
1987
- |request|, and |internalIntrinsicSizes|.
2000
+ 3. <a for=list>For each</a> |request| in |requests| perform the following substeps:
1988
2001
1989
- 3. If |request| is a {{LayoutFragmentRequest}} and |generatorType| is
1990
- <code> "layout" </code> then:
2002
+ 1. Let |result| be the result of <a>produce a generator result</a> given |request|,
2003
+ |generator|, |generatorType|.
1991
2004
1992
- 1. Let |layoutChild| be result of looking up the internal slot
1993
- <code> \[[layoutChild]] </code> on |request|.
2005
+ 2. <a for=list>Append</a> |result| to |results|.
1994
2006
1995
- 2. Let |childLayoutConstraints| be the result of looking up the internal slot
1996
- <code> \[[childLayoutConstraints]] </code> on |request|.
2007
+ 4. Set |nextValue| to be |results|.
1997
2008
1998
- 3. Let |childBreakToken| be the result of looking up the internal slot
1999
- <code> \[[childBreakToken]] </code> on |request|.
2009
+ 5. Continue.
2000
2010
2001
- 4. Let |internalFragment| be the result of the user agent producing a
2002
- <a>fragment</a> based on |layoutChild|, |childLayoutConstraints|, and
2003
- |childBreakToken|.
2011
+ 8. Let |request| be the result of <a>converting</a> |requestOrRequests| to a
2012
+ {{LayoutFragmentRequestOrIntrinsicSizesRequest}} .
2004
2013
2005
- 5. Let |targetRealm| be |generator|'s <a>Realm </a> .
2014
+ If an exception is <a>thrown </a> , rethrow the exception and abort all these steps .
2006
2015
2007
- 6 . Let |result| be the result of <a>create a layout fragment </a> given
2008
- |targetRealm |, |request|, and |internalFragment |.
2016
+ 9 . Let |result| be the result of <a>produce a generator result </a> given |request|,
2017
+ |generator |, |generatorType |.
2009
2018
2010
- 4. If |result| is null (that is neither of the above branches was taken), return
2011
- failure, and abort all these steps.
2019
+ 10. Set |nextValue| to be |result|.
2012
2020
2013
- 5. <a for=list>Append</a> |result| to |results| .
2021
+ 11. Continue .
2014
2022
2015
2023
The user agent may perform the above loop out of order, and <a>in parallel</a> . The ordering
2016
2024
for |requests| and |results| however <em> must</em> be consistent.
@@ -2021,10 +2029,42 @@ When the user agent wants to <dfn>run a generator</dfn> given |generator|, and |
2021
2029
thread tasks are complete before calling the generator again. It cannot return partial
2022
2030
results to the author.
2023
2031
2024
- 4. Let |nextResult| be the result of calling <a>Invoke </a> (<code> next </code> ,
2025
- |generator|, |results|).
2032
+ 3. Return the result of calling <a>Get </a> (|nextResult|, <code> "value" </code> ).
2033
+ </div>
2026
2034
2027
- If an exception is <a>thrown</a> then return failure, and abort all these steps.
2035
+ <div algorithm="produce a generator result">
2036
+ When the user agent wants to <dfn>produce a generator result</dfn> given |request|, |generator|, and
2037
+ |generatorType|, it <em> must</em> run the following steps:
2038
+ 1. If |request| is a {{IntrinsicSizesRequest}} then:
2028
2039
2029
- 3. Return the result of calling <a>Get</a> (|nextResult|, <code> "value"</code> ).
2040
+ 1. Let |layoutChild| be the result of looking up the internal slot
2041
+ {{IntrinsicSizesRequest/[[layoutChild]]}} on |request|.
2042
+
2043
+ 2. Let |internalIntrinsicSizes| be the result of the user agent calculating the <b> border
2044
+ box</b> min/max content contribution of |layoutChild|.
2045
+
2046
+ 3. Return the result of <a>create an intrinsic sizes object</a> given |request|, and
2047
+ |internalIntrinsicSizes|.
2048
+
2049
+ 2. If |request| is a {{LayoutFragmentRequest}} and |generatorType| is <code> "layout"</code>
2050
+ then:
2051
+
2052
+ 1. Let |layoutChild| be result of looking up the internal slot
2053
+ {{LayoutFragmentRequest/[[layoutChild]]}} on |request|.
2054
+
2055
+ 2. Let |childLayoutConstraints| be the result of looking up the internal slot
2056
+ {{LayoutFragmentRequest/[[layoutConstraints]]}} on |request|.
2057
+
2058
+ 3. Let |childBreakToken| be the result of looking up the internal slot
2059
+ {{LayoutFragmentRequest/[[breakToken]]}} on |request|.
2060
+
2061
+ 4. Let |internalFragment| be the result of the user agent producing a <a>fragment</a> based
2062
+ on |layoutChild|, |childLayoutConstraints|, and |childBreakToken|.
2063
+
2064
+ 5. Let |targetRealm| be |generator|'s <a>Realm</a> .
2065
+
2066
+ 6. Return the result of <a>create a layout fragment</a> given |targetRealm|, |request|, and
2067
+ |internalFragment|.
2068
+
2069
+ 3. Return failure (neither of the above branches was taken).
2030
2070
</div>
0 commit comments