8000 csswg-drafts/css-regions/Overview.html at 77985a22933fafc6889a4aa812df0dd90c2f81f1 · w3c/csswg-drafts · GitHub
Skip to content

Latest commit

 

History

History
executable file
·
3561 lines (2803 loc) · 137 KB

File metadata and controls

executable file
·
3561 lines (2803 loc) · 137 KB
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang=en>
<head
profile="http://dublincore.org/documents/2008/08/04/dc-html/ http://www.w3.org/2006/03/hcard">
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
<title>CSS Regions Module Level 1</title>
<link href="http://purl.org/dc/terms/" rel=schema.dcterms>
<link href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=dcterms.rights>
<meta content="CSS Regions Module Level 1" name=dcterms.title>
<meta content=text name=dcterms.type>
<meta content=2013-06-25 name=dcterms.date>
<meta content="Vincent Hardy" name=dcterms.creator>
<meta content="Rossen Atanassov" name=dcterms.creator>
<meta content="Alan Stearns" name=dcterms.creator>
<meta content=W3C name=dcterms.publisher>
<meta content="http://dev.w3.org/csswg/css3-regions/"
name=dcterms.identifier>
<link href="../shared/style/default.css" rel=stylesheet type="text/css">
<script defer=defer
src="http://test.csswg.org/harness/annotate.js#CSS3-REGIONS_DEV"
type="text/javascript"></script>
<style type="text/css">
#region-style-example p, #region-style-example pre {
clear: both;
}
#region_styling_illustration {
margin: 0px auto;
width: 70ex;
}
</style>
<link href="http://www.w F99D 3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
type="text/css">
<link href="../shared/style/issues.css" rel=stylesheet type="text/css">
<link href="../shared/style/alternate-spec-style.css" id=st rel=stylesheet
title="alternate spec style" type="text/css">
<body>
<div class=head id=div-head>
<p><a href="http://www.w3.org/"><img alt=W3C height=53 id=mobile-logo
src="http://www.w3.org/2008/site/images/logo-w3c-mobile-lg" width=90></a>
<!--begin-logo-->
<p><a href="http://www.w3.org/"><img alt=W3C height=48
src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
<h1 id=css-regions-module>CSS Regions Module Level 1</h1>
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 25 June 2013</h2>
<dl>
<dt>This version:
<dd><a
href="http://dev.w3.org/csswg/css3-regions/">http://dev.w3.org/csswg/css3-regions</a>
<dt>Latest version:
<dd><a
href="http://www.w3.org/TR/css3-regions/">http://www.w3.org/TR/css3-regions/</a>
<dt>Previous version:
<dd><a
href="http://www.w3.org/TR/2012/WD-css3-regions-20120823/">http://www.w3.org/TR/2012/WD-css3-regions-20120823/</a>
<dt>Editors:
<dd class=vcard><span class=fn>Vincent Hardy</span>, <span
class=org>Adobe Systems, Inc.</span>, <span
class=email>vhardy@adobe.com</span>
<dd class=vcard><span class=fn>Rossen Atanassov</span>, <span
class=org>Microsoft Corporation</span>, <span
class=email>ratan@microsoft.com</span>
<dd class=vcard><span class=fn>Alan Stearns</span>, <span class=org>Adobe
Systems, Inc.</span>, <span class=email>stearns@adobe.com</span>
<dt>Authors and former editors:
<dd class=vcard><span class=fn>Alex Mogilevsky</span>, <span
class=org>Microsoft Corporation</span>, <span
class=email>alexmog@microsoft.com</span>
<dt>Issues List:
<dd><a
href="https://www.w3.org/Bugs/Public/buglist.cgi?product=CSS&amp;component=Regions&amp;resolution=---">Bugzilla
Bugs for CSS regions</a>
<dt>Feedback:
<dd><a
href="mailto:www-style@w3.org?subject=%5Bcss-regions%5D%20feedback">www-style@w3.org</a>
with subject line “<kbd>[css-regions] <var>… message topic
…</var></kbd>” (<a
href="http://lists.w3.org/Archives/Public/www-style/"
rel=discussion>archives</a>)
</dl>
<!--begin-copyright-->
<p class=copyright><a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=license>Copyright</a> © 2013 <a href="http://www.w3.org/"><abbr
title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
href="http://www.csail.mit.edu/"><abbr
title="Massachusetts Institute of Technology">MIT</abbr></a>, <a
href="http://www.ercim.eu/"><abbr
title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
<a href="http://www.keio.ac.jp/">Keio</a>, <a
href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C <a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a
href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
and <a
href="http://www.w3.org/Consortium/Legal/copyright-documents">document
use</a> rules apply.</p>
<!--end-copyright-->
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc" id=abstract>Abstract</h2>
<p>The CSS regions module allows content to flow across multiple areas
called regions. The regions are not necessarily contiguous in the document
order. The CSS regions module provides an advanced content flow mechanism,
which can be combined with positioning schemes as defined by other CSS
modules such as the Multi-Column Module <a href="#CSS3COL"
rel=biblioentry>[CSS3COL]<!--{{CSS3COL}}--></a> or the Grid Layout Module
<a href="#CSS3-GRID-LAYOUT"
rel=biblioentry>[CSS3-GRID-LAYOUT]<!--{{CSS3-GRID-LAYOUT}}--></a> to
position the regions where content flows.
<h2 class="no-num no-toc" id=status-of-this-document>Status of this
document</h2>
<p class="big note"><span class=note-prefix>Note </span>This document uses
an experimental style sheet. We welcome your feedback on the styles at <a
href="mailto:site-comments@w3.org">site-comments@w3.org</a>.</p>
<!--begin-status-->
<p>This is a public copy of the editors' draft. It is provided for
discussion only and may change at any moment. Its publication here does
not imply endorsement of its contents by W3C. Don't cite this document
other than as work in progress.
<p>The (<a
href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
mailing list <a
href="mailto:www-style@w3.org?Subject=%5Bcss3-regions%5D%20PUT%20SUBJECT%20HERE">
www-style@w3.org</a> (see <a
href="http://www.w3.org/Mail/Request">instructions</a>) is preferred for
discussion of this specification. When sending e-mail, please put the text
“css3-regions” in the subject, preferably like this:
“[<!---->css3-regions<!---->] <em>…summary of comment…</em>”
<p>This document was produced by the <a
href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of
the <a href="http://www.w3.org/Style/">Style Activity</a>).
<p>This document was produced by a group operating under the <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
2004 W3C Patent Policy</a>. W3C maintains a <a
href="http://www.w3.org/2004/01/pp-impl/32061/status"
rel=disclosure>public list of any patent disclosures</a> made in
connection with the deliverables of the group; that page also includes
instructions for disclosing a patent. An individual who has actual
knowledge of a patent which the individual believes contains <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
6 of the W3C Patent Policy</a>.</p>
<!--end-status-->
<p>This draft is related to the drafts about Multi-column Layout <a
href="#CSS3COL" rel=biblioentry>[CSS3COL]<!--{{CSS3COL}}--></a>, Grid
Layout <a href="#CSS3GRID"
rel=biblioentry>[CSS3GRID]<!--{{CSS3GRID}}--></a>, Flexible Box Layout <a
href="#CSS3-FLEXBOX"
rel=biblioentry>[CSS3-FLEXBOX]<!--{{CSS3-FLEXBOX}}--></a>, and Template
Layout <a href="#CSS3LAYOUT"
rel=biblioentry>[CSS3LAYOUT]<!--{{CSS3LAYOUT}}--></a>.
<h2 class="no-num no-toc" id=table-of-contents>Table of contents</h2>
<!--begin-toc-->
<ul class=toc>
<li><a href="#introduction"><span class=secno>1. </span>Introduction</a>
<ul class=toc>
<li><a href="#named-flows-and-regions"><span class=secno>1.1.
</span>Named flows and region chains</a>
<li><a href="#region-styling"><span class=secno>1.2. </span>CSS Region
names and styling</a>
</ul>
<li><a href="#css-regions-concepts"><span class=secno>2. </span>CSS
regions concepts</a>
<ul class=toc>
<li><a href="#regions"><span class=secno>2.1. </span>Regions</a>
<li><a href="#region-chain"><span class=secno>2.2. </span>Region
chain</a>
<li><a href="#named-flow"><span class=secno>2.3. </span>Named flows</a>
<li><a href="#regions-flow-breaking-rules"><span class=secno>2.4.
</span>Regions flow breaking rules</a>
</ul>
<li><a href="#properties-and-region-styling"><span class=secno>3.
</span>Properties and Region Styling</a>
<ul class=toc>
<li><a href="#the-flow-into-property"><span class=secno>3.1. </span>The
‘<code class=property>flow-into</code>’ property</a>
<li><a href="#the-flow-from-property"><span class=secno>3.2. </span>The
‘<code class=property>flow-from</code>’ property</a>
<ul class=toc>
<li><a href="#circular-dependencies"><span class=secno>3.2.1.
</span>Cycle Detection</a>
<li><a href="#fragmenting-regions"><span class=secno>3.2.2.
</span>Nested fragmentation contexts</a>
</ul>
<li><a href="#region-flow-break"><span class=secno>3.3. </span>Region
flow break properties: ‘<code class=property>break-before</code>’,
‘<code class=property>break-after</code>’, ‘<code
class=property>break-inside</code>’</a>
<li><a href="#the-region-fragment-property"><span class=secno>3.4.
</span>The region-fragment property</a>
<li><a href="#the-region-pseudo-element"><span class=secno>3.5.
</span>The ::region() functional pseudo-element</a>
</ul>
<li><a href="#multi-column-regions"><span class=secno>4.
</span>Multi-column regions</a>
<li><a href="#pseudo_elements"><span class=secno>5.
</span>Pseudo-elements</a>
<ul class=toc>
<li><a href="#processing-model"><span class=secno>5.1. </span>Processing
model</a>
</ul>
<li><a href="#cssom_view_and_css_regions"><span class=secno>6.
</span>CSSOM</a>
<ul class=toc>
<li><a href="#the-namedflow-interface"><span class=secno>6.1. </span>The
NamedFlow interface</a>
<li><a href="#the-region-interface"><span class=secno>6.2. </span>The
Region interface</a>
<li><a href="#named-flow-events"><span class=secno>6.3. </span>Named
flow events</a>
<li><a href="#cssomview-and-regions"><span class=secno>6.4.
</span>Clarifications on pre-existing APIs</a>
<ul class=toc>
<li><a
href="#cssomview-getclientrects-and-getboundingclient 1223 rect"><span
class=secno>6.4.1. </span><code class=idl>getClientRects()</code> and
<code>getBoundingClientRects()</code></a>
<li><a href="#cssomview-offset-attributes"><span class=secno>6.4.2.
</span><code class=idl>offsetTop</code>, <code
class=idl>offsetLeft</code>, <code class=idl>offsetWidth</code>,
<code class=idl>offsetHeight</code> and <code
class=idl>offsetParent</code></a>
</ul>
</ul>
<li><a href="#regions-visual-formatting-details"><span class=secno>7.
</span>Regions visual formatting details</a>
<ul class=toc>
<li><a href="#regions-flow-content-box"><span class=secno>7.1.
</span>The Region Flow Content Box (RFCB)</a>
<ul class=toc>
<li><a href="#rfcb-width-resolution"><span class=secno>7.1.1.
</span>RFCB ‘<code class=property>width</code>’ resolution</a>
</ul>
<li><a href="#regions-visual-formatting-steps"><span class=secno>7.2.
</span>Regions visual formatting steps</a>
<ul class=toc>
<li><a href="#rfcb-flow-fragment-height-resolution"><span
class=secno>7.2.1. </span>Step 1: RFCB flow fragment height
resolution</a>
<ul class=toc>
<li><a href="#rfcb-flow-fragment-height-resolution-phase-1"><span
class=secno>7.2.1.1. </span>RFCB flow fragment height resolution,
Phase 1</a>
<li><a href="#rfcb-flow-fragment-height-resolution-phase-2"><span
class=secno>7.2.1.2. </span>RFCB flow fragment height resolution,
Phase 2</a>
</ul>
<li><a href="#regions-boxes-layout"><span class=secno>7.2.2.
</span>Step 2: region boxes layout</a>
<li><a href="#named-flows-layout"><span class=secno>7.2.3. </span>Step
3: named flows layout</a>
</ul>
<li><a href="#regions-visual-formatting-implementation-note"><span
class=secno>7.3. </span>Regions visual formatting: implementation
note</a>
<li><a href="#regions-visual-formatting-examples"><span class=secno>7.4.
</span>Regions visual formatting example</a>
<ul class=toc>
<li><a href="#step-1--phase-1-laying-out-rfcbs-with-us"><span
class=secno>7.4.1. </span>Step 1 - Phase 1: Laying out RFCBs with
used height of zero</a>
<li><a href="#step-1--phase-2-layout-flow-to-compute-t"><span
class=secno>7.4.2. </span>Step 1 - Phase 2: Layout flow to compute
the RFCBs' flow fragments heights</a>
<li><a href="#step-2-layout-document-and-regions-witho"><span
class=secno>7.4.3. </span>Step 2: Layout document and regions without
named flows</a>
<li><a href="#step-3-named-flows-layout"><span class=secno>7.4.4.
</span>Step 3: named flows layout</a>
</ul>
</ul>
<li><a href="#relation-to-document-events"><span class=secno>8.
</span>Relation to document events</a>
<li><a href="#relation-to-other-specifications"><span class=secno>9.
</span>Relation to other specifications</a>
<li><a href="#usecases"><span class=secno>10. </span>Use Cases</a>
<li><a href="#conformance"><span class=secno>11. </span>Conformance</a>
<li><a href="#changes"><span class=secno>12. </span>Changes</a>
<ul class=toc>
<li><a href="#changes_from_Aug_28_2012"><span class=secno>12.1.
</span>Changes from May 28<sup>th</sup> 2013 version</a>
<li><a href="#changes_from_Aug_28_2012"><span class=secno>12.2.
</span>Changes from August 28<sup>th</sup> 2012 version</a>
<li><a href="#changes_from_May_03_2012"><span class=secno>12.3.
</span>Changes from May 3<sup>rd</sup> 2012 version</a>
<li><a href="#older_changes"><span class=secno>12.4. </span>Older
Changes</a>
</ul>
<li class=no-num><a href="#acknowledgments">Acknowledgments</a>
<li class=no-num><a href="#intro-example-code">Appendix A. Example Code
for Introduction</a>
<li class=no-num><a href="#references">References</a>
<ul class=toc>
<li class=no-num><a href="#normative-references">Normative
references</a>
<li class=no-num><a href="#other-references">Other references</a>
</ul>
<li class=no-num><a href="#index">Index</a>
<li class=no-num><a href="#property-index">Property index</a>
</ul>
<!--end-toc-->
<h2 id=introduction><span class=secno>1. </span>Introduction</h2>
<p><em>This section is non-normative.</em>
<p>Displaying the complex layouts of a typical magazine, newspaper, or
textbook on the web requires capabilities beyond those available in
existing CSS modules. Dynamic magazine layout in particular requires
flexibility in placement of boxes for content flows. Th 9D55 is is the purpose
of the CSS regions module.
<div class=issue-marker data-bug_id=15733 data-bug_status=NEW> <a
href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15733">Issue-15733</a>
<div class=issue-details>
<p class=short-desc>Should the region specification define a mechanism to
create blocks that can be regions with CSS syntax?
</div>
</div>
<p>For more complex layouts, content needs to flow from one area of the
page to the next without limitation on the areas' sizes and positions.
These arbitrary areas are the target of specific content flows which this
document calls <a href="#named-flow0">named flows</a>. Each <a
href="#named-flow0">named flow</a> can be associated with a set of CSS
Regions called a region chain. CSS Regions are based on the rectangular
geometry of the CSS box model. Content in a <a href="#named-flow0">named
flow</a> is taken out of the normal visual formatting and rendered in a
chain of CSS Regions.
<h3 id=named-flows-and-regions><span class=secno>1.1. </span>Named flows
and region chains</h3>
<p>Consider the layout illustrated in figure 1.
<div class=figure> <img
alt="multiple chained regions which should receive content from a flow"
src="images/intro-example-layout.svg" width=400>
<p class=caption>Layout requiring sophisticated content flow
</div>
<p>The designer's intent is to position an image in box ‘<code
class=property>A</code>’ and to flow an article's content from box
‘<code class=css>1</code>’ through boxes ‘<code
class=css>2</code>’, ‘<code class=css>3</code>’ and ‘<code
class=css>4</code>’. Note that the second box should have two columns,
and the image is not contained in the article. Box ‘<code
class=css>4</code>’ should auto-size to render the remainder of the
article content that did not fit in the earlier boxes.
<p>Figure 2 shows an example of the intended visual rendering of the
content.
<div class=figure> <img
alt="Sample rendering showing a single thread of text flowing through a chain of regions"
src="images/regions-intro-rendering.png" width=450>
<p class=caption>Sample rendering for desired layout
</div>
<p>There is no existing mechanism in CSS to associate the content with
these boxes arranged in this manner so that content flows as intended. The
CSS regions module properties provide that mechanism.
<p>The following example illustrates how an <code>&lt;article&gt;</code>
element is placed in a <a href="#named-flow0">named flow</a> and how boxes
marked with ‘<code class=css>region1</code>’, ‘<code
class=css>region2</code>’, ‘<code class=css>region3</code>’ and
‘<code class=css>region4</code>’ IDs become CSS Regions that consume
the ‘<code class=property>article-flow</code>’ content.
<div class=example>
<pre>
&lt;style&gt;
article {
<strong>flow-into: article-flow;</strong>
}
#region1, #region2, #region3, #region4 {
<strong>flow-from: article-flow;</strong>
}
&lt;/style&gt;
</pre>
</div>
<p>The ‘<code class=property>article-flow</code>’ value on the ‘<a
href="#flow-into"><code class=property>flow-into</code></a>’ property
directs the <code>article</code> element to the ‘<code
class=property>article-flow</code>’ <a href="#named-flow0">named
flow</a>. Setting the ‘<a href="#flow-from"><code
class=property>flow-from</code></a>’ property on block containers to
‘<code class=property>article-flow</code>’ makes them CSS Regions and
associates the resulting region chain with the <a
href="#named-flow0">named flow</a>: the flow is ‘<code
class=css>poured</code>’ into the region chain.
<p>See <a href="#intro-example-code">Appendix A</a> for sample code using
grid layout and custom elements that implements this example
<div class=issue-marker data-bug_id=16858 data-bug_status=ASSIGNED> <a
href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=16858">Issue-16858</a>
<div class=issue-details>
<p class=short-desc>Should creation of regions from elements be
disallowed?
</div>
</div>
<div class=note><span class=note-prefix>Note </span>
<p><strong>HTML Templates in example code</strong>
<p>All of the examples use <a
href="https://dvcs.w3.org/hg/webcomponents/raw-file/tip/explainer/index.html#custom-element-section">Custom
Elements</a> and <a
href="https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html">HTML
Templates</a> to contain the elements used to create CSS Regions. This is
meant to show one way of separating content markup from layout. In each
example, the <code>body</code> element becomes a custom element and a
copy of the template gets inserted into the <code>body</code> element's
<a href="http://www.w3.org/TR/shadow-dom/">Shadow DOM</a>.
</div>
<div class=note><span class=note-prefix>Note </span>
<p><strong>CSS Regions are independent from layout</strong>
<p>Any of the CSS layout facilities can be used to create, position and
size boxes that can become CSS Regions. For instance, the code in <a
href="#intro-example-code">Appendix A</a> uses a grid layout <a
href="#CSS3-GRID-LAYOUT"
rel=biblioentry>[CSS3-GRID-LAYOUT]<!--{{CSS3-GRID-LAYOUT}}--></a> as an
example. This example could use a flexible box layout <a
href="#CSS3-FLEXBOX"
rel=biblioentry>[CSS3-FLEXBOX]<!--{{CSS3-FLEXBOX}}--></a> instead.
<p>The CSS regions specification does not define a layout mechanism and is
meant to integrate with existing and future CSS layout facilities.
</div>
<div class=note><span class=note-prefix>Note </span>
<p><strong>CSS Regions do not have to be elements</strong>
<p>The CSS regions module is independent of the layout of boxes and the
mechanisms used to create them.
<p>For simplicity, our example code in <a
href="#intro-example-code">Appendix A</a> uses elements to define the
boxes. Any other mechanism available in markup or style to create
stylable boxes could be used instead, such as pseudo-elements or the
@slot rule proposed by the CSS Page Template Module <a
href="#CSS3-PAGE-TEMPLATE"
rel=biblioentry>[CSS3-PAGE-TEMPLATE]<!--{{CSS3-PAGE-TEMPLATE}}--></a>.
<p>The only requirement for box to become a CSS Region is that the ‘<a
href="#flow-from"><code class=property>flow-from</code></a>’ property
applies to the box.
</div>
6E6B
<h3 id=region-styling><span class=secno>1.2. </span>CSS Region names and
styling</h3>
<p>Content can be styled depending on the CSS Region it flows into. It is
an extension of pseudo-element styling such as <a
href="http://www.w3.org/TR/css3-selectors/#first-line"> <code
class=css>::first-line</code> </a> which applies a particular style to a
fragment of content. With CSS Region styling, additional selectors may
apply depending on the CSS Region into which content flows.
<p>In our example, the designer wants to make text flowing into #region1
dark blue and bold.
<p>This design can be expressed as shown below.
<div class=example>
<pre>
&lt;style&gt;
#region1::region(p) {
color: #0C3D5F;
font-weight: bold;
}
&lt;/style&gt;</pre>
</div>
<p>The <code class=css>::region()</code> functional pseudo-element takes a
<code class=css>p</code> selector as an argument in this example. The
color and font-weight declarations will apply to any fragments of
paragraphs that are displayed in <code class=css>#region1</code>. The
following figure shows how the rendering changes if we apply this styling
specific to <code>#region1</code>. Note how less text fits into this box
now that the ‘<code class=property>font-weight</code>’ is bold instead
of normal.
<div class=figure> <img
alt="Illustrate how changing region styling affects the flow of content."
src="images/region-styling.png" width=450>
<p class=caption>Different rendering with a different region styling
</div>
<h2 id=css-regions-concepts><span class=secno>2. </span>CSS regions
concepts</h2>
<h3 id=regions><span class=secno>2.1. </span>Regions</h3>
<p id=region> A <dfn id=css-region title=region>CSS Region</dfn> is a block
container that has an associated <a href="#named-flow0"><em><span>named
flow</span></em></a> (see the ‘<a href="#flow-from"><code
class=property>flow-from</code></a>’ property).
<h3 id=region-chain><span class=secno>2.2. </span>Region chain</h3>
<p>A <dfn id=region-chain0>region chain</dfn> is the sequence of regions
that are associated with a <a href="#named-flow0">named flow</a>. <a
href="#css-region" title=region>CSS Regions</a> in a region chain receive
content from the named flow following their order in the chain. <a
href="#css-region" title=region>CSS Regions</a> are organized into a <span
title=region-chain>region chain</span> according to the document order.
<h3 id=named-flow><span class=secno>2.3. </span>Named flows</h3>
<p>A <dfn id=named-flow0>named flow</dfn> is the ordered sequence of
content associated with a flow with a given identifier. Contents in a <a
href="#named-flow0">named flow</a> are ordered according to the document
order.
<p>Content is placed into a <a href="#named-flow0">named flow</a> with the
‘<a href="#flow-into"><code class=property>flow-into</code></a>’
property. The content in a <a href="#named-flow0">named flow</a> is laid
out in the <span title=region-chain>region chain</span> that is associated
with this <a href="#named-flow0">named flow</a> using the ‘<a
href="#flow-from"><code class=property>flow-from</code></a>’ property.
<p>Content from a <a href="#named-flow0">named flow</a> is broken up
between regions according to the regions flow breaking rules.
<p>A <a href="#named-flow0">named flow</a> is created when some content is
moved into the flow with the given identifier or when at least one CSS
Region requests content from that flow.
<h3 id=regions-flow-breaking-rules><span class=secno>2.4. </span>Regions
flow breaking rules</h3>
<p>Breaking a <a href="#named-flow0">named flow</a> across a region chain
is similar to breaking a document's content across pages (see <a
href="#CSS3PAGE" rel=biblioentry>[CSS3PAGE]<!--{{CSS3PAGE}}--></a>) or a
multi-column element's content across column boxes (see <a href="#CSS3COL"
rel=biblioentry>[CSS3COL]<!--{{CSS3COL}}--></a>). One difference is that
page boxes are generated based on the available content whereas a region
chain is a set of recipient boxes for the <a href="#named-flow0">named
flow</a> content whose dynamic generation is not in the scope of this
specification.
<p>Each CSS Region in turn consumes content from its associated <a
href="#named-flow0">named flow</a>. The <a href="#named-flow0">named
flow</a> content is positioned in the current region until a natural or
forced region break occurs, at which point the next region in the <span
title=region-chain>region chain</span> becomes the <span
title=current-region>current region</span>. If there are no more <a
href="#css-region">region</a>s in the region chain and there is still
content in the flow, the positioning of the remaining content is
controlled by the ‘<a href="#region-fragment"><code
class=property>region-fragment</code></a>’ property on the last <a
href="#css-region">region</a> in the chain.
<p>The CSS regions module follows the fragmentation rules defined in the
CSS Fragmentation Module Level 3 (see <a href="#CSS3-BREAK"
rel=biblioentry>[CSS3-BREAK]<!--{{!CSS3-BREAK}}--></a>).
<h2 id=properties-and-region-styling><span class=secno>3. </span>Properties
and Region Styling</h2>
<h3 id=the-flow-into-property><span class=secno>3.1. </span>The ‘<a
href="#flow-into"><code class=property>flow-into</code></a>’ property</h3>
<div class="issue-marker wrapper">
<div class=issue-marker data-bug_id=16527 data-bug_status=ASSIGNED> <a
href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=16527">Issue-16527</a>
<div class=issue-details>
<p class=short-desc>[Shadow]: getFlowByName and shadow DOM
</div>
</div>
</div>
<p>The ‘flow-into’ property can place an element or its contents into a
<a href="#named-flow0">named flow</a>. Content that belongs to the same
flow is laid out in the region chain associated with that flow.
<table class=propdef summary="flow property definition">
<tbody>
<tr>
<th>Name:
<td><dfn id=flow-into>flow-into</dfn>
<tr>
<th>Value:
<td>none | &lt;ident&gt; [element|content]?
<tr>
<th>Initial:
<td>none
<tr>
<th>Applies to:
<td>All elements, but not <a
href="http://www.w3.org/TR/selectors/#pseudo-elements">pseudo-elements</a>
such as <code class=css>::first-line</code>, <code
class=css>::first-letter</code>, <code class=css>::before</code> or
<code class=css>::after</code>.
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
</table>
<dl>
<dt>none
<dd>The element is not moved to a <a href="#named-flow0">named flow</a>
and normal CSS processing takes place.
<dt><a
href="http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier">&lt;ident&gt;</a>
<dd>If the keyword ‘<code class=property>element</code>’ is present or
neither keyword is present, then the element is taken out of its parent's
flow and placed into the flow with the name ‘<code class=css><a
href="http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier">&lt;ident&gt;</a></code>’.
If the keyword ‘<code class=property>content</code>’ is present, then
only the element's contents are placed into the named flow. The element
or content is said to have a <dfn id=specified-flow>specified flow</dfn>.
The values ‘<code class=property>none</code>’, ‘<code
class=property>inherit</code>’, ‘<code
class=property>default</code>’, ‘<code class=property>auto</code>’
and ‘<code class=property>initial</code>’ are invalid flow names.
</dl>
<p>The ‘<a href="#flow-into"><code class=property>flow-into</code></a>’
property does not affect the CSS cascade and inheritance for the elements
on which it is specified. The ‘<a href="#flow-into"><code
class=property>flow-into</code></a>’ property does not affect the <a
href="http://www.w3.org/TR/2012/WD-dom-20120405/#introduction-to-the-dom">DOM</a>
<a href="#DOM" rel=biblioentry>[DOM]<!--{{!DOM}}--></a> position of an
element or its contents. The ‘<a href="#flow-into"><code
class=property>flow-into</code></a>’ property affects the visual
formatting of elements or contents placed into a <a
href="#named-flow0">named flow</a> and of the region chain laying out
content from a <a href="#named-flow0">named flow</a>.
<p>A <a href="#named-flow0">named flow</a> needs to be associated with a
region chain (one or more CSS regions) for its content to be visually
formatted. If no region chain is associated with a given <a
href="#named-flow0">named flow</a>, the content in the <a
href="#named-flow0">named flow</a> is not rendered: it does not generate
boxes and is not displayed.
<p>The children of an element or content with a specified flow may
themselves have a specified flow. If an element or content has the same
specified flow as one of its ancestors, it becomes the next sibling of its
closest ancestor with the same specified flow.
<p>Content in a <a href="#named-flow0">named flow</a> is sequenced in
1CBF
document order. The visual formatting model uses the relationships between
content in the named flow as input, rather than the contents’ position
in the DOM.
<p>The edges of the first CSS region in a region chain associated with a <a
href="#named-flow0">named flow</a> establish the rectangle that is the <a
href="http://www.w3.org/TR/CSS2/visudet.html#containing-block-details">containing
block</a> used for absolutely positioned elements in the <a
href="#named-flow0">named flow</a> which do not have an ancestor with a
‘<code class=property>position</code>’ of ‘<code
class=property>absolute</code>’, ‘<code
class=property>relative</code>’ or ‘<code
class=property>fixed</code>’ (see <a href="#CSS21"
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>). That first CSS region
rectangle is used as the containing block instead of the initial
containing block. This does not affect fixed position elements in the <a
href="#named-flow0">named flow</a> - they are still positioned relative to
the viewport or page area even if they have been redirected to a named
flow.
<p>The first region defines the principal <a
href="http://www.w3.org/TR/css3-writing-modes/#writing-mode">writing
mode</a> for the entire flow. The writing mode on subsequent regions is
ignored.
<div class=note><span class=note-prefix> EF01 Note </span>
<p>The ‘<a href="#flow-into"><code
class=property>flow-into</code></a>’ property moves an element into the
flow and the interplay with selectors should be considered carefully.
<p>For example,
<pre>table {flow-into: table-content}</pre>
<p>will move all tables in the ‘<code
class=property>table-content</code>’ <a href="#named-flow0">named
flow</a>. However, the
<pre>table &gt; * {flow-into: table-content} ...</pre>
<p>selector will move all immediate children of all table elements into
the ‘table-content’ <a href="#named-flow0">named flow</a> (which may
be useful as it will usually result, if the immediate children are rows,
in merging rows of multiple tables), but the
<pre>table * {flow-into: table-content}</pre>
<p>selector will move all descendants of table elements into the
‘table-content’ <a href="#named-flow0">named flow</a>, transforming
the element tree into a flat list in order of opening tags (which is
probably not intentional). This will make all the descendants of table
elements siblings in the <a href="#named-flow0">named flow</a>. Having
the descendants become siblings in the <a href="#named-flow0">named
flow</a> results in a different processing (see <a
href="http://www.w3.org/TR/2011/REC-CSS2-20110607/tables.html#anonymous-boxes">CSS
2.1‘<code class=css>s anonymous table objects</code></a>). This note
illustrates how authors must exercise caution when choosing a particular
selector for setting the ’flow-into' property to avoid unintended
results.
</div>
<div class=note><span class=note-prefix>Note </span>
<p>Another consequence of moving elements into named flows is that
surrounding whitespace is not moved into the named flow. If you have code
like this:
<pre>span {flow-into: span-content}
&lt;span&gt;one&lt;/span&gt;
&lt;span&gt;two&lt;/span&gt;
</pre>
Then the ‘<code class=property>span-content</code>’ named flow
contents will contain this:
<pre>&lt;span&gt;one&lt;/span&gt;&lt;span&gt;two&lt;/span&gt;
</pre>
Which will change the display from "one two" to "onetwo". If whitespace is
significant, then moving the parent that contains the whitespace to the
named flow is required.</div>
<h3 id=the-flow-from-property><span class=secno>3.2. </span>The ‘<a
href="#flow-from"><code class=property>flow-from</code></a>’ property</h3>
<p>The ‘<a href="#flow-from"><code class=property>flow-from</code></a>’
property makes a block container a region and associates it with a <a
href="#named-flow0">named flow</a>.
<table class=propdef summary="flow-from property definition">
<tbody>
<tr>
<th>Name:
<td><dfn id=flow-from>flow-from</dfn>
<tr>
<th>Value:
<td>&lt;ident&gt; | none | inherit
<tr>
<th>Initial:
<td>none
<tr>
<th>Applies to:
<td>Non-replaced <a
href="http://www.w3.org/TR/CSS21/visuren.html#block-boxes">block
containers</a>. <br>
This might be expanded in future versions of the specification to allow
other types of containers to receive flow content.
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
</table>
<dl>
<dt><strong>none</strong>
<dd>The block container is not a <a href="#css-region"
title=region>region</a>.
<dt><strong><a
href="http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier">&lt;ident&gt;</a></strong>
<dd> If the ‘<code class=property>content</code>’ property computes to
something else than ‘<code class=property>normal</code>’ (or ‘<code
class=property>none</code>’ for a pseudo-element), the block container
does not become a <span>CSS Region</span>. If the ‘<code
class=property>content</code>’ property computes to ‘<code
class=property>normal</code>’ (or ‘<code
class=property>none</code>’ for a pseudo-element), then the block
container becomes a <span>CSS Region</span> and is ordered in a <a
href="#region-chain0">region chain</a> according to its document order.
The content from the flow with the <a
href="http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier">&lt;ident&gt;</a>
name will be <a href="#region-flow-break">broken into fragments</a> and
visually formatted in the <a
href="http://www.w3.org/TR/CSS21/visuren.html#principal-box">principal
boxes</a> of the <a href="#css-region">regions</a> in the <a
href="#region-chain0">region chain</a>. <br>
If there is no flow with name <a
href="http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier">&lt;ident&gt;</a>,
then the block container does not format any content visually.
</dl>
<p>A <span>CSS Region</span>’s document children are not visually
formatted unless they are directed to a <a href="#named-flow0">named
flow</a> with an associated <a href="#region-chain0">region chain</a>.
<p>Block container pseudo-elements where the value of ‘<a
href="#flow-from"><code class=property>flow-from</code></a>’ computes to
an <a
href="http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier">&lt;ident&gt;</a>
and the value of ‘<code class=property>content</code>’ computes to
‘<code class=property>none</code>’ are generated as CSS Regions, which
is an update to the behavior described in <a href="#CSS21"
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>.
<div class=note><span class=note-prefix>Note </span>
<p>A block container becomes a <span>CSS Region</span> when its ‘<a
href="#flow-from"><code class=property>flow-from</code></a>’ property
is set to a valid <a
href="http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier">&lt;ident&gt;</a>
value, even if there is no content contributing to the referenced flow.
For example:
<pre>
&lt;style&gt;
.article{
flow-into: thread;
}
.region{
flow-from: thread;
}
&lt;/style&gt;
&lt;html&gt;
&lt;body&gt;
&lt;div class=region&gt;div content&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
There is no element matching the <code>.article</code> selector and
therefore no content in the <code>thread</code> flow. However, the block
container matching the <a href="#css-region"><code>.region</code></a>
selector is still associated with that empty <a href="#named-flow0">named
flow</a> and, consequently, its children are not formatted visually.</div>
<div class=note><span class=note-prefix>Note </span>
<p>At the time of this note-writing, the <code>display</code> values that
always result in a non-replaced block container include
<code>block</code>, <code>inline-block</code>, <code>table-cell</code>,
<code>table-caption</code>, and <code>list-item</code>. All of these
display values work as regions with non-replaced elements.
<p>The <code>flex</code> and <code>grid</code> display values do not
result in block containers (they are defined as flex containers and grid
elements, respectively). So ‘<a href="#flow-from"><code
class=property>flow-from</code></a>’ combined with those display values
does not result in a CSS Region.
</div>
<p><a href="#css-region" title=region>CSS Regions</a> create a new <a
href="http://www.w3.org/TR/CSS2/visuren.html#z-index">stacking
context</a>. <a href="#css-region" title=region>CSS Regions</a> establish
a new <a
href="http://www.w3.org/TR/CSS2/visuren.html#block-formatting">block
formatting Context</a>. Exclusions (see <a href="#CSS3-EXCLUSIONS"
rel=biblioentry>[CSS3-EXCLUSIONS]<!--{{CSS3-EXCLUSIONS}}--></a>)
potentially impact the content laid out in region chains, just as for
non-regions.
<div class=note><span class=note-prefix>Note </span>
<p>With <a href="#region-chain0">region chains</a>, an element may be
split across multiple boxes and these boxes may overlap (for example if
they are absolutely positioned). So fragments of the same element can
overlap each other. Since each element has a single z-index, it would be
required to find another mechanism to decide in which order
the fragments are rendered. Since each <span>CSS Region</span> creates a
new stacking context, it is clear that each fragment is rendered
separately and their rendering order follows the regular CSS rendering
model.
<p>Fragments rendering separately is also relevant to elements that might
normally be rendered as a unit (for example, an element with its own