@@ -405,6 +405,12 @@ interface LayoutFragment {
405
405
};
406
406
</pre>
407
407
408
+ The {{LayoutFragment}} has internal slot(s):
409
+ - <dfn attribute for=LayoutFragment>\[[layoutFragmentRequest]]</dfn> a
410
+ {{LayoutFragmentRequest}} , this is the fragment request which generated this fragment.
411
+
412
+ <hr>
413
+
408
414
A {{LayoutFragment}} represents a CSS <a>fragment</a> of a {{LayoutChild}} after layout has occurred
409
415
on that child. This is produced by the {{LayoutChild/layoutNextFragment()}} method.
410
416
@@ -493,6 +499,34 @@ particular child. The {{LayoutFragment/breakToken}} cannot be changed.
493
499
If the <a>current layout</a> requires a different {{LayoutFragment/breakToken}} the author must perform
494
500
{{LayoutChild/layoutNextFragment()}} again with different arguments.
495
501
502
+ <div algorithm>
503
+ When the user agent wants to <dfn>create a layout fragment</dfn> given |targetRealm|,
504
+ |layoutFragmentRequest|, and |internalFragment|, it <em> must</em> run the following steps:
505
+
506
+ 1. Let |fragment| be a new {{LayoutFragment}} with:
507
+
508
+ - The {{[[layoutFragmentRequest]]}} internal slot being |layoutFragmentRequest|.
509
+
510
+ - {{LayoutFragment/inlineSize}} being |internalFragment|'s <a>inline size</a> relative to
511
+ the <a>current layout's</a> writing mode.
512
+
513
+ - {{LayoutFragment/blockSize}} being |internalFragment|'s <a>block size</a> relative to the
514
+ <a>current layout's</a> writing mode.
515
+
516
+ - {{LayoutFragment/inlineOffset}} initially set to 0.
517
+
518
+ - {{LayoutFragment/blockOffset}} initially set to 0.
519
+
520
+ - {{LayoutFragment/breakToken}} being a new {{ChildBreakToken}} representing
521
+ |internalFragment|'s internal break token, if any.
522
+
523
+ - If |internalFragment| has a |clonedData| object stored with it, let
524
+ {{LayoutFragment/data}} being the result of
525
+ <a>StructuredDeserialize</a> (|clonedData|, |targetRealm|), otherwise null.
526
+
527
+ 2. Return |fragment|.
528
+ </div>
529
+
496
530
Intrinsic Sizes {#intrinsic-sizes}
497
531
----------------------------------
498
532
@@ -504,6 +538,13 @@ interface IntrinsicSizes {
504
538
};
505
539
</pre>
506
540
541
+ The {{IntrinsicSizes}} object has internal slot(s):
542
+ - <dfn attribute for=IntrinsicSizes>\[[intrinsicSizesRequest]]</dfn> a
543
+ {{IntrinsicSizesRequest}} , this is the intrinsic sizes request which generated these
544
+ intrinsic sizes.
545
+
546
+ <hr>
547
+
507
548
A {{IntrinsicSizes}} object represents the <a>min-content size</a> and <a>max-content size</a> of a
508
549
CSS <a>box</a> . It has {{IntrinsicSizes/minContentSize}} and {{IntrinsicSizes/maxContentSize}}
509
550
attributes which represent the <b> border box</b> min/max-content contribution of the {{LayoutChild}}
@@ -558,6 +599,23 @@ registerLayout('intrinsic-sizes-example', class {
558
599
</pre>
559
600
</div>
560
601
602
+ <div algorithm>
603
+ When the user agent wants to <dfn>create an intrinsic sizes object</dfn> given
604
+ |intrinsicSizesRequest|, and |internalIntrinsicSizes|, it <em> must</em> run the following steps:
605
+
606
+ 1. Let |intrinsicSizes| be a new {{IntrinsicSizes}} with:
607
+
608
+ - The {{[[intrinsicSizesRequest]]}} internal slot being |intrinsicSizesRequest|.
609
+
610
+ - {{IntrinsicSizes/minContentSize}} being |internalIntrinsicSizes|' <b> border box</b>
611
+ min-content contribution, relative to the <a>current layout's</a> writing mode.
612
+
613
+ - {{IntrinsicSizes/maxContentSize}} being |internalIntrinsicSizes|'s <b> border box</b>
614
+ max-content contribution, relative to the <a>current layout's</a> writing mode.
615
+
616
+ 2. Return |intrinsicSizes|.
617
+ </div>
618
+
561
619
Layout Constraints {#layout-constraints}
562
620
----------------------------------------
563
621
@@ -1921,13 +1979,11 @@ When the user agent wants to <dfn>run a generator</dfn> given |generator|, and |
1921
1979
1. Let |layoutChild| be the result of looking up the internal slot
1922
1980
<code> \[[layoutChild]] </code> on |request|.
1923
1981
1924
- 2. Let |result| be a new {{IntrinsicSizes}} with:
1925
-
1926
- - {{IntrinsicSizes/minContentSize}} being |layoutChild|'s <a>min-content
1927
- size</a> .
1982
+ 2. Let |internalIntrinsicSizes| be the result of the user agent calculating the
1983
+ <b> border box</b> min/max content contribution of |layoutChild|.
1928
1984
1929
- - {{IntrinsicSizes/maxContentSize}} being |layoutChild|'s <a>max-content
1930
- size</a> .
1985
+ 3. Let |result| be the result of <a>create an intrinsic sizes object</a> given
1986
+ |request|, and |internalIntrinsicSizes| .
1931
1987
1932
1988
3. If |request| is a {{LayoutFragmentRequest}} and |generatorType| is
1933
1989
<code> "layout"</code> then:
@@ -1947,22 +2003,8 @@ When the user agent wants to <dfn>run a generator</dfn> given |generator|, and |
1947
2003
1948
2004
5. Let |targetRealm| be |generator|'s <a>Realm</a> .
1949
2005
1950
- 6. Let |result| be a new {{LayoutFragment}} with:
1951
-
1952
- - {{LayoutFragment/inlineSize}} being |internalFragment|'s <a>inline size</a> .
1953
-
1954
- - {{LayoutFragment/blockSize}} being |internalFragment|'s <a>block size</a> .
1955
-
1956
- - {{LayoutFragment/inlineOffset}} initially set to 0.
1957
-
1958
- - {{LayoutFragment/blockOffset}} initially set to 0.
1959
-
1960
- - {{LayoutFragment/breakToken}} being a new {{ChildBreakToken}} representing
1961
- |layoutChild|'s internal break token.
1962
-
1963
- - If |internalFragment| has a |clonedData| object stored with it, let
1964
- {{LayoutFragment/data}} being the result of
1965
- <a>StructuredDeserialize</a> (|clonedData|, |targetRealm|), otherwise null.
2006
+ 6. Let |result| be the result of <a>create a layout fragment</a> given
2007
+ |targetRealm|, |request|, and |internalFragment|.
1966
2008
1967
2009
4. If |result| is null (that is neither of the above branches was taken), return
1968
2010
failure, and abort all these steps.
0 commit comments