@@ -44,13 +44,10 @@ Layout Boxes {#layout-boxes}
4444<pre class='idl'>
4545interface Box {
4646 readonly attribute ComputedStylePropertyMapReadOnly styleMap;
47- FragmentRequestToken doLayout(ConstraintSpace space, ChildBreakToken breakToken);
47+ FragmentRequestToken doLayout(DerivedConstraintSpace space, ChildBreakToken breakToken);
4848};
4949</pre>
5050
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-
5451A {{Box}} represents a CSS generated <a>box</a> before any layout has occurred. (The box will have a
5552computed value of 'display' that is not ''none'' ). The {{Box}} does not contain any layout
5653information itself (like inline or block size) but can be used to generate {{Fragment}} s which do
@@ -182,10 +179,10 @@ registerLayout('block-like', class {
182179
183180The {{Fragment}} 's {{Fragment/breakToken}} specifies where the {{Box}} last fragmented. If the
184181{{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
186183{{Fragment}} for a particular {{Box}} . The {{Fragment/breakToken}} cannot be changed. If the
187184<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.
189186
190187The {{Fragment}} 's {{Fragment/dominantBaseline}} , {{Fragment/alphabeticBaseline}} , and
191188{{Fragment/centerBaseline}} attributes specify where all the baselines for the {{Fragment}} are
@@ -212,10 +209,10 @@ interface ConstraintSpace {
212209 readonly attribute double inlinePercentResolutionSize;
213210 readonly attribute double blockPercentResolutionSize;
214211
215- readonly attribute double? inlineScrollTriggerOffset ;
216- readonly attribute double? blockScrollTriggerOffset ;
212+ readonly attribute boolean inlineScrollTrigger ;
213+ readonly attribute boolean blockScrollTrigger ;
217214
218- readonly attribute double? blockFragmentationOffset ;
215+ readonly attribute boolean blockFragmentation ;
219216 readonly attribute BlockFragmentationType blockFragmentationType;
220217};
221218
@@ -229,10 +226,10 @@ dictionary ConstraintSpaceOptions {
229226 double inlinePercentResolutionSize = null;
230227 double blockPercentResolutionSize = null;
231228
232- double inlineScrollTriggerOffset = null ;
233- double blockScrollTriggerOffset = null ;
229+ boolean inlineScrollTrigger = false ;
230+ boolean blockScrollTrigger = false ;
234231
235- double blockFragmentationOffset = null ;
232+ double blockFragmentation = false ;
236233 BlockFragmentationType blockFragmentationType = "none";
237234};
238235
@@ -313,11 +310,11 @@ The {{ConstraintSpace}} has {{ConstraintSpace/inlinePercentResolutionSize}} and
313310{{ConstraintSpace/blockPercentResolutionSize}} attributes. These represent the size that a layout
314311percentages should be resolved against while performing layout.
315312
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
318315information 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
321318assume it does not need to report to the parent layout that it will require a scroll bar in that
322319direction.
323320
@@ -343,26 +340,49 @@ provided to a <a>current layout</a>.
343340 <td>
344341 <pre>
345342 ConstraintSpace {
346- inlineSize = 100,
347- blockSize = 100,
348- blockScrollTriggerOffset = 100
343+ inlineSize = 120
344+ blockSize = 120
349345 }
350346 </pre>
351347 </td>
352348 <td>
353349 <pre>
354350 ConstraintSpace {
355- inlineSize = 100,
356- blockSize = 100,
357- blockScrollTriggerOffset = 100
351+ inlineSize = 120
352+ blockSize = 100
353+ blockScrollTrigger = true
358354 }
359355 </pre>
360356 </td>
361357 </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>
362362 <tr>
363363 <td>
364- TODO add image.
364+ <pre>
365+ ConstraintSpace {
366+ inlineSize = 140
367+ blockSize = 100
368+ inlineScrollTrigger = true
369+ blockScrollTrigger = true
370+ }
371+ </pre>
365372 </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>
366386 </tr>
367387 </tbody>
368388</table>
@@ -391,8 +411,7 @@ registerLayout('block-like-with-scroll', class {
391411
392412 // Early opt-out of layout algorithm if we triggered a scroll in the
393413 // block direction.
394- if (space.blockScrollTriggerOffset != null &&
395- space.blockScrollTriggerOffset < blockOffset) {
414+ if (space.blockScrollTrigger && space.blockSize < blockOffset) {
396415 return {blockScrollTriggered: true};
397416 }
398417 }
@@ -410,9 +429,9 @@ registerLayout('block-like-with-scroll', class {
410429</pre>
411430</div>
412431
413- The {{ConstraintSpace}} has {{ConstraintSpace/blockFragmentationOffset }} and
432+ The {{ConstraintSpace}} has {{ConstraintSpace/blockFragmentation }} and
414433{{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.
416435
417436The <a>current layout</a> may choose not to fragment a child {{Box}} based on the
418437{{ConstraintSpace/blockFragmentationType}} if the child has a property like ''break-inside:
@@ -426,15 +445,16 @@ partial interface ConstraintSpace {
426445 void addExclusion(Exclusion exclusion, optional ExclusionOptions options);
427446
428447 sequence<Exclusion> getExclusions(optional ExclusionOptions options);
429- Exclusion getLastExclusion(optional ExclusionOptions options);
430448};
431449
432- enum ExclusionTag { "fragment", "exclusion", "float" };
450+ enum ExclusionTag { "fragment", "exclusion", "float-left", "float-right " };
433451enum ExclusionType { "none", "inline-flow", "inline-start", "inline-end", "inline-both" };
452+ enum ExclusionBox { "none", "border", "margin" };
434453
435454dictionary ExclusionOptions {
436455 ExclusionTag tag = "fragment";
437456 ExclusionType type = "none"; // default to "inline-flow" instead?
457+ ExclusionBox box = "none"; // TODO needed?
438458};
439459
440460interface Exclusion {
@@ -562,14 +582,14 @@ dictionary BreakTokenOptions {
562582 Object data = null;
563583};
564584
565- enum BreakType { "none", "line ", "column", "page", "region" };
585+ enum BreakType { "none", "inline", "inline-hyphen ", "column", "page", "region" };
566586</pre>
567587
568588Issue(w3c/css-houdini-drafts#258): What type of {{BreakType}} s are needed?
569589
570590A {{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.
573593
574594A subsequent {{Fragment}} is produced by using the previous {{Fragment}} 's {{Fragment/breakToken}} .
575595This tells the <a>child layout</a> to produce a {{Fragment}} starting at the point encoded in the
0 commit comments