@@ -36,12 +36,13 @@ spec:css-break-3; type:dfn; text:fragment
36
36
spec:css-display-3; type:dfn; text:box
37
37
spec:css-display-3; type:value; for:display; text:none
38
38
spec:css-display-3; type:value; for:<display-inside> ; text:grid
39
- spec:dom; type:dfn; for:/; text:element
40
- spec:infra; type:dfn; text:list
41
39
spec:css-pseudo-4; type:selector; text:::after
42
40
spec:css-pseudo-4; type:selector; text:::before
43
41
spec:css-pseudo-4; type:selector; text:::first-letter
44
42
spec:css-pseudo-4; type:selector; text:::first-line
43
+ spec:dom; type:dfn; for:/; text:element
44
+ spec:infra; type:dfn; text:list
45
+ spec:html; type:dfn; for:global object; text:realm
45
46
</pre>
46
47
47
48
<pre class="anchors">
@@ -75,6 +76,9 @@ urlPrefix: https://drafts.csswg.org/css-break/#; type: dfn
75
76
text: fragmentation break
76
77
urlPrefix: https://www.w3.org/TR/CSS21/box.html#; type: dfn
77
78
url: box-dimensions; text: box model edges
79
+ urlPrefix: https://html.spec.whatwg.org/#; type: dfn
80
+ text: structuredserializeforstorage
81
+ text: structureddeserialize
78
82
</pre>
79
83
80
84
Introduction {#intro}
@@ -299,12 +303,11 @@ registerLayout('block-like', class {
299
303
blockSize: availableBlockSize,
300
304
});
301
305
302
- let blockOffset = edges.all.blockStart;
303
-
304
306
const childFragments = yeild children.map((child) => {
305
307
return child.layoutNextFragment(childConstraintSpace);
306
308
});
307
309
310
+ let blockOffset = edges.all.blockStart;
308
311
for (let fragment of childFragments) {
309
312
// Position the fragment in a block like manner, centering it in the
310
313
// inline direction.
@@ -330,6 +333,10 @@ registerLayout('block-like', class {
330
333
</pre>
331
334
</div>
332
335
336
+ A <a>layout API container</a> can communicate with other <a>layout API containers</a> by using the
337
+ {{Fragment/data}} attribute. This is set by the {{FragmentResultOptions/data}} member in the
338
+ {{FragmentResultOptions}} dictionary.
339
+
333
340
The {{Fragment}} 's {{Fragment/breakToken}} specifies where the {{LayoutChild}} last fragmented. If
334
341
the {{Fragment/breakToken}} is null the {{LayoutChild}} wont produce any more {{Fragment}} s for that
335
342
token chain. The {{Fragment/breakToken}} can be passed to the {{LayoutChild/layoutNextFragment()}}
@@ -508,15 +515,13 @@ dictionary BreakTokenOptions {
508
515
any data = null;
509
516
};
510
517
511
- enum BreakType { "none", "inline", "inline-hyphen ", "column", "page", "region" };
518
+ enum BreakType { "none", "line ", "column", "page", "region" };
512
519
</pre>
513
520
514
- Issue: Fill out other inline type break types.
515
-
516
521
A {{LayoutChild}} can produce multiple {{Fragment}} s. A {{LayoutChild}} may fragment in the block
517
522
direction if a {{ConstraintSpace/blockFragmentationType}} is not none. Additionally {{LayoutChild}}
518
- which represents <a>inline-level</a> content, may fragment line by line if the displayType is
519
- <code> "normal"</code> .
523
+ which represents <a>inline-level</a> content, may fragment line by line if the <a for="layout
524
+ definition">child display</a> (set by <code> childDisplay </code> ) is <code> "normal"</code> .
520
525
521
526
A subsequent {{Fragment}} is produced by using the previous {{Fragment}} 's {{Fragment/breakToken}} .
522
527
This tells the <a>child layout</a> to produce a {{Fragment}} starting at the point encoded in the
@@ -537,7 +542,7 @@ resume the layout.
537
542
538
543
<pre class="lang-javascript">
539
544
registerLayout('basic-inline' , class {
540
- static displayType = 'normal' ;
545
+ static childDisplay = 'normal' ;
541
546
542
547
*layout(space, children, styleMap, edges, breakToken) {
543
548
// Resolve our inline size.
@@ -1137,6 +1142,7 @@ dictionary FragmentResultOptions {
1137
1142
double inlineSize = 0;
1138
1143
double blockSize = 0;
1139
1144
sequence<Fragment> childFragments = [];
1145
+ any data = null;
1140
1146
BreakTokenOptions breakToken = null;
1141
1147
};
1142
1148
@@ -1402,7 +1408,10 @@ following steps:
1402
1408
- The <a>fragmentation break</a> information set to |fragment|'s
1403
1409
{{FragmentResultOptions/breakToken}} .
1404
1410
1405
- TODO: storage of the break token.
1411
+ - Let |clonedData| be the result of invoking <a>StructuredSerializeForStorage</a> on
1412
+ |fragment|'s {{FragmentResultOptions/data}} .
1413
+
1414
+ The user agent must store |clonedData| with the <a>fragment</a> .
1406
1415
</div>
1407
1416
1408
1417
### Utility Algorithms ### {#utility-algorithms}
@@ -1520,7 +1529,9 @@ When the user agent wants to <dfn>run a generator</dfn> given |generator|, and |
1520
1529
<a>fragment</a> based on |layoutChild|, |childConstraintSpace|, and
1521
1530
|childBreakToken|.
1522
1531
1523
- 5. Let |result| be a new {{Fragment}} with:
1532
+ 5. Let |targetRealm| be |generator|'s <a>Realm</a> .
1533
+
1534
+ 6. Let |result| be a new {{Fragment}} with:
1524
1535
1525
1536
- {{Fragment/inlineSize}} being |internalFragment|'s <a>inline size</a> .
1526
1537
@@ -1533,6 +1544,10 @@ When the user agent wants to <dfn>run a generator</dfn> given |generator|, and |
1533
1544
- {{Fragment/breakToken}} being a new {{ChildBreakToken}} representing
1534
1545
|layoutChild|'s internal break token.
1535
1546
1547
+ - If |internalFragment| has a |clonedData| object stored with it, let
1548
+ {{Fragment/data}} being the result of
1549
+ <a>StructuredDeserialize</a> (|clonedData|, |targetRealm|), otherwise null.
1550
+
1536
1551
4. If |result| is null (that is neither of the above branches was taken), return
1537
1552
failure, and abort all these steps.
1538
1553
0 commit comments