@@ -132,7 +132,7 @@ Layout Children {#layout-children}
132
132
<pre class='idl'>
133
133
[Exposed=LayoutWorklet]
134
134
interface LayoutChild {
135
- FragmentRequest doLayout (ConstraintSpace space, ChildBreakToken breakToken);
135
+ FragmentRequest layoutNextFragment (ConstraintSpace space, ChildBreakToken breakToken);
136
136
};
137
137
138
138
[Exposed=LayoutWorklet]
@@ -219,11 +219,11 @@ A {{BoxLayoutChild}} could be generated by:
219
219
An array of {{LayoutChild}} ren is passed into the <a>layout method</a> which represents the children
220
220
of the current box which is being laid out.
221
221
222
- To perform layout on a box the author can invoke the {{LayoutChild/doLayout ()}} method. This will
223
- produce a {{Fragment}} which contains layout information.
222
+ To perform layout on a box the author can invoke the {{LayoutChild/layoutNextFragment ()}} method.
223
+ This will produce a {{Fragment}} which contains layout information.
224
224
225
- The {{LayoutChild/doLayout ()}} method may be invoked multiple times with different arguments to
226
- query the {{LayoutChild}} for different layout information.
225
+ The {{LayoutChild/layoutNextFragment ()}} method may be invoked multiple times with different
226
+ arguments to query the {{LayoutChild}} for different layout information.
227
227
228
228
Layout Fragments {#layout-fragments}
229
229
------------------------------------
@@ -247,12 +247,13 @@ interface Fragment {
247
247
</pre>
248
248
249
249
A {{Fragment}} represents a CSS <a>fragment</a> of a {{LayoutChild}} after layout has occurred on
250
- that child. This is produced by the {{LayoutChild/doLayout ()}} method.
250
+ that child. This is produced by the {{LayoutChild/layoutNextFragment ()}} method.
251
251
252
252
The {{Fragment}} has {{Fragment/inlineSize}} and {{Fragment/blockSize}} attributes, which are set by
253
253
the respective child's layout algorithm. They cannot be changed. If the <a>current layout</a>
254
254
requires a different {{Fragment/inlineSize}} or {{Fragment/blockSize}} the author must perform
255
- {{LayoutChild/doLayout()}} again with different arguments in order to get different results.
255
+ {{LayoutChild/layoutNextFragment()}} again with different arguments in order to get different
256
+ results.
256
257
257
258
The {{Fragment}} has {{Fragment/inlineOverflowSize}} and {{Fragment/blockOverflowSize}} attributes.
258
259
This is the size of the overflow area of the fragment. If the fragment didn't overflow these
@@ -296,7 +297,7 @@ registerLayout('block-like', class extends Layout {
296
297
let blockOffset = bordersAndPadding.blockStart;
297
298
298
299
for (let child of children) {
299
- const fragment = yield child.doLayout (childConstraintSpace);
300
+ const fragment = yield child.layoutNextFragment (childConstraintSpace);
300
301
301
302
// Position the fragment in a block like manner, centering it in the
302
303
// inline direction.
@@ -329,10 +330,11 @@ registerLayout('block-like', class extends Layout {
329
330
330
331
The {{Fragment}} 's {{Fragment/breakToken}} specifies where the {{LayoutChild}} last fragmented. If
331
332
the {{Fragment/breakToken}} is null the {{LayoutChild}} wont produce any more {{Fragment}} s for that
332
- token chain. The {{Fragment/breakToken}} can be passed to the {{LayoutChild/doLayout()}} function to
333
- produce the next {{Fragment}} for a particular child. The {{Fragment/breakToken}} cannot be changed.
333
+ token chain. The {{Fragment/breakToken}} can be passed to the {{LayoutChild/layoutNextFragment()}}
334
+ function to produce the next {{Fragment}} for a particular child. The {{Fragment/breakToken}} cannot
335
+ be changed.
334
336
If the <a>current layout</a> requires a different {{Fragment/breakToken}} the author must perform
335
- {{LayoutChild/doLayout ()}} again with different arguments.
337
+ {{LayoutChild/layoutNextFragment ()}} again with different arguments.
336
338
337
339
The {{Fragment}} 's {{Fragment/dominantBaseline}} attribute specify where the dominant baseline is
338
340
positioned relative to the block start of the fragment. It cannot be changed.
@@ -428,7 +430,7 @@ registerLayout('flex-distribution-like', class {
428
430
429
431
// Calculate the unconstrained size for each child.
430
432
for (let child of children) {
431
- const fragment = yield child.doLayout (childConstraintSpace);
433
+ const fragment = yield child.layoutNextFragment (childConstraintSpace);
432
434
unconstrainedSizes.push(fragment.inlineSize);
433
435
totalSize += fragment.inlineSize;
434
436
}
@@ -440,7 +442,7 @@ registerLayout('flex-distribution-like', class {
440
442
let inlineOffset = 0;
441
443
let maxChildBlockSize = 0;
442
444
for (let i = 0; i < children.length; i++) {
443
- let fragment = yield child.doLayout (new ConstraintSpace({
445
+ let fragment = yield child.layoutNextFragment (new ConstraintSpace({
444
446
inlineSize: unconstrainedSizes[i] + extraSpace,
445
447
inlineSizeFixed: true,
446
448
blockSize: availableBlockSize
@@ -603,8 +605,8 @@ registerLayout('basic-inline', class extends Layout {
603
605
inlineShrinkToFit: true,
604
606
});
605
607
606
- const fragment = yield child.doLayout (constraintSpace,
607
- childBreakToken);
608
+ const fragment = yield child.layoutNextFragment (constraintSpace,
609
+ childBreakToken);
608
610
childFragments.push(fragment);
609
611
610
612
// Check if there is still space on the current line.
@@ -916,10 +918,10 @@ The layout method on the author supplied layout class is a generator function in
916
918
javascript function. This is for user-agents to be able to support asynchronous and parallel layout
917
919
engines.
918
920
919
- When an author invokes the {{LayoutChild/doLayout ()}} method on a {{LayoutChild}} the user-agent
920
- doesn't synchronously generate a {{Fragment}} to return to the author's code. Instead it returns a
921
- {{FragmentRequest}} . This is a completely opaque object to the author but contains internal
922
- slots which encapsulates the {{LayoutChild/doLayout ()}} method call.
921
+ When an author invokes the {{LayoutChild/layoutNextFragment ()}} method on a {{LayoutChild}} the
922
+ user-agent doesn't synchronously generate a {{Fragment}} to return to the author's code. Instead it
923
+ returns a {{FragmentRequest}} . This is a completely opaque object to the author but contains
924
+ internal slots which encapsulates the {{LayoutChild/layoutNextFragment ()}} method call.
923
925
924
926
When a {{FragmentRequest}} (s) are yielded from a layout generator object the user-agent's
925
927
layout engine may run the algorithm asynchronously with other work, and/or on a different thread of
0 commit comments