@@ -44,13 +44,10 @@ Layout Boxes {#layout-boxes}
44
44
<pre class='idl'>
45
45
interface Box {
46
46
readonly attribute ComputedStylePropertyMapReadOnly styleMap;
47
- FragmentRequestToken doLayout(ConstraintSpace space, ChildBreakToken breakToken);
47
+ FragmentRequestToken doLayout(DerivedConstraintSpace space, ChildBreakToken breakToken);
48
48
};
49
49
</pre>
50
50
51
- Issue(w3c/css-houdini-drafts#254): We may want a different name for the {{Box}} concept. In this
52
- context box has no layout information only style.
53
-
54
51
A {{Box}} represents a CSS generated <a>box</a> before any layout has occurred. (The box will have a
55
52
computed value of 'display' that is not ''none'' ). The {{Box}} does not contain any layout
56
53
information itself (like inline or block size) but can be used to generate {{Fragment}} s which do
@@ -182,10 +179,10 @@ registerLayout('block-like', class {
182
179
183
180
The {{Fragment}} 's {{Fragment/breakToken}} specifies where the {{Box}} last fragmented. If the
184
181
{{Fragment/breakToken}} is null the {{Box}} cannot produce any more {{Fragment}} s. The
185
- {{Fragment/breakToken}} can be passed to the << doLayout()>> function to produce the next
182
+ {{Fragment/breakToken}} can be passed to the {{Box/ doLayout()}} function to produce the next
186
183
{{Fragment}} for a particular {{Box}} . The {{Fragment/breakToken}} cannot be changed. If the
187
184
<a>current layout</a> requires a different {{Fragment/breakToken}} the author must perform
188
- << doLayout()>> again with different arguments.
185
+ {{Box/ doLayout()}} again with different arguments.
189
186
190
187
The {{Fragment}} 's {{Fragment/dominantBaseline}} , {{Fragment/alphabeticBaseline}} , and
191
188
{{Fragment/centerBaseline}} attributes specify where all the baselines for the {{Fragment}} are
@@ -212,10 +209,10 @@ interface ConstraintSpace {
212
209
readonly attribute double inlinePercentResolutionSize;
213
210
readonly attribute double blockPercentResolutionSize;
214
211
215
- readonly attribute double? inlineScrollTriggerOffset ;
216
- readonly attribute double? blockScrollTriggerOffset ;
212
+ readonly attribute boolean inlineScrollTrigger ;
213
+ readonly attribute boolean blockScrollTrigger ;
217
214
218
- readonly attribute double? blockFragmentationOffset ;
215
+ readonly attribute boolean blockFragmentation ;
219
216
readonly attribute BlockFragmentationType blockFragmentationType;
220
217
};
221
218
@@ -229,10 +226,10 @@ dictionary ConstraintSpaceOptions {
229
226
double inlinePercentResolutionSize = null;
230
227
double blockPercentResolutionSize = null;
231
228
232
- double inlineScrollTriggerOffset = null ;
233
- double blockScrollTriggerOffset = null ;
229
+ boolean inlineScrollTrigger = false ;
230
+ boolean blockScrollTrigger = false ;
234
231
235
- double blockFragmentationOffset = null ;
232
+ double blockFragmentation = false ;
236
233
BlockFragmentationType blockFragmentationType = "none";
237
234
};
238
235
@@ -313,11 +310,11 @@ The {{ConstraintSpace}} has {{ConstraintSpace/inlinePercentResolutionSize}} and
313
310
{{ConstraintSpace/blockPercentResolutionSize}} attributes. These represent the size that a layout
314
311
percentages should be resolved against while performing layout.
315
312
316
- The {{ConstraintSpace}} has {{ConstraintSpace/inlineScrollTriggerOffset }} and
317
- {{ConstraintSpace/blockScrollTriggerOffset }} attributes. The <a>current layout</a> can use this
313
+ The {{ConstraintSpace}} has {{ConstraintSpace/inlineScrollTrigger }} and
314
+ {{ConstraintSpace/blockScrollTrigger }} attributes. The <a>current layout</a> can use this
318
315
information to early opt-out of a layout if it knows it will require additional space for a scroll
319
- bar in that direction. If either the {{ConstraintSpace/inlineScrollTriggerOffset }} or
320
- {{ConstraintSpace/blockScrollTriggerOffset }} attributes are null the <a>current layout</a> can
316
+ bar in that direction. If either the {{ConstraintSpace/inlineScrollTrigger }} or
317
+ {{ConstraintSpace/blockScrollTrigger }} attributes are null the <a>current layout</a> can
321
318
assume it does not need to report to the parent layout that it will require a scroll bar in that
322
319
direction.
323
320
@@ -343,26 +340,49 @@ provided to a <a>current layout</a>.
343
340
<td>
344
341
<pre>
345
342
ConstraintSpace {
346
- inlineSize = 100,
347
- blockSize = 100,
348
- blockScrollTriggerOffset = 100
343
+ inlineSize = 120
344
+ blockSize = 120
349
345
}
350
346
</pre>
351
347
</td>
352
348
<td>
353
349
<pre>
354
350
ConstraintSpace {
355
- inlineSize = 100,
356
- blockSize = 100,
357
- blockScrollTriggerOffset = 100
351
+ inlineSize = 120
352
+ blockSize = 100
353
+ blockScrollTrigger = true
358
354
}
359
355
</pre>
360
356
</td>
361
357
</tr>
358
+ <tr>
359
+ <td><img style="height: 50%; text-align: center;" src="images/constraint_space_1.png"></img></td>
360
+ <td><img style="height: 50%; text-align: center;" src="images/constraint_space_2.png"></img></td>
361
+ </tr>
362
362
<tr>
363
363
<td>
364
- TODO add image.
364
+ <pre>
365
+ ConstraintSpace {
366
+ inlineSize = 140
367
+ blockSize = 100
368
+ inlineScrollTrigger = true
369
+ blockScrollTrigger = true
370
+ }
371
+ </pre>
365
372
</td>
373
+ <td>
374
+ <pre>
375
+ ConstraintSpace {
376
+ inlineSize = 140
377
+ blockSize = 100
378
+ blockFragmentation = true
379
+ }
380
+ </pre>
381
+ </td>
382
+ </tr>
383
+ <tr>
384
+ <td><img style="height: 50%; text-align: center;" src="images/constraint_space_3.png"></img></td>
385
+ <td><img style="height: 50%; text-align: center;" src="images/constraint_space_4.png"></img></td>
366
386
</tr>
367
387
</tbody>
368
388
</table>
@@ -391,8 +411,7 @@ registerLayout('block-like-with-scroll', class {
391
411
392
412
// Early opt-out of layout algorithm if we triggered a scroll in the
393
413
// block direction.
394
- if (space.blockScrollTriggerOffset != null &&
395
- space.blockScrollTriggerOffset < blockOffset) {
414
+ if (space.blockScrollTrigger && space.blockSize < blockOffset) {
396
415
return {blockScrollTriggered: true};
397
416
}
398
417
}
@@ -410,9 +429,9 @@ registerLayout('block-like-with-scroll', class {
410
429
</pre>
411
430
</div>
412
431
413
- The {{ConstraintSpace}} has {{ConstraintSpace/blockFragmentationOffset }} and
432
+ The {{ConstraintSpace}} has {{ConstraintSpace/blockFragmentation }} and
414
433
{{ConstraintSpace/blockFragmentationType}} attributes. The <a>current layout</a> should produce a
415
- {{Fragment}} which fragments at this offset if possible.
434
+ {{Fragment}} which fragments at the {{ConstraintSpace/blockSize}} if possible.
416
435
417
436
The <a>current layout</a> may choose not to fragment a child {{Box}} based on the
418
437
{{ConstraintSpace/blockFragmentationType}} if the child has a property like ''break-inside:
@@ -426,15 +445,16 @@ partial interface ConstraintSpace {
426
445
void addExclusion(Exclusion exclusion, optional ExclusionOptions options);
427
446
428
447
sequence<Exclusion> getExclusions(optional ExclusionOptions options);
429
- Exclusion getLastExclusion(optional ExclusionOptions options);
430
448
};
431
449
432
- enum ExclusionTag { "fragment", "exclusion", "float" };
450
+ enum ExclusionTag { "fragment", "exclusion", "float-left", "float-right " };
433
451
enum ExclusionType { "none", "inline-flow", "inline-start", "inline-end", "inline-both" };
452
+ enum ExclusionBox { "none", "border", "margin" };
434
453
435
454
dictionary ExclusionOptions {
436
455
ExclusionTag tag = "fragment";
437
456
ExclusionType type = "none"; // default to "inline-flow" instead?
457
+ ExclusionBox box = "none"; // TODO needed?
438
458
};
439
459
440
460
interface Exclusion {
@@ -562,14 +582,14 @@ dictionary BreakTokenOptions {
562
582
Object data = null;
563
583
};
564
584
565
- enum BreakType { "none", "line ", "column", "page", "region" };
585
+ enum BreakType { "none", "inline", "inline-hyphen ", "column", "page", "region" };
566
586
</pre>
567
587
568
588
Issue(w3c/css-houdini-drafts#258): What type of {{BreakType}} s are needed?
569
589
570
590
A {{Box}} can produce multiple {{Fragment}} s. A {{Box}} may fragment in the block direction if a
571
- {{ConstraintSpace/blockFragmentationOffset }} is present in the {{ConstraintSpace}} . It may fragment
572
- in the inline direction if it is an inline layout.
591
+ {{ConstraintSpace/blockFragmentation }} is true. It may fragment in the inline direction if it is an
592
+ inline layout.
573
593
574
594
A subsequent {{Fragment}} is produced by using the previous {{Fragment}} 's {{Fragment/breakToken}} .
575
595
This tells the <a>child layout</a> to produce a {{Fragment}} starting at the point encoded in the
0 commit comments