8000 [css-layout-api] Add in box tree transformations section. · xidachen/css-houdini-drafts@b766894 · GitHub
Skip to content

Commit b766894

Browse files
committed
[css-layout-api] Add in box tree transformations section.
1 parent a5c6e32 commit b766894

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

css-layout-api/Overview.bs

+50-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ spec:css-break-3; type:dfn; text:fragment
3636
spec:css-display-3; type:dfn; text:box
3737
spec:css-display-3; type:value; for:display; text:none
3838
spec:css-display-3; type:value; for:<display-inside>; text:grid
39+
spec:css-display-3; type:value; for:<display-outside>; text:inline
3940
spec:css-pseudo-4; type:selector; text:::after
4041
spec:css-pseudo-4; type:selector; text:::before
4142
spec:css-pseudo-4; type:selector; text:::first-letter
@@ -90,7 +91,7 @@ The layout stage of CSS is responsible for generating and positioning <a>fragmen
9091
<a>box tree</a>.
9192

9293
This specification describes an API which allows developers to layout a <a>box</a> in response to
93-
computed style and <a>box</a> tree changes.
94+
computed style and <a>box tree</a> changes.
9495

9596
Layout API Containers {#layout-api-containers}
9697
==============================================
@@ -115,6 +116,9 @@ provided by the author is used instead of the block layout.
115116
For example, floats do not intrude into the layout API container, and the layout API container's
116117
margins do not collapse with the margins of its contents.
117118

119+
All inflow children of a <a>layout API container</a> are called <dfn>layout API children</dfn> and
120+
are laid out using the auther defined layout.
121+
118122
<a>Layout API containers</a> form a containing block for their contents
119123
<a href="https://www.w3.org/TR/CSS2/visudet.html#containing-block-details">exactly like block
120124
containers do</a>. [[!CSS21]]
@@ -136,6 +140,51 @@ the order in which they are returned from the layout method (via
136140
{{FragmentResultOptions/childFragments}}) is used in place of raw document order, and 'z-index'
137141
values other than ''z-index/auto'' create a stacking context even if 'position' is ''static''.
138142

143+
Box Tree Transformations {#layout-api-box-tree}
144+
-----------------------------------------------
145+
146+
The children of a <a>layout API container</a> can act in different ways depending on the value of <a
147+
for="document layout definition">child display</a> (set by <code>childDisplay</code> on the class).
148+
149+
If the value of <a for="document layout definition">child display</a> is <code>"block"</code> the
150+
'display' value of that child is <a>blockified</a>. This is similar to children of <a>flex
151+
containers</a> or <a>grid containers</a>. See [[!css3-display]].
152+
153+
If the value of <a for="document layout definition">child display</a> is <code>"normal"</code>, no
154+
<a>blockification</a> occurs. Instead children with a <<display-outside>> <a>computed value</a> of
155+
''inline'' (a <a>root inline box</a>) will produce a single {{Fragment}} representing each line when
156+
{{LayoutChild/layoutNextFragment()}} is called.
157+
158+
Note: This allows authors to adjust the available inline size of each line, and position each line
159+
separately.
160+
161+
Children of a {{LayoutChild}} which represents <a>root inline box</a> also have some additional
162+
transformations.
163+
164+
- A <a>block-level</a> box inside a <a>inline-level</a> box is <a>inlinified</a> I.e. its
165+
<<display-outside>> is set to ''inline''.
166+
167+
- A <a>float</a> inside a <a>inline-level</a> box is not taken out of flow. Instead it must be
168+
treated as inflow, and be <a>inlinified</a>.
169+
170+
In both of the above cases the children become <a>atomic inlines</a>.
171+
172+
Note: User agents would not perform any "inline splitting" or fragmenting when they encounter a
173+
<a>block-level</a> box.
174+
175+
<div class="note">
176+
Note: In the example below "inline-span" would be represented as a single {{LayoutChild}} with
177+
both "block" and "float" being <a>atomic inlines</a>.
178+
<pre class="lang-html">
179+
&lt;span id="inline-span">
180+
Text
181+
&lt;div id="block">&lt;/div>
182+
&lt;div id="float">&lt;/div>
183+
Text
184+
&lt;/span>
185+
</pre>
186+
</div>
187+
139188
Layout API Model and Terminology {#layout-api-model-and-terminology}
140189
====================================================================
141190

0 commit comments

Comments
 (0)