@@ -236,26 +236,68 @@ Layout Containment</h3>
236236
237237 1. The element [=establishes an independent formatting context=] .
238238
239- 2. If a <a>fragmentation context</a> participates in <a>layout containment</a> ,
240- the first element with <a>layout containment</a>
241- affecting the <a>fragmentation context</a>
242- must “trap” the remainder of the <a>fragmented flow</a> .
243- <a>Fragmentation</a> must not continue past the <a>layout containment</a> boundary,
244- and the last <a>fragmentation container</a>
245- within the first <a>layout containment</a> boundary
246- is treated as if it is the last <a>fragmentation container</a>
247- in its <a>fragmentation context</a> .
248-
249- If subsequent <a>fragmentation containers</a> in the <a>fragmentation context</a>
250- are only generated when more content remains in the <a>fragmented flow</a> ,
239+ 2. If at least one [=fragmentation container=] of a [=fragmentation context=] has [=layout containment=] ,
240+ or if at least one [=fragmentation container=] of a [=fragmentation context=] is a descendant of an element with layout containment
241+ <strong> and</strong> at least one subsequent [=fragmentation container=] of the same [=fragmentation context=]
242+ is not a descendant of that same element with layout containment,
243+ then the first element with [=layout containment=]
244+ which is either a [=fragmentation container=] itself
245+ or is an ancestor of a [=fragmentation container=]
246+ must “trap” the remainder of the [=fragmented flow=] :
247+ [=fragmentation=] must not continue past the [=layout containment=] boundary,
248+ and the last [=fragmentation container=]
249+ within the first [=layout containment=] boundary
250+ is treated as if it is the last [=fragmentation container=]
251+ in its [=fragmentation context=] .
252+
253+ If subsequent [=fragmentation containers=] in the [=fragmentation context=]
254+ are only generated when more content remains in the [=fragmented flow=] ,
251255 then they are not generated.
252256 If they would exist regardless,
253- they remain part of the <a>fragmentation context</a> ,
254- but do not receive any content from the <a>fragmented flow</a> .
255-
256- Note: [[CSS-REGIONS-1]] has details over how <a>layout containment</a> affects
257+ they remain part of the [=fragmentation context=] ,
258+ but do not receive any content from the [=fragmented flow=] .
259+
260+ Note: At the time of writing, no stable specification is affected by this point.
261+ Only specifications that would enable some (but not all) fragmentation containers of a fragmentation context
262+ to be layout-contained (or descendants of a layout contained element)
263+ are concerned.
264+ This is not the case of [[CSS-PAGE-3]] nor of [[CSS-MULTICOL-1]] .
265+ This requirement is nonetheless included because
266+ several mechanisms that would make this a possibility have been considered
267+ (e.g.: [[CSS-REGIONS-1]] , ''::nth-fragment()'' , a hypothetical selector for individual columns of a multicol…),
268+ and the guarantees that layout containment is intended to offer would not be realized
269+ if such mechanisms did not abide by this rule.
270+ [[CSS-REGIONS-1]] has details over how <a>layout containment</a> affects
257271 regions.
258272
273+ <div class=example>
274+ <pre><code highlight=markup>
275+ <article>Lorem ipsum…</article>
276+ <div id=a></div>
277+ <aside>
278+ <div id=b></div>
279+ <div id=c></div>
280+ </aside>
281+ <aside>
282+ <div id=d></div>
283+ <div id=e></div>
284+ </aside>
285+ <div id=f></div>
286+ </code></pre>
287+ <pre><code highlight=css>
288+ article {flow-into: foo;}
289+ #a, #b, #c, #d, #e, #f {flow-from: foo;}
290+ aside {contain: layout}
291+ </code></pre>
292+
293+ In this [[CSS-REGIONS-1]] example,
294+ content can flow from <code> #a</code> to <code> #b</code> ,
295+ from <code> #b</code> to <code> #c</code> .
296+ However as <code> #c</code> is the last fragment container in the first layout-contained element,
297+ it traps all the remaining content,
298+ and nothing gets flowed into <code> #d</code> , <code> #e</code> , or <code> #f</code> .
299+ </div>
300+
259301 3. If the contents of the element overflow the element,
260302 they must be treated as <a>ink overflow</a> .
261303
0 commit comments