CINXE.COM
CSS Regions Module Level 1
<!doctype html><html lang="en"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <title>CSS Regions Module Level 1</title> <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport"> <meta content="exploring" name="csswg-work-status"> <meta content="ED" name="w3c-status"> <meta content="The CSS Regions module allows content from one or more elements to flow through one or more boxes called CSS Regions, fragmented as defined in [[!CSS3-BREAK]]. This module also defines CSSOM to expose both the inputs and outputs of this fragmentation." name="abstract"> <link href="../default.css" rel="stylesheet" type="text/css"> <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon"> <style> body { background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat; } </style> <meta content="Bikeshed version 591bea59cf8238bb54df5a264359f29d0d039368" name="generator"> <link href="https://www.w3.org/TR/css-regions-1/" rel="canonical"> <script defer src="https://test.csswg.org/harness/annotate.js#!css-regions-1_dev/css-regions-1" type="text/javascript"></script> <style>/* style-md-lists */ /* This is a weird hack for me not yet following the commonmark spec regarding paragraph and lists. */ [data-md] > :first-child { margin-top: 0; } [data-md] > :last-child { margin-bottom: 0; }</style> <style>/* style-selflinks */ .heading, .issue, .note, .example, li, dt { position: relative; } a.self-link { position: absolute; top: 0; left: calc(-1 * (3.5rem - 26px)); width: calc(3.5rem - 26px); height: 2em; text-align: center; border: none; transition: opacity .2s; opacity: .5; } a.self-link:hover { opacity: 1; } .heading > a.self-link { font-size: 83%; } li > a.self-link { left: calc(-1 * (3.5rem - 26px) - 2em); } dfn > a.self-link { top: auto; left: auto; opacity: 0; width: 1.5em; height: 1.5em; background: gray; color: white; font-style: normal; transition: opacity .2s, background-color .2s, color .2s; } dfn:hover > a.self-link { opacity: 1; } dfn > a.self-link:hover { color: black; } a.self-link::before { content: "¶"; } .heading > a.self-link::before { content: "§"; } dfn > a.self-link::before { content: "#"; }</style> <style>/* style-counters */ body { counter-reset: example figure issue; } .issue { counter-increment: issue; } .issue:not(.no-marker)::before { content: "Issue " counter(issue); } .example { counter-increment: example; } .example:not(.no-marker)::before { content: "Example " counter(example); } .invalid.example:not(.no-marker)::before, .illegal.example:not(.no-marker)::before { content: "Invalid Example" counter(example); } figcaption { counter-increment: figure; } figcaption:not(.no-marker)::before { content: "Figure " counter(figure) " "; }</style> <style>/* style-autolinks */ .css.css, .property.property, .descriptor.descriptor { color: #005a9c; font-size: inherit; font-family: inherit; } .css::before, .property::before, .descriptor::before { content: "‘"; } .css::after, .property::after, .descriptor::after { content: "’"; } .property, .descriptor { /* Don't wrap property and descriptor names */ white-space: nowrap; } .type { /* CSS value <type> */ font-style: italic; } pre .property::before, pre .property::after { content: ""; } [data-link-type="property"]::before, [data-link-type="propdesc"]::before, [data-link-type="descriptor"]::before, [data-link-type="value"]::before, [data-link-type="function"]::before, [data-link-type="at-rule"]::before, [data-link-type="selector"]::before, [data-link-type="maybe"]::before { content: "‘"; } [data-link-type="property"]::after, [data-link-type="propdesc"]::after, [data-link-type="descriptor"]::after, [data-link-type="value"]::after, [data-link-type="function"]::after, [data-link-type="at-rule"]::after, [data-link-type="selector"]::after, [data-link-type="maybe"]::after { content: "’"; } [data-link-type].production::before, [data-link-type].production::after, .prod [data-link-type]::before, .prod [data-link-type]::after { content: ""; } [data-link-type=element], [data-link-type=element-attr] { font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace; font-size: .9em; } [data-link-type=element]::before { content: "<" } [data-link-type=element]::after { content: ">" } [data-link-type=biblio] { white-space: pre; }</style> <style>/* style-dfn-panel */ .dfn-panel { position: absolute; z-index: 35; height: auto; width: -webkit-fit-content; width: fit-content; max-width: 300px; max-height: 500px; overflow: auto; padding: 0.5em 0.75em; font: small Helvetica Neue, sans-serif, Droid Sans Fallback; background: #DDDDDD; color: black; border: outset 0.2em; } .dfn-panel:not(.on) { display: none; } .dfn-panel * { margin: 0; padding: 0; text-indent: 0; } .dfn-panel > b { display: block; } .dfn-panel a { color: black; } .dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; } .dfn-panel > b + b { margin-top: 0.25em; } .dfn-panel ul { padding: 0; } .dfn-panel li { list-style: inside; } .dfn-panel.activated { display: inline-block; position: fixed; left: .5em; bottom: 2em; margin: 0 auto; max-width: calc(100vw - 1.5em - .4em - .5em); max-height: 30vh; } .dfn-paneled { cursor: pointer; } </style> <style>/* style-syntax-highlighting */ pre.idl.highlight { color: #708090; } .highlight:not(.idl) { background: hsl(24, 20%, 95%); } code.highlight { padding: .1em; border-radius: .3em; } pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; } c-[a] { color: #990055 } /* Keyword.Declaration */ c-[b] { color: #990055 } /* Keyword.Type */ c-[c] { color: #708090 } /* Comment */ c-[d] { color: #708090 } /* Comment.Multiline */ c-[e] { color: #0077aa } /* Name.Attribute */ c-[f] { color: #669900 } /* Name.Tag */ c-[g] { color: #222222 } /* Name.Variable */ c-[k] { color: #990055 } /* Keyword */ c-[l] { color: #000000 } /* Literal */ c-[m] { color: #000000 } /* Literal.Number */ c-[n] { color: #0077aa } /* Name */ c-[o] { color: #999999 } /* Operator */ c-[p] { color: #999999 } /* Punctuation */ c-[s] { color: #a67f59 } /* Literal.String */ c-[t] { color: #a67f59 } /* Literal.String.Single */ c-[u] { color: #a67f59 } /* Literal.String.Double */ c-[cp] { color: #708090 } /* Comment.Preproc */ c-[c1] { color: #708090 } /* Comment.Single */ c-[cs] { color: #708090 } /* Comment.Special */ c-[kc] { color: #990055 } /* Keyword.Constant */ c-[kn] { color: #990055 } /* Keyword.Namespace */ c-[kp] { color: #990055 } /* Keyword.Pseudo */ c-[kr] { color: #990055 } /* Keyword.Reserved */ c-[ld] { color: #000000 } /* Literal.Date */ c-[nc] { color: #0077aa } /* Name.Class */ c-[no] { color: #0077aa } /* Name.Constant */ c-[nd] { color: #0077aa } /* Name.Decorator */ c-[ni] { color: #0077aa } /* Name.Entity */ c-[ne] { color: #0077aa } /* Name.Exception */ c-[nf] { color: #0077aa } /* Name.Function */ c-[nl] { color: #0077aa } /* Name.Label */ c-[nn] { color: #0077aa } /* Name.Namespace */ c-[py] { color: #0077aa } /* Name.Property */ c-[ow] { color: #999999 } /* Operator.Word */ c-[mb] { color: #000000 } /* Literal.Number.Bin */ c-[mf] { color: #000000 } /* Literal.Number.Float */ c-[mh] { color: #000000 } /* Literal.Number.Hex */ c-[mi] { color: #000000 } /* Literal.Number.Integer */ c-[mo] { color: #000000 } /* Literal.Number.Oct */ c-[sb] { color: #a67f59 } /* Literal.String.Backtick */ c-[sc] { color: #a67f59 } /* Literal.String.Char */ c-[sd] { color: #a67f59 } /* Literal.String.Doc */ c-[se] { color: #a67f59 } /* Literal.String.Escape */ c-[sh] { color: #a67f59 } /* Literal.String.Heredoc */ c-[si] { color: #a67f59 } /* Literal.String.Interpol */ c-[sx] { color: #a67f59 } /* Literal.String.Other */ c-[sr] { color: #a67f59 } /* Literal.String.Regex */ c-[ss] { color: #a67f59 } /* Literal.String.Symbol */ c-[vc] { color: #0077aa } /* Name.Variable.Class */ c-[vg] { color: #0077aa } /* Name.Variable.Global */ c-[vi] { color: #0077aa } /* Name.Variable.Instance */ c-[il] { color: #000000 } /* Literal.Number.Integer.Long */ </style> <style type='text/css'><!-- a#generator { width: 32px; height: 32px; display: block; position: fixed; right: 0; top: 0; border-bottom-left-radius: 5px; background: #f4f4f4; box-shadow: 2px 0px 3px #444; background-image: linear-gradient(to bottom, #eee, #fff 15%, #ededed 80%, #e0e0e0); } a#generator:focus { outline: none;} a#generator svg { position: absolute; right: 3px; top: 3px; } @keyframes fill { 0%, 100% { fill: blue; } 16% { fill: purple; } 33% { fill: hsl(0, 100%, 60%); } 50% { fill: orange; } 67% { fill: gold; } 83% { fill: hsl(120, 100%, 25%); } } @keyframes stroke { 0%, 100% { stroke: blue; } 16% { stroke: purple; } 33% { stroke: hsl(0, 100%, 60%); } 50% { stroke: orange; } 67% { stroke: gold; } 83% { stroke: hsl(120, 100%, 25%); } } a#generator.fatal [fill=blue], a#generator.error [fill=blue], .previous [fill=blue] { fill: #d00; } a#generator.fatal [stroke=blue], a#generator.error [stroke=blue], .previous [stroke=blue] { stroke: #d00; } a#generator.warning [fill=blue] { fill: #0df; } a#generator.warning [stroke=blue] { stroke: #0df; } a#generator.link-error [fill=blue] { fill: #cc0; } a#generator.link-error [stroke=blue] { stroke: #cc0; } a#generator.success [fill=blue] { fill: #0b0; } a#generator.success [stroke=blue] { stroke: #0b0; } a#generator [fill=blue], [stroke=blue] { animation: n 5s infinite linear; transition: fill 1s, stroke 1s; } a#generator.pending [stroke=blue] { animation-name: stroke; } a#generator.pending [fill=blue] { animation-name: fill; } a#generator.generating [stroke=blue] { animation-name: stroke; } a#generator.generating [fill=blue] { animation-name: fill; } --></style><body class="h-entry"> <div class="head"> <p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p> <h1 class="p-name no-ref" id="title">CSS Regions Module Level 1</h1> <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="2018-09-10">10 September 2018</time></span></h2> <details> <summary>Specification Metadata</summary> <div data-fill-with="spec-metadata"> <dl> <dt>This version: <dd><a class="u-url" href="https://drafts.csswg.org/css-regions/">https://drafts.csswg.org/css-regions/</a> <dt>Latest published version: <dd><a href="https://www.w3.org/TR/css-regions-1/">https://www.w3.org/TR/css-regions-1/</a> <dt>Previous Versions: <dd><a href="https://www.w3.org/TR/2014/WD-css-regions-1-20141009/" rel="prev">https://www.w3.org/TR/2014/WD-css-regions-1-20141009/</a> <dd><a href="https://www.w3.org/TR/2014/WD-css3-regions-20140218/" rel="prev">https://www.w3.org/TR/2014/WD-css3-regions-20140218/</a> <dt>Test Suite: <dd><a href="http://test.csswg.org/suites/css-regions-1_dev/nightly-unstable/">http://test.csswg.org/suites/css-regions-1_dev/nightly-unstable/</a> <dt class="editor">Editors: <dd class="editor p-author h-card vcard" data-editor-id="49885"><a class="p-name fn u-email email" href="mailto:ratan@microsoft.com">Rossen Atanassov</a> (<span class="p-org org">Microsoft Corporation</span>) <dd class="editor p-author h-card vcard" data-editor-id="46659"><a class="p-name fn u-email email" href="mailto:stearns@adobe.com">Alan Stearns</a> (<span class="p-org org">Adobe Systems, Inc.</span>) <dt class="editor">Former Editor: <dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:vhardy@adobe.com">Vincent Hardy</a> (<span class="p-org org">Adobe Systems, Inc.</span>) <dt>Suggest an Edit for this Spec: <dd><a href="https://github.com/w3c/csswg-drafts/blob/master/css-regions-1/Overview.bs">GitHub Editor</a> <dt>Issue Tracking: <dd><a href="https://github.com/w3c/csswg-drafts/labels/css-regions-1">GitHub Issues</a> <dt>Issues list: <dd><a href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&product=CSS&component=Regions&resolution=---&cmdtype=doit">In Bugzilla</a> </dl> </div> </details> <div data-fill-with="warning"></div> <p class="copyright" data-fill-with="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2018 <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>). 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/2015/copyright-software-and-document">permissive document license</a> rules apply. </p> <hr title="Separator for header"> </div> <div class="p-summary" data-fill-with="abstract"> <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2> <p>The CSS Regions module allows content from one or more elements to flow through one or more boxes called CSS Regions, fragmented as defined in <a data-link-type="biblio" href="#biblio-css3-break">[CSS3-BREAK]</a>. This module also defines CSSOM to expose both the inputs and outputs of this fragmentation.</p> <a href="http://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents (such as HTML and XML) on screen, on paper, in speech, etc. </div> <h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2> <div data-fill-with="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> <p> <a href="https://github.com/w3c/csswg-drafts/issues">GitHub Issues</a> are preferred for discussion of this specification. When filing an issue, please put the text “css-regions” in the title, preferably like this: “[css-regions] <i data-lt>…summary of comment…</i>”. All issues and comments are <a href="https://lists.w3.org/Archives/Public/public-css-archive/">archived</a>, and there is also a <a href="https://lists.w3.org/Archives/Public/www-style/">historical archive</a>. </p> <p> This document was produced by the <a href="https://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of the <a href="https://www.w3.org/Style/">Style Activity</a>). </p> <p> This document was produced by a group operating under the <a href="https://www.w3.org/Consortium/Patent-Policy/">W3C Patent Policy</a>. W3C maintains a <a href="https://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="https://www.w3.org/Consortium/Patent-Policy/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure">section 6 of the W3C Patent Policy</a>. </p> <p> This document is governed by the <a href="https://www.w3.org/2018/Process-20180201/" id="w3c_process_revision">1 February 2018 W3C Process Document</a>. </p> <p></p> </div> <div data-fill-with="at-risk"></div> <nav data-fill-with="table-of-contents" id="toc"> <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2> <ol class="toc" role="directory"> <li><a href="#introduction"><span class="secno">1</span> <span class="content"> Introduction</span></a> <li> <a href="#css-regions-concepts"><span class="secno">2</span> <span class="content"> CSS Regions concepts</span></a> <ol class="toc"> <li><a href="#regions"><span class="secno">2.1</span> <span class="content"> Regions</span></a> <li><a href="#region-chain-section"><span class="secno">2.2</span> <span class="content"> Region chain</span></a> <li><a href="#last-region"><span class="secno">2.3</span> <span class="content"> Last region</span></a> <li><a href="#named-flow-section"><span class="secno">2.4</span> <span class="content"> Named flows</span></a> <li><a href="#regions-flow-breaking-rules"><span class="secno">2.5</span> <span class="content"> Regions flow breaking rules</span></a> </ol> <li> <a href="#properties"><span class="secno">3</span> <span class="content"> Properties</span></a> <ol class="toc"> <li><a href="#the-flow-into-property"><span class="secno">3.1</span> <span class="content"> The <span class="property">flow-into</span> property</span></a> <li> <a href="#flow-from"><span class="secno">3.2</span> <span class="content"> The <span class="property">flow-from</span> property</span></a> <ol class="toc"> <li><a href="#circular-dependencies"><span class="secno">3.2.1</span> <span class="content"> Cycle Detection</span></a> <li><a href="#fragmenting-regions"><span class="secno">3.2.2</span> <span class="content"> Nested fragmentation contexts</span></a> </ol> <li><a href="#region-flow-break"><span class="secno">3.3</span> <span class="content"> Region flow break properties: <span class="property">break-before</span>, <span class="property">break-after</span>, <span class="property">break-inside</span></span></a> <li><a href="#the-region-fragment-property"><span class="secno">3.4</span> <span class="content"> The region-fragment property</span></a> </ol> <li> <a href="#cssom_view_and_css_regions"><span class="secno">4</span> <span class="content"> CSSOM</span></a> <ol class="toc"> <li><a href="#the-namedflow-interface"><span class="secno">4.1</span> <span class="content"> The NamedFlow interface</span></a> <li><a href="#the-region-interface"><span class="secno">4.2</span> <span class="content"> The Region interface</span></a> <li><a href="#named-flow-events"><span class="secno">4.3</span> <span class="content"> Named flow events</span></a> <li> <a href="#cssomview-and-regions"><span class="secno">4.4</span> <span class="content"> Clarifications on pre-existing APIs</span></a> <ol class="toc"> <li><a href="#cssomview-getclientrects-and-getboundingclientrect"><span class="secno">4.4.1</span> <span class="content"> <code class="idl">getClientRects()</code> and <code>getBoundingClientRect()</code></span></a> <li><a href="#cssomview-offset-attributes"><span class="secno">4.4.2</span> <span class="content"> <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></span></a> </ol> </ol> <li><a href="#multi-column-regions"><span class="secno">5</span> <span class="content"> Multi-column regions</span></a> <li><a href="#pseudo_elements"><span class="secno">6</span> <span class="content"> Pseudo-elements</span></a> <li> <a href="#regions-visual-formatting-details"><span class="secno">7</span> <span class="content"> Regions visual formatting details</span></a> <ol class="toc"> <li><a href="#processing-model"><span class="secno">7.1</span> <span class="content"> Processing model</span></a> <li> <a href="#regions-flow-content-box"><span class="secno">7.2</span> <span class="content"> The Region Flow Content Box (RFCB)</span></a> <ol class="toc"> <li><a href="#rfcb-width-resolution"><span class="secno">7.2.1</span> <span class="content"> RFCB <span class="property">width</span> resolution</span></a> </ol> <li> <a href="#regions-visual-formatting-steps"><span class="secno">7.3</span> <span class="content"> Regions visual formatting steps</span></a> <ol class="toc"> <li> <a href="#rfcb-flow-fragment-height-resolution"><span class="secno">7.3.1</span> <span class="content"> Step 1: RFCB flow fragment height resolution</span></a> <ol class="toc"> <li><a href="#rfcb-flow-fragment-height-resolution-phase-1"><span class="secno">7.3.1.1</span> <span class="content"> RFCB flow fragment height resolution, Phase 1</span></a> <li><a href="#rfcb-flow-fragment-height-resolution-phase-2"><span class="secno">7.3.1.2</span> <span class="content"> RFCB flow fragment height resolution, Phase 2</span></a> </ol> <li><a href="#regions-boxes-layout"><span class="secno">7.3.2</span> <span class="content"> Step 2: region boxes layout</span></a> <li><a href="#named-flows-layout"><span class="secno">7.3.3</span> <span class="content"> Step 3: named flows layout</span></a> </ol> <li><a href="#regions-visual-formatting-implementation-note"><span class="secno">7.4</span> <span class="content"> Regions visual formatting: implementation note</span></a> <li> <a href="#regions-visual-formatting-examples"><span class="secno">7.5</span> <span class="content"> Regions visual formatting example</span></a> <ol class="toc"> <li><a href="#step1-phase1-example"><span class="secno">7.5.1</span> <span class="content"> Step 1 - Phase 1: Laying out RFCBs with used height of zero</span></a> <li><a href="#step1-phase2-example"><span class="secno">7.5.2</span> <span class="content"> Step 1 - Phase 2: Layout flow to compute the RFCBs' flow fragments heights</span></a> <li><a href="#step2-example"><span class="secno">7.5.3</span> <span class="content"> Step 2: Layout document and regions without named flows</span></a> <li><a href="#step3-example"><span class="secno">7.5.4</span> <span class="content"> Step 3: named flows layout</span></a> </ol> </ol> <li><a href="#relation-to-document-events"><span class="secno">8</span> <span class="content"> Relation to document events</span></a> <li><a href="#relation-to-other-specifications"><span class="secno">9</span> <span class="content"> Relation to other specifications</span></a> <li><a href="#usecases"><span class="secno">10</span> <span class="content"> Use Cases</span></a> <li> <a href="#changes"><span class="secno">11</span> <span class="content"> Changes</span></a> <ol class="toc"> <li><a href="#changes_from_Feb_18_2014"><span class="secno">11.1</span> <span class="content"> Changes from <span>February 18<sup>th</sup> 2014</span> version</span></a> <li><a href="#changes_from_May_28_2013"><span class="secno">11.2</span> <span class="content"> Changes from <span>May 28<sup>th</sup> 2013</span> version</span></a> <li><a href="#changes_from_Aug_28_2012"><span class="secno">11.3</span> <span class="content"> Changes from <span>August 28<sup>th</sup> 2012</span> version</span></a> <li><a href="#changes_from_May_03_2012"><span class="secno">11.4</span> <span class="content"> Changes from <span>May 3<sup>rd</sup> 2012</span> version</span></a> <li><a href="#older_changes"><span class="secno">11.5</span> <span class="content">Older Changes</span></a> </ol> <li><a href="#acknowledgments"><span class="secno"></span> <span class="content"> Acknowledgments</span></a> <li> <a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a> <ol class="toc"> <li><a href="#document-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a> <li><a href="#conform-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a> <li> <a href="#conform-responsible"><span class="secno"></span> <span class="content"> Requirements for Responsible Implementation of CSS</span></a> <ol class="toc"> <li><a href="#conform-partial"><span class="secno"></span> <span class="content"> Partial Implementations</span></a> <li><a href="#conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a> <li><a href="#conform-testing"><span class="secno"></span> <span class="content"> Implementations of CR-level Features</span></a> </ol> </ol> <li> <a href="#index"><span class="secno"></span> <span class="content">Index</span></a> <ol class="toc"> <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a> <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a> </ol> <li> <a href="#references"><span class="secno"></span> <span class="content">References</span></a> <ol class="toc"> <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a> <li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a> </ol> <li><a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a> <li><a href="#idl-index"><span class="secno"></span> <span class="content">IDL Index</span></a> </ol> </nav> <main> <h2 class="heading settled" data-level="1" id="introduction"><span class="secno">1. </span><span class="content"> Introduction</span><a class="self-link" href="#introduction"></a></h2> <p><em>This section is non-normative.</em></p> <p>The core concept behind CSS Regions is the ability to say, "Display <em>this</em> content (a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow">named flow</a>) over <em>there</em> (a <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain">region chain</a>)." The simplest example is:</p> <div class="example" id="example-4d2695ea"> <a class="self-link" href="#example-4d2695ea"></a> <pre><code>#this { flow-into: my-flow; } #there { flow-from: my-flow; } </code></pre> </div> <p>These two declarations will take the element that matches <code>#this</code>, put it into a flow named "my-flow", and display the contents of "my-flow" in the box from the element that matches <code>#there</code>. This example has a single content source for the <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow①">named flow</a>, and a single box for the <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain①">region chain</a>. <span>Named flows</span> can also have multiple sources and use multiple boxes for the <span>region chain</span>.</p> <p>The <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow③">named flow</a> mechanism can be used in several different ways - some of which are custom overflow handling, aggregating content, linked display boxes, magazine-style layout, and flowing content through areas in a paginated view.</p> <div class="example" id="example-8cf70305"> <a class="self-link" href="#example-8cf70305"></a> Linked display boxes can be created to display article content above and below other content on a page. Given markup like this: <pre><code class="html"><article> ...some content... </article> <aside> ad or image content </aside> </code></pre> <p>The <aside> content will be displayed below all of the article content. On a large screen the page might display without scrolling, but on a small screen the <aside> content might not be visible until the view scrolls. If it’s important to show at least some of the <aside> content in the initial view, CSS Regions can fragment the article content across two boxes - one above the <aside> and one below.</p> <p>In this example (for simplicity’s sake) we create the boxes with additional elements:</p> <pre><code class="html"><article> ...some content... </article> <div class="top region"></div> <aside> ad or image content </aside> <div class="region"></div> </code></pre> <pre><code>article { flow-into: article-flow; } .region { flow-from: article-flow; } .top { max-height: 80vh; } </code></pre> <p>So the top box in the <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain③">region chain</a> is limited to 80% of the viewport height. If the article content doesn’t fit in that box, the article will continue in the second box after the <aside> content.</p> <figure style="float:left; margin:1em;"> <img alt="Article and aside rendering without CSS Regions" src="images/linked-boxes-before.png"> <figcaption> Rendering without CSS Regions </figcaption> </figure> <figure style="float:left; margin:1em;"> <img alt="Article and aside rendering with CSS Regions" src="images/linked-boxes-after.png"> <figcaption> Rendering with CSS Regions </figcaption> </figure> <p style="clear:left;">In the images above, the gray area represents the content below the screen edge in the initial view. </p> <p>This example links just two boxes together, but more boxes could be added to the <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain④">region chain</a> to regularly interleave other content with the article.</p> </div> <div class="example" id="example-f605d07f"> <a class="self-link" href="#example-f605d07f"></a> <p>Custom overflow handling can be accomplished by linking a separate overflow box. In this example, the overflow box is nestled inside a menu in the markup, and only displays if the menu is toggled.</p> <pre><code class="html"><nav> ...some links... </nav> <div class="menu"> <nav></nav> ...some more links... </div> </code></pre> <p>If the links in the main nav element are placed in a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow④">named flow</a>, that flow can be directed through both the main nav element and the overflow nav box in the menu:</p> <pre><code>nav a { flow-into: nav-link-flow; } nav { flow-from: nav-link-flow; } </code></pre> <p>Then the main nav element and the menu can be arranged with constraints such that when the screen is too narrow for the main nav element to display all of the navigation links, the overflow moves to the menu.</p> <figure> <img alt="Wide nav bar showing all of the links" src="images/menu-wide.png"> <figcaption> Wide rendering with menu shown </figcaption> </figure> <figure> <img alt="Narrow nav bar with some of the links in the menu" src="images/menu-narrow.png"> <figcaption> Narrow rendering with menu shown </figcaption> </figure> </div> <div class="example" id="example-ee40b35e"> <a class="self-link" href="#example-ee40b35e"></a> <p>Since content is assigned to a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑤">named flow</a> using a CSS selector, the content can come from multiple sources. The resulting aggregation can be displayed in a single box or flowed through multiple boxes as above.</p> <p>So given this markup:</p> <pre><code class="html"><div class="breaking-news"></div> <article>News story</article> <article class="breaking">Sports story</article> <article>News story</article> <article class="breaking">Entertainment story</article> <article>Sports story</article> </code></pre> <p>You can take the "breaking" stories and display them above all the others using two lines of CSS:</p> <pre><code>.breaking { flow-into: breaking-news; } .breaking-news { flow-from: breaking-news; } </code></pre> <p>Given more data accessible to CSS selectors, you could rearrange the articles in other ways (sports on top, etc.) depending on the user’s preferences.</p> </div> <div class="note" role="note"> <span class="note-prefix">Note </span> <p><strong><a data-link-type="dfn" href="#css-region" id="ref-for-css-region">CSS Regions</a> are independent from layout</strong></p> <p>Any of the CSS layout facilities can be used to create, position and size boxes that can become <a data-link-type="dfn" href="#css-region" id="ref-for-css-region①">CSS Regions</a>.</p> <p>The CSS Regions module does not define a layout mechanism and is meant to integrate with existing and future CSS layout facilities.</p> </div> <div class="note" role="note"> <span class="note-prefix">Note </span> <p><strong><a data-link-type="dfn" href="#css-region" id="ref-for-css-region②">CSS Regions</a> do not have to be elements</strong></p> <p>The CSS Regions module is independent of the layout of boxes and the mechanisms used to create them.</p> <p>For simplicity, our examples tend to use 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 data-link-type="biblio" href="#biblio-css3-page-template">[CSS3-PAGE-TEMPLATE]</a>.</p> <p>The only requirement for box to become a <a data-link-type="dfn" href="#css-region" id="ref-for-css-region③">CSS Region</a> is that the <a class="property" data-link-type="propdesc" href="#propdef-flow-from" id="ref-for-propdef-flow-from">flow-from</a> property applies to the box.</p> </div> <h2 class="heading settled" data-level="2" id="css-regions-concepts"><span class="secno">2. </span><span class="content"> CSS Regions concepts</span><a class="self-link" href="#css-regions-concepts"></a></h2> <h3 class="heading settled" data-level="2.1" id="regions"><span class="secno">2.1. </span><span class="content"> Regions</span><a class="self-link" href="#regions"></a></h3> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="css-region">CSS Region</dfn> is a block container that has an associated <em><a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑥">named flow</a></em> (see the <a class="property" data-link-type="propdesc" href="#propdef-flow-from" id="ref-for-propdef-flow-from①">flow-from</a> property).</p> <h3 class="heading settled" data-level="2.2" id="region-chain-section"><span class="secno">2.2. </span><span class="content"> Region chain</span><a class="self-link" href="#region-chain-section"></a></h3> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="region-chain">region chain</dfn> is the sequence of regions that are associated with a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑦">named flow</a>. <a data-link-type="dfn" href="#css-region" id="ref-for-css-region④">CSS Regions</a> in a <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain⑤">region chain</a> receive content from the <span>named flow</span> following their order in the chain. <span>CSS Regions</span> are organized into a <span>region chain</span> according to the document order.</p> <h3 class="heading settled" data-level="2.3" id="last-region"><span class="secno">2.3. </span><span class="content"> Last region</span><a class="self-link" href="#last-region"></a></h3> <p>A <a data-link-type="dfn" href="#css-region" id="ref-for-css-region⑥">CSS region</a> is deemed to be the <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="last usable region | last usable CSS region" data-noexport id="last-usable-region">last usable region</dfn> in a <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain⑦">region chain</a> if it is the first region in that chain to have <a data-link-type="dfn" href="https://drafts.csswg.org/css-contain-1/#layout-containment" id="ref-for-layout-containment">layout containment</a>, or the last region in the chain if none of them have <span>layout containment</span> (See <a data-link-type="biblio" href="#biblio-css-contain-1">[CSS-CONTAIN-1]</a>).</p> <h3 class="heading settled" data-level="2.4" id="named-flow-section"><span class="secno">2.4. </span><span class="content"> Named flows</span><a class="self-link" href="#named-flow-section"></a></h3> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="named-flow">named flow</dfn> is the ordered sequence of content associated with a flow with a given identifier. Contents in a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑨">named flow</a> are ordered according to the document order.</p> <p>Content is placed into a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow①⓪">named flow</a> with the <a class="property" data-link-type="propdesc" href="#propdef-flow-into" id="ref-for-propdef-flow-into">flow-into</a> property. The content in a <span>named flow</span> is laid out in the <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain⑧">region chain</a> that is associated with this <span>named flow</span> using the <a class="property" data-link-type="propdesc" href="#propdef-flow-from" id="ref-for-propdef-flow-from②">flow-from</a> property.</p> <p>Content from a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow①③">named flow</a> is broken up between regions according to the regions flow breaking rules.</p> <p>A <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow①④">named flow</a> is created when some content is moved into the flow with the given identifier or when at least one <a data-link-type="dfn" href="#css-region" id="ref-for-css-region⑦">CSS Region</a> requests content from that flow.</p> <h3 class="heading settled" data-level="2.5" id="regions-flow-breaking-rules"><span class="secno">2.5. </span><span class="content"> Regions flow breaking rules</span><a class="self-link" href="#regions-flow-breaking-rules"></a></h3> <p>Breaking a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow①⑤">named flow</a> across a <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain⑨">region chain</a> is similar to breaking a document’s content across pages (see <a data-link-type="biblio" href="#biblio-css3page">[CSS3PAGE]</a>) or a multi-column container’s content across column boxes (see <a data-link-type="biblio" href="#biblio-css3col">[CSS3COL]</a>). One difference is that page boxes are generated based on the available content whereas a <span>region chain</span> is a set of recipient boxes for the <span>named flow</span> content whose dynamic generation is not in the scope of this specification.</p> <p>Each <a data-link-type="dfn" href="#css-region" id="ref-for-css-region⑧">CSS Region</a> in turn consumes content from its associated <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow①⑦">named flow</a>. The <span>named flow</span> content is positioned in the current region until a natural or forced region break occurs, at which point the next region in the <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain①①">region chain</a> becomes the current region. If there are no more usable <span>CSS Regions</span> in the <span>region chain</span> and there is still content in the flow, the positioning of the remaining content is controlled by the <a class="property" data-link-type="propdesc" href="#propdef-region-fragment" id="ref-for-propdef-region-fragment">region-fragment</a> property on the <a data-link-type="dfn" href="#last-usable-region" id="ref-for-last-usable-region">last usable CSS Region</a> in the chain.</p> <p>The CSS regions module follows the fragmentation rules defined in the CSS Fragmentation Module Level 3 (see <a data-link-type="biblio" href="#biblio-css3-break">[CSS3-BREAK]</a>).</p> <h2 class="heading settled" data-level="3" id="properties"><span class="secno">3. </span><span class="content"> Properties</span><a class="self-link" href="#properties"></a></h2> <h3 class="heading settled" data-level="3.1" id="the-flow-into-property"><span class="secno">3.1. </span><span class="content"> The <a class="property" data-link-type="propdesc" href="#propdef-flow-into" id="ref-for-propdef-flow-into①">flow-into</a> property</span><a class="self-link" href="#the-flow-into-property"></a></h3> <div class="issue-marker wrapper"> <div class="issue-marker"> <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</p> </div> </div> </div> <p>The ‘flow-into’ property can place an element or its contents into a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow①⑨">named flow</a>. Content that belongs to the same flow is laid out in the <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain①③">region chain</a> associated with that flow.</p> <table class="def propdef" data-link-for-hint="flow-into"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-flow-into">flow-into</dfn> <tr class="value"> <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a> <td class="prod">none <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-ident" id="ref-for-typedef-ident"><ident></a> [element<span>|</span>content]<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-opt" id="ref-for-mult-opt">?</a> <tr> <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a> <td>none <tr> <th>Applies to: <td>All elements, but not <a href="https://www.w3.org/TR/selectors/#pseudo-elements">pseudo-elements</a> such as <code>::first-line</code>, <code>::first-letter</code>, <code>::before</code> or <code>::after</code>. <tr> <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a> <td>no <tr> <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a> <td>n/a <tr> <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a> <td>as specified <tr> <th>Canonical order: <td>per grammar <tr> <th><a href="https://drafts.csswg.org/css-transitions/#animatable-properties">Animation type:</a> <td>discrete </table> <dl> <dt>none <dd> The element is not moved to a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow②⓪">named flow</a> and normal CSS processing takes place. <dt><a href="https://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier"><ident></a> <dd> If the keyword <dfn data-dfn-type="dfn" data-noexport id="element">element<a class="self-link" href="#element"></a></dfn> 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 '<a href="https://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier"><ident></a>'. If the keyword <dfn data-dfn-type="dfn" data-noexport id="content">content<a class="self-link" href="#content"></a></dfn> is present, then only the element’s contents are placed into the named flow. The element or content is said to have a <dfn data-dfn-type="dfn" data-noexport id="specified-flow">specified flow<a class="self-link" href="#specified-flow"></a></dfn>. The values <code class="css">none</code>, <code class="css">inherit</code>, <code class="css">default</code>, <code class="css">auto</code> and <code class="css">initial</code> are invalid flow names. </dl> <p>The <a class="property" data-link-type="propdesc" href="#propdef-flow-into" id="ref-for-propdef-flow-into②">flow-into</a> property affects the visual formatting of elements or contents placed into a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow②①">named flow</a> and of the <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain①④">region chain</a> laying out content from a <span>named flow</span>. The <span class="property">flow-into</span> property does not affect the CSS cascade and inheritance for the elements on which it is specified. The <span class="property">flow-into</span> property does not affect the <a href="https://www.w3.org/TR/2012/WD-dom-20120405/#introduction-to-the-dom">DOM</a> <a data-link-type="biblio" href="#biblio-dom">[DOM]</a> position of an element or its contents. The <span class="property">flow-into</span> property does not affect ordering in non-visual media (such as <a href="https://www.w3.org/TR/css3-speech/">speech</a>). Likewise, <span class="property">flow-into</span> does not affect the default traversal order of sequential navigation modes (such as cycling through links, see e.g. <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#sequential-focus-navigation-and-the-tabindex-attribute"><code>tabindex</code></a> <a data-link-type="biblio" href="#biblio-html401">[HTML401]</a>).</p> <p>A <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow②③">named flow</a> needs to be associated with a <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain①⑤">region chain</a> (one or more <a data-link-type="dfn" href="#css-region" id="ref-for-css-region①⓪">CSS Regions</a>) for its content to be visually formatted. If no <span>region chain</span> is associated with a given <span>named flow</span>, the content in the <span>named flow</span> is not rendered: it does not generate boxes and is not displayed.</p> <p>The children of an element or content with a specified flow may themselves have a specified flow, in which case they become the next sibling of the latest element or content collected in that flow. In some cases, the child can become the next sibling for one of its ancestors in the same flow.</p> <p>Content in a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow②⑥">named flow</a> is sequenced in 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> <p>Each <a data-link-type="dfn" href="#css-region" id="ref-for-css-region①①">CSS Region</a> in a <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain①⑦">region chain</a> establishes a containing block for absolutely positioned elements in the <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow②⑦">named flow</a> (see <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>). That first <span>CSS Region</span> in a <span>region chain</span> establishes the initial containing block for such absolutely positioned elements. <span>Regions</span> don’t establish a containing block for fixed positioned elements in the <span>named flow</span>. Such fixed positioned elements are still positioned relative to the viewport or the page area even if they have been redirected into a named flow</p> <p>The first region defines the principal <a href="https://www.w3.org/TR/css3-writing-modes/#writing-mode">writing mode</a> for the entire flow. The writing mode on subsequent regions is ignored.</p> <p>If an element has <a data-link-type="dfn" href="https://drafts.csswg.org/css-contain-1/#style-containment" id="ref-for-style-containment">style containment</a> (See <a data-link-type="biblio" href="#biblio-css-contain-1">[CSS-CONTAIN-1]</a>), then the <a class="property" data-link-type="propdesc" href="#propdef-flow-into" id="ref-for-propdef-flow-into⑦">flow-into</a> property must be <a data-link-type="dfn" href="https://drafts.csswg.org/css-contain-1/#property-scoped" id="ref-for-property-scoped">scoped</a> to that element.</p> <div class="note" role="note"> <span class="note-prefix">Note </span> <p>The <a class="property" data-link-type="propdesc" href="#propdef-flow-into" id="ref-for-propdef-flow-into⑧">flow-into</a> property moves an element into the flow and the interplay with selectors should be considered carefully.</p> <p>For example,</p> <pre>table {flow-into: table-content}</pre> <p>will move all tables in the "table-content" <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow②⑨">named flow</a>. However, the</p> <pre>table > * {flow-into: table-content} ...</pre> <p>selector will move all immediate children of all table elements into the "table-content" <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow③⓪">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</p> <pre>table * {flow-into: table-content}</pre> <p>selector will move all descendants of table elements into the "table-content" <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow③①">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 <span>named flow</span>. Having the descendants become siblings in the <span>named flow</span> results in a different processing (see <a href="https://www.w3.org/TR/2011/REC-CSS2-20110607/tables.html#anonymous-boxes">CSS 2.1’s anonymous table objects</a>). This note illustrates how authors must exercise caution when choosing a particular selector for setting the <a class="property" data-link-type="propdesc" href="#propdef-flow-into" id="ref-for-propdef-flow-into⑨">flow-into</a> property to avoid unintended results.</p> </div> <div class="note" role="note"> <span class="note-prefix">Note </span> <p>Another consequence of moving elements into <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow③④">named flows</a> is that surrounding whitespace is not moved into the named flow. If you have code like this:</p> <pre>span {flow-into: span-content} <span>one</span> <span>two</span> </pre> <p>Then the "span-content" named flow contents will contain this:</p> <pre><span>one</span><span>two</span> </pre> <p>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.</p> </div> <h3 class="heading settled" data-level="3.2" id="flow-from"><span class="secno">3.2. </span><span class="content"> The <a class="property" data-link-type="propdesc" href="#propdef-flow-from" id="ref-for-propdef-flow-from③">flow-from</a> property</span><a class="self-link" href="#flow-from"></a></h3> <p>The <a class="property" data-link-type="propdesc" href="#propdef-flow-from" id="ref-for-propdef-flow-from④">flow-from</a> property makes a block container a region and associates it with a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow③⑤">named flow</a>.</p> <table class="def propdef" data-link-for-hint="flow-from"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-flow-from">flow-from</dfn> <tr class="value"> <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a> <td class="prod"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-ident" id="ref-for-typedef-ident①"><ident></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one②">|</a> none <span>|</span> inherit <tr> <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a> <td>none <tr> <th>Applies to: <td>Non-replaced <a href="https://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><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a> <td>no <tr> <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a> <td>n/a <tr> <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a> <td>as specified <tr> <th>Canonical order: <td>per grammar <tr> <th><a href="https://drafts.csswg.org/css-transitions/#animatable-properties">Animation type:</a> <td>discrete </table> <dl> <dt><strong>none</strong> <dd> The block container is not a <a data-link-type="dfn" href="#css-region" id="ref-for-css-region①③">CSS Region</a>. <dt><strong><a href="https://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier"><ident></a></strong> <dd> The block container becomes a <a data-link-type="dfn" href="#css-region" id="ref-for-css-region①④">CSS Region</a> (except as detailed in the text below), and is ordered in a <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain①⑨">region chain</a> according to its document order. The content from the flow with the <a href="https://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier"><ident></a> name will be <a href="#region-flow-break">broken into fragments</a> and visually formatted in the <a href="https://www.w3.org/TR/CSS21/visuren.html#principal-box">principal boxes</a> of the <span>regions</span> in the <span>region chain</span>. <br> If there is no flow with name <a href="https://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier"><ident></a>, then the block container does not format any content visually. </dl> <p>If the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-content-3/#propdef-content" id="ref-for-propdef-content">content</a> property computes to something else than <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-content-3/#valdef-content-normal" id="ref-for-valdef-content-normal">normal</a> (or <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-content-3/#valdef-content-none" id="ref-for-valdef-content-none">none</a> for a pseudo-element), the block container does not become a <a data-link-type="dfn" href="#css-region" id="ref-for-css-region①⑤">CSS Region</a>. If the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-display-3/#propdef-display" id="ref-for-propdef-display">display</a> property of the block container or one of its ancestors computes to <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-none" id="ref-for-valdef-display-none">none</a>, the block container does not become a <span>CSS Region</span>.</p> <p>A <a data-link-type="dfn" href="#css-region" id="ref-for-css-region①⑦">CSS Region</a>’s document children are not visually formatted unless they are directed to a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow③⑥">named flow</a> with an associated <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain②①">region chain</a>.</p> <p>Block container pseudo-elements where the value of <a class="property" data-link-type="propdesc" href="#propdef-flow-from" id="ref-for-propdef-flow-from⑤">flow-from</a> computes to an <a href="https://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier"><ident></a> and the value of <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-content-3/#propdef-content" id="ref-for-propdef-content①">content</a> computes to <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-content-3/#valdef-content-none" id="ref-for-valdef-content-none①">none</a> are generated as <a data-link-type="dfn" href="#css-region" id="ref-for-css-region①⑧">CSS Regions</a>, which is an update to the behavior described in <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>.</p> <p>If an element has <a data-link-type="dfn" href="https://drafts.csswg.org/css-contain-1/#style-containment" id="ref-for-style-containment①">style containment</a> (See <a data-link-type="biblio" href="#biblio-css-contain-1">[CSS-CONTAIN-1]</a>), then the <a class="property" data-link-type="propdesc" href="#propdef-flow-from" id="ref-for-propdef-flow-from⑥">flow-from</a> property must be <a data-link-type="dfn" href="https://drafts.csswg.org/css-contain-1/#property-scoped" id="ref-for-property-scoped①">scoped</a> to that element.</p> <div class="note" role="note"> <span class="note-prefix">Note </span> <p>A block container becomes a <a data-link-type="dfn" href="#css-region" id="ref-for-css-region①⑨">CSS Region</a> when its <a class="property" data-link-type="propdesc" href="#propdef-flow-from" id="ref-for-propdef-flow-from⑦">flow-from</a> property is set to a valid <a href="https://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier"><ident></a> value, even if there is no content contributing to the referenced flow. For example:</p> <pre><style> .article{ flow-into: thread; } .region{ flow-from: thread; } </style> <html> <body> <div class=region>div content</div> </body> </html> </pre> <p>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 <code>.region</code> selector is still associated with that empty <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow③⑦">named flow</a> and, consequently, its children are not formatted visually.</p> </div> <div class="note" role="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> <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 <a data-link-type="dfn" href="#css-region" id="ref-for-css-region②⓪">CSS Region</a>.</p> </div> <p><a data-link-type="dfn" href="#css-region" id="ref-for-css-region②①">CSS Regions</a> create a new <a href="https://www.w3.org/TR/CSS2/visuren.html#z-index">stacking context</a>. <span>CSS Regions</span> establish a new <a href="https://www.w3.org/TR/CSS2/visuren.html#block-formatting">block formatting Context</a>. Exclusions (see <a data-link-type="biblio" href="#biblio-css3-exclusions">[CSS3-EXCLUSIONS]</a>) potentially impact the content laid out in <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain②②">region chains</a>, just as for non-regions.</p> <div class="note" role="note"> <span class="note-prefix">Note </span> <p>With <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain②③">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 <a data-link-type="dfn" href="#css-region" id="ref-for-css-region②③">CSS Region</a> 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> <p>Fragments rendering separately is also relevant to elements that might normally be rendered as a unit (for example, an element with its own stacking context, or with transparency). Each fragment of these elements is separately contained in the stacking context created by the <a data-link-type="dfn" href="#css-region" id="ref-for-css-region②④">CSS Region</a>, so each fragment of these elements is rendered separately.</p> </div> <p>See the <a href="#regions-visual-formatting-details">regions visual formatting details</a> section for a description of how <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width" id="ref-for-propdef-width">width</a> and <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height" id="ref-for-propdef-height">height</a> values are resolved for <a data-link-type="dfn" href="#css-region" id="ref-for-css-region②⑤">CSS Region</a> boxes.</p> <h4 class="heading settled" data-level="3.2.1" id="circular-dependencies"><span class="secno">3.2.1. </span><span class="content"> Cycle Detection</span><a class="self-link" href="#circular-dependencies"></a></h4> <p><a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow③⑧">named flows</a> containing elements where the value of <a class="property" data-link-type="propdesc" href="#propdef-flow-from" id="ref-for-propdef-flow-from⑧">flow-from</a> computes to an <a href="https://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier"><ident></a> can produce nonsensical circular relationships, such as a <span>named flow</span> containing <a data-link-type="dfn" href="#css-region" id="ref-for-css-region②⑥">CSS Regions</a> in its own <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain②④">region chain</a>. These relationships can be easily and reliably detected and resolved, however, by keeping track of a dependency graph and using common cycle-detection algorithms.</p> <p>The dependency graph consists of edges such that:</p> <ul> <li> Every <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow④⓪">named flow</a> depends on its elements where the value of <a class="property" data-link-type="propdesc" href="#propdef-flow-from" id="ref-for-propdef-flow-from⑨">flow-from</a> computes to an <a href="https://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier"><ident></a>. <li> Every element in a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow④①">named flow</a> where the value of <a class="property" data-link-type="propdesc" href="#propdef-flow-from" id="ref-for-propdef-flow-from①⓪">flow-from</a> computes to an <a href="https://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier"><ident></a> depends on the <span>named flow</span> with the <a href="https://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier"><ident></a> name. </ul> <p>If the graph contains a cycle, any elements where the value of <a class="property" data-link-type="propdesc" href="#propdef-flow-from" id="ref-for-propdef-flow-from①①">flow-from</a> computes to an <a href="https://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier"><ident></a> participating in the cycle do not become <a data-link-type="dfn" href="#css-region" id="ref-for-css-region②⑦">CSS Regions</a>.</p> <div class="note" role="note"> <span class="note-prefix">Note </span> <p>For example, styling like this:</p> <pre>#id { flow-into: foolish; flow-from: foolish; } </pre> <p>would move the <code>#id</code> element to a "foolish" <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow④③">named flow</a>, and try to make the <code>#id</code> element a <a data-link-type="dfn" href="#css-region" id="ref-for-css-region②⑧">CSS Region</a> for the "foolish" <span>named flow</span>. The "foolish" <span>named flow</span> would then contain its own region, creating a cycle. So the <code>#id</code> element does not become a <span>CSS Region</span>.</p> </div> <div class="note" role="note"> <span class="note-prefix">Note </span> <p>The content keyword can be used to break cycles in some circumstances:</p> <pre>#id { flow-into: not-so-foolish content; flow-from: not-so-foolish; } </pre> <p>Here only the contents of the <code>#id</code> element are moved to the <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow④⑥">named flow</a>, and the box for the <code>#id</code> element <em>does</em> become a <a data-link-type="dfn" href="#css-region" id="ref-for-css-region③⓪">CSS Region</a>. Since the <span>named flow</span> does not contain the element itself, there is no cycle. With this declaration the <code>#id</code> element becomes a single-box <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain②⑤">region chain</a> for its contents, and other boxes could be added to the chain to customize overflow.</p> </div> <h4 class="heading settled" data-level="3.2.2" id="fragmenting-regions"><span class="secno">3.2.2. </span><span class="content"> Nested fragmentation contexts</span><a class="self-link" href="#fragmenting-regions"></a></h4> <p>A <a data-link-type="dfn" href="#css-region" id="ref-for-css-region③①">CSS Region</a> that contains a fragment of a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow④⑧">named flow</a> can itself be fragmented if it is nested within a fragmentation context <a data-link-type="biblio" href="#biblio-css3-break">[CSS3-BREAK]</a>, such as when a layout using a <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain②⑥">region chain</a> is printed. In these cases break opportunities in the named flow fragment contained by the <span>CSS Region</span> are determined using the standard <a href="https://www.w3.org/TR/css3-break/">fragmentation rules</a>. In other words, each region box and its associated fragment should break as if it were a simple div containing the fragment contents. This can be controlled by using an avoid break value on the <span>CSS Region</span>, if that is desired.</p> <p>A <a data-link-type="dfn" href="#css-region" id="ref-for-css-region③④">CSS Region</a> can be part of the contents of a separate named flow, as long as there are no cycles broken by the <a href="#circular-dependencies">Cycle Detection</a> described above. This case is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="nested-region-context">nested region context</dfn>, which has an effect on the <a href="#regions-visual-formatting-steps">Visual Formatting Steps</a> described below.</p> <h3 class="heading settled" data-level="3.3" id="region-flow-break"><span class="secno">3.3. </span><span class="content"> Region flow break properties: <a class="property" data-link-type="propdesc" href="#propdef-break-before" id="ref-for-propdef-break-before">break-before</a>, <a class="property" data-link-type="propdesc" href="#propdef-break-after" id="ref-for-propdef-break-after">break-after</a>, <a class="property" data-link-type="propdesc" href="#propdef-break-inside" id="ref-for-propdef-break-inside">break-inside</a></span><a class="self-link" href="#region-flow-break"></a></h3> <div class="note" role="note"> <span class="note-prefix">Note </span> <p>This section is also defined in <a data-link-type="biblio" href="#biblio-css3-break">[CSS3-BREAK]</a>. If that specification moves to last call with the region values, the section here can be replaced by a reference.</p> </div> <p>User agents laying out content in multiple regions must determine where content breaks occur. The problem of breaking content into fragments fitting in regions is similar to breaking content into pages or columns.</p> <p>Each break ends layout in the current region and causes remaining pieces of content from the <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow④⑨">named flow</a> to be visually formatted in the following region in the <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain②⑦">region chain</a>, if there is one.</p> <p>The following extends the <a class="property" data-link-type="propdesc" href="#propdef-break-before" id="ref-for-propdef-break-before①">break-before</a>, <a class="property" data-link-type="propdesc" href="#propdef-break-after" id="ref-for-propdef-break-after①">break-after</a> and <a class="property" data-link-type="propdesc" href="#propdef-break-inside" id="ref-for-propdef-break-inside①">break-inside</a> properties from the <a data-link-type="biblio" href="#biblio-css3col">[CSS3COL]</a> specification to account for regions. The additional values are described below.</p> <table class="def propdef" data-link-for-hint="break-before"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-break-before">break-before</dfn> <tr class="value"> <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a> <td class="prod">auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one④">|</a> always <span>|</span> avoid <span>|</span> left <span>|</span> right <span>|</span> page <span>|</span> column <span>|</span> region <span>|</span> avoid-page <span>|</span> avoid-column <span>|</span> avoid-region <tr> <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a> <td>auto <tr> <th>Applies to: <td>block-level elements <tr> <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a> <td>no <tr> <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a> <td>n/a <tr> <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a> <td>as specified <tr> <th>Canonical order: <td>per grammar <tr> <th><a href="https://drafts.csswg.org/css-transitions/#animatable-properties">Animation type:</a> <td>discrete </table> <table class="def propdef" data-link-for-hint="break-after"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-break-after">break-after</dfn> <tr class="value"> <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a> <td class="prod">auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①④">|</a> always <span>|</span> avoid <span>|</span> left <span>|</span> right <span>|</span> page <span>|</span> column <span>|</span> region <span>|</span> avoid-page <span>|</span> avoid-column <span>|</span> avoid-region <tr> <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a> <td>auto <tr> <th>Applies to: <td>block-level elements <tr> <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a> <td>no <tr> <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a> <td>n/a <tr> <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a> <td>as specified <tr> <th>Canonical order: <td>per grammar <tr> <th><a href="https://drafts.csswg.org/css-transitions/#animatable-properties">Animation type:</a> <td>discrete </table> <table class="def propdef" data-link-for-hint="break-inside"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-break-inside">break-inside</dfn> <tr class="value"> <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a> <td class="prod">auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one②④">|</a> avoid <span>|</span> avoid-page <span>|</span> avoid-column <span>|</span> avoid-region <tr> <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a> <td>auto <tr> <th>Applies to: <td>block-level elements <tr> <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a> <td>no <tr> <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a> <td>n/a <tr> <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a> <td>as specified <tr> <th>Canonical order: <td>per grammar <tr> <th><a href="https://drafts.csswg.org/css-transitions/#animatable-properties">Animation type:</a> <td>discrete </table> <p>These properties describe page, column and region break behavior before/after/inside the generated box. These values are normatively defined in <a data-link-type="biblio" href="#biblio-css3col">[CSS3COL]</a>:</p> <p>This specification adds the following new values:</p> <dl> <dt>region <dd>Always force a region break before (after) the generated box. <dt>avoid-region <dd>Avoid a region break before (after, inside) the generated box. </dl> <p>The behavior of region breaks with regards to regions is identical to the behavior of page breaks with regards to pages, as defined in the <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>.</p> <h3 class="heading settled" data-level="3.4" id="the-region-fragment-property"><span class="secno">3.4. </span><span class="content"> The region-fragment property</span><a class="self-link" href="#the-region-fragment-property"></a></h3> <table class="def propdef" data-link-for-hint="region-fragment"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-region-fragment">region-fragment</dfn> <tr class="value"> <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a> <td class="prod">auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one②⑧">|</a> break <tr> <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a> <td>auto <tr> <th>Applies to: <td><a data-link-type="dfn" href="#css-region" id="ref-for-css-region③⑤">CSS Regions</a> <tr> <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a> <td>no <tr> <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a> <td>n/a <tr> <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a> <td>as specified <tr> <th>Canonical order: <td>per grammar <tr> <th><a href="https://drafts.csswg.org/css-transitions/#animatable-properties">Animation type:</a> <td>discrete </table> <p>The <a class="property" data-link-type="propdesc" href="#propdef-region-fragment" id="ref-for-propdef-region-fragment①">region-fragment</a> property controls the behavior of the <a data-link-type="dfn" href="#last-usable-region" id="ref-for-last-usable-region①">last usable region</a> associated with a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑤⓪">named flow</a>.</p> <dl> <dt>auto <dd> Content flows as it would in a regular content box. If the content exceeds the container box, it is subject to the <a href="https://www.w3.org/TR/CSS21/visufx.html#propdef-overflow">overflow</a> property’s computed value on the <a data-link-type="dfn" href="#css-region" id="ref-for-css-region③⑥">CSS Region</a>. Region breaks must be ignored on the <a data-link-type="dfn" href="#last-usable-region" id="ref-for-last-usable-region②">last usable region</a>. <dt>break <dd> <p>If the content fits within the <a data-link-type="dfn" href="#css-region" id="ref-for-css-region③⑦">CSS Region</a>, then this property has no effect. If the content does not fit within the <span>CSS Region</span>, the content breaks as if flow was going to continue in a subsequent region. See the <a href="#regions-flow-breaking-rules">breaking rules</a> section. A forced region break takes precedence over a natural break point.</p> <p>Flow content that follows the last break in the <a data-link-type="dfn" href="#last-usable-region" id="ref-for-last-usable-region③">last usable region</a> is not rendered.</p> </dl> <p>The <a class="property" data-link-type="propdesc" href="#propdef-region-fragment" id="ref-for-propdef-region-fragment②">region-fragment</a> property does not influence the size of the region it applies to.</p> <p>The following code sample illustrates the usage of the <a class="property" data-link-type="propdesc" href="#propdef-region-fragment" id="ref-for-propdef-region-fragment③">region-fragment</a> property.</p> <div class="example" id="example-0bff9c90"> <a class="self-link" href="#example-0bff9c90"></a> <pre><style> article { flow-into: article-flow; } #region-1, #region-2 { flow-from: article-flow; <strong>region-fragment: break;</strong> /* or auto */ <strong>overflow: visible;</strong> /* or hidden */ } </style> <body> <article>...</article> <div id="region-1"></div> <div id="region-2"></div> </body> </pre> </div> <figure> <table style="border: 1px solid gray;width: 100%;"> <tbody> <tr> <td>article with two<br> overflowing lines <td><code>region-fragment: break<br> overflow: visible</code> <td><code>region-fragment: auto<br> overflow: visible</code> <tr> <td rowspan="3" style="vertical-align: top;"><img alt="flow content rendering" src="images/region-overflow-flow.png"> <td><img alt="rendering with region-fragment:break and overflow:visible" src="images/region-overflow-break-visible.png"> <td><img alt="rendering with region-fragment:auto and overflow:visible" src="images/region-overflow-auto-visible.png"> <tr> <td><code>region-fragment: break<br> overflow: hidden</code> <td><code>region-fragment: auto<br> overflow: hidden</code> <tr> <td><img alt="rendering with region-fragment:break and overflow:hidden" src="images/region-overflow-break-hidden.png"> <td><img alt="rendering with region-fragment:auto and overflow:hidden" src="images/region-overflow-auto-hidden.png"> </table> <figcaption> Combinations of region-fragment and overflow. </figcaption> </figure> <div class="note" role="note"> <span class="note-prefix">Note </span> <p>The <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-overflow-3/#propdef-overflow" id="ref-for-propdef-overflow">overflow</a> property is honored on a region: if region content overflows, such as the borders of elements on the last line, the <span class="property">overflow</span> property controls the visibility of the overflowing content. See the <span class="property">overflow</span> property definition (<a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>).</p> </div> <h2 class="heading settled" data-level="4" id="cssom_view_and_css_regions"><span class="secno">4. </span><span class="content"> CSSOM</span><a class="self-link" href="#cssom_view_and_css_regions"></a></h2> <p>Since content may flow into multiple regions, authors need a way to determine if there are enough regions to flow all the content from a named flow. This is especially important considering that the size of regions or the size of the content may change depending on the display context. For example, flowing the same content on a mobile phone with a small screen may require more regions than on a large desktop display. Another example is the user changing the font size of text flowing through regions. Depending on the change, new regions may be needed to accommodate for the additional space required to fit the larger text or some regions may need to be removed for smaller text.</p> <h3 class="heading settled" data-level="4.1" id="the-namedflow-interface"><span class="secno">4.1. </span><span class="content"> The NamedFlow interface</span><a class="self-link" href="#the-namedflow-interface"></a></h3> <p>The following APIs allow scripts to reference a <a data-link-type="idl" href="#namedflow" id="ref-for-namedflow">NamedFlow</a> object representation of a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑤①">named flow</a>.</p> <p>An additional attribute on the <a href="https://www.w3.org/TR/dom/#interface-document"> <code class="idl">Document</code></a> interface provide access to <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑤②">named flows</a>.</p> <pre class="idl highlight def"><c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://dom.spec.whatwg.org/#document" id="ref-for-document"><c- g>Document</c-></a> { <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#namedflowmap" id="ref-for-namedflowmap"><c- n>NamedFlowMap</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="NamedFlowMap" href="#dom-document-namedflows" id="ref-for-dom-document-namedflows"><c- g>namedFlows</c-></a>; }; </pre> <p>The <dfn data-dfn-type="dfn" data-noexport id="document-namedflows"><code class="idl">namedFlows</code><a class="self-link" href="#document-namedflows"></a></dfn> attribute on the <a href="https://www.w3.org/TR/dom/#interface-document"> <code class="idl">Document</code> </a> interface returns a static snapshot of all the current <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑤③">named flows</a> in the document.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Document" data-dfn-type="attribute" data-export id="dom-document-namedflows"><code class="idl">namedFlows</code></dfn> map must include all <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑤④">named flows</a> that are currently in the <code>CREATED</code> state. The list must not include <span>named flows</span> that are in the <code>NULL</code> state.</p> <p>The <code class="idl"><a data-link-type="idl" href="#namedflowmap" id="ref-for-namedflowmap①">NamedFlowMap</a></code> interface provides a map of current <a data-link-type="idl" href="#namedflow" id="ref-for-namedflow①">NamedFlow</a> instances in the document. The <a data-link-type="idl" href="#namedflowmap" id="ref-for-namedflowmap②">NamedFlowMap</a> object is a snapshot of the data, and is read-only.</p> <pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute"><c- g>MapClass</c-></a>=(<a class="n" data-link-type="idl-name" href="https://drafts.csswg.org/cssom-1/#cssomstring" id="ref-for-cssomstring"><c- n>CSSOMString</c-></a>, <a class="n" data-link-type="idl-name" href="#namedflow" id="ref-for-namedflow②"><c- n>NamedFlow</c-></a>)] <c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="namedflowmap"><code><c- g>NamedFlowMap</c-></code></dfn> { <a class="n" data-link-type="idl-name" href="#namedflow" id="ref-for-namedflow③"><c- n>NamedFlow</c-></a>? <dfn class="idl-code" data-dfn-for="NamedFlowMap" data-dfn-type="method" data-export data-lt="get(flowName)" id="dom-namedflowmap-get"><code><c- g>get</c-></code><a class="self-link" href="#dom-namedflowmap-get"></a></dfn>(<a class="n" data-link-type="idl-name" href="https://drafts.csswg.org/cssom-1/#cssomstring" id="ref-for-cssomstring①"><c- n>CSSOMString</c-></a> <dfn class="idl-code" data-dfn-for="NamedFlowMap/get(flowName)" data-dfn-type="argument" data-export id="dom-namedflowmap-get-flowname-flowname"><code><c- g>flowName</c-></code><a class="self-link" href="#dom-namedflowmap-get-flowname-flowname"></a></dfn>); <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="NamedFlowMap" data-dfn-type="method" data-export data-lt="has(flowName)" id="dom-namedflowmap-has"><code><c- g>has</c-></code><a class="self-link" href="#dom-namedflowmap-has"></a></dfn>(<a class="n" data-link-type="idl-name" href="https://drafts.csswg.org/cssom-1/#cssomstring" id="ref-for-cssomstring②"><c- n>CSSOMString</c-></a> <dfn class="idl-code" data-dfn-for="NamedFlowMap/has(flowName)" data-dfn-type="argument" data-export id="dom-namedflowmap-has-flowname-flowname"><code><c- g>flowName</c-></code><a class="self-link" href="#dom-namedflowmap-has-flowname-flowname"></a></dfn>); <a class="n" data-link-type="idl-name" href="#namedflowmap" id="ref-for-namedflowmap③"><c- n>NamedFlowMap</c-></a> <dfn class="idl-code" data-dfn-for="NamedFlowMap" data-dfn-type="method" data-export data-lt="set(flowName, flowValue)" id="dom-namedflowmap-set"><code><c- g>set</c-></code><a class="self-link" href="#dom-namedflowmap-set"></a></dfn>(<a class="n" data-link-type="idl-name" href="https://drafts.csswg.org/cssom-1/#cssomstring" id="ref-for-cssomstring③"><c- n>CSSOMString</c-></a> <dfn class="idl-code" data-dfn-for="NamedFlowMap/set(flowName, flowValue)" data-dfn-type="argument" data-export id="dom-namedflowmap-set-flowname-flowvalue-flowname"><code><c- g>flowName</c-></code><a class="self-link" href="#dom-namedflowmap-set-flowname-flowvalue-flowname"></a></dfn>, <a class="n" data-link-type="idl-name" href="#namedflow" id="ref-for-namedflow④"><c- n>NamedFlow</c-></a> <dfn class="idl-code" data-dfn-for="NamedFlowMap/set(flowName, flowValue)" data-dfn-type="argument" data-export id="dom-namedflowmap-set-flowname-flowvalue-flowvalue"><code><c- g>flowValue</c-></code><a class="self-link" href="#dom-namedflowmap-set-flowname-flowvalue-flowvalue"></a></dfn>); <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="NamedFlowMap" data-dfn-type="method" data-export data-lt="delete(flowName)" id="dom-namedflowmap-delete"><code><c- g>delete</c-></code><a class="self-link" href="#dom-namedflowmap-delete"></a></dfn>(<a class="n" data-link-type="idl-name" href="https://drafts.csswg.org/cssom-1/#cssomstring" id="ref-for-cssomstring④"><c- n>CSSOMString</c-></a> <dfn class="idl-code" data-dfn-for="NamedFlowMap/delete(flowName)" data-dfn-type="argument" data-export id="dom-namedflowmap-delete-flowname-flowname"><code><c- g>flowName</c-></code><a class="self-link" href="#dom-namedflowmap-delete-flowname-flowname"></a></dfn>); }; </pre> <p>The map entries in a <a data-link-type="idl" href="#namedflowmap" id="ref-for-namedflowmap④">NamedFlowMap</a> object are the named flow idents paired with their <a data-link-type="idl" href="#namedflow" id="ref-for-namedflow⑤">NamedFlow</a> objects. The <dfn class="idl-code" data-dfn-for="NamedFlowMap" data-dfn-type="method" data-export id="dom-namedflowmap-get①"><code>get()</code><a class="self-link" href="#dom-namedflowmap-get①"></a></dfn> and <dfn class="idl-code" data-dfn-for="NamedFlowMap" data-dfn-type="method" data-export id="dom-namedflowmap-has①"><code>has()</code><a class="self-link" href="#dom-namedflowmap-has①"></a></dfn> methods return null and false respectively if there is no <span>NamedFlow</span> with the given ident. The <dfn class="idl-code" data-dfn-for="NamedFlowMap" data-dfn-type="method" data-export id="dom-namedflowmap-set①"><code>set()</code><a class="self-link" href="#dom-namedflowmap-set①"></a></dfn> and <dfn class="idl-code" data-dfn-for="NamedFlowMap" data-dfn-type="method" data-export id="dom-namedflowmap-delete①"><code>delete()</code><a class="self-link" href="#dom-namedflowmap-delete①"></a></dfn> methods always throw an <code>InvalidAccessError</code> exception, as this map is read-only. The <span>NamedFlowMap</span> interface uses the rest of the default map <a href="http://dev.w3.org/2006/webapi/WebIDL/#es-map-members">class methods</a>.</p> <p>The <code class="idl"><a data-link-type="idl" href="#namedflow" id="ref-for-namedflow⑦">NamedFlow</a></code> interface offers a representation of a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑤⑥">named flow</a> instance.</p> <p>The <a data-link-type="idl" href="#namedflow" id="ref-for-namedflow⑧">NamedFlow</a> interface can be used for different purposes. For example, the <code>getRegionsByContent()</code> method can help navigate by bookmark: a script can find the <a data-link-type="dfn" href="#css-region" id="ref-for-css-region③⑨">CSS Regions</a> that display a particular anchor and bring them to view.</p> <p>Likewise, the interface allows authors to check if all content has been fitted into existing regions. If it has, the <a data-link-type="idl" href="#dom-namedflow-overset" id="ref-for-dom-namedflow-overset">overset</a> attribute would be false.</p> <pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①"><c- g>Exposed</c-></a>=<c- n>Window</c->] <c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="namedflow"><code><c- g>NamedFlow</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget"><c- n>EventTarget</c-></a> { <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://drafts.csswg.org/cssom-1/#cssomstring" id="ref-for-cssomstring⑤"><c- n>CSSOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="CSSOMString" href="#dom-namedflow-name" id="ref-for-dom-namedflow-name"><c- g>name</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean②"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-namedflow-overset" id="ref-for-dom-namedflow-overset①"><c- g>overset</c-></a>; <c- b>sequence</c-><<a class="n" data-link-type="idl-name" href="#region" id="ref-for-region"><c- n>Region</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-namedflow-getregions" id="ref-for-dom-namedflow-getregions"><c- g>getRegions</c-></a>(); <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-short" id="ref-for-idl-short"><c- b>short</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="short" href="#dom-namedflow-firstemptyregionindex" id="ref-for-dom-namedflow-firstemptyregionindex"><c- g>firstEmptyRegionIndex</c-></a>; <c- b>sequence</c-><<a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#node" id="ref-for-node"><c- n>Node</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-namedflow-getcontent" id="ref-for-dom-namedflow-getcontent"><c- g>getContent</c-></a>(); <c- b>sequence</c-><<a class="n" data-link-type="idl-name" href="#region" id="ref-for-region①"><c- n>Region</c-></a>> <dfn class="idl-code" data-dfn-for="NamedFlow" data-dfn-type="method" data-export data-lt="getRegionsByContent(node)" id="dom-namedflow-getregionsbycontent"><code><c- g>getRegionsByContent</c-></code><a class="self-link" href="#dom-namedflow-getregionsbycontent"></a></dfn>(<a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#node" id="ref-for-node①"><c- n>Node</c-></a> <dfn class="idl-code" data-dfn-for="NamedFlow/getRegionsByContent(node)" data-dfn-type="argument" data-export id="dom-namedflow-getregionsbycontent-node-node"><code><c- g>node</c-></code><a class="self-link" href="#dom-namedflow-getregionsbycontent-node-node"></a></dfn>); }; </pre> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="NamedFlow" data-dfn-type="attribute" data-export id="dom-namedflow-name"><code class="idl">name</code></dfn> attribute returns the name of the <a data-link-type="idl" href="#namedflow" id="ref-for-namedflow⑨">NamedFlow</a> instance.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="NamedFlow" data-dfn-type="attribute" data-export id="dom-namedflow-overset"><code class="idl">overset</code></dfn> attribute returns true if there are <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑤⑦">named flow</a> fragments that do not fit in the associated <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain②⑧">region chain</a> (including the case where there are <span>named flow</span> fragments but no regions in the <span>region chain</span>). Otherwise, it returns false.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="NamedFlow" data-dfn-type="method" data-export id="dom-namedflow-getregions"><code class="idl">getRegions()</code></dfn> method returns the sequence of regions in the <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain③⓪">region chain</a> associated with the <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑤⑨">named flow</a>. Regions after the <a data-link-type="dfn" href="#last-usable-region" id="ref-for-last-usable-region④">last usable region</a>, if any, are included. Note that the returned values is a static sequence in document order.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="NamedFlow" data-dfn-type="attribute" data-export id="dom-namedflow-firstemptyregionindex"><code>firstEmptyRegionIndex</code></dfn> is the index of the first region in the <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain③①">region chain</a> with the <code>regionOverset</code> attribute set to <code>empty</code>. If all regions have the <code>regionOverset</code> attribute set to <code>fit</code> or <code>overset</code>, the value for <code>firstEmptyRegionIndex</code> is <code>-1</code>. If there are no regions in the <span>region chain</span>, the value is <code>-1</code> as well.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="NamedFlow" data-dfn-type="method" data-export id="dom-namedflow-getcontent"><code>getContent()</code></dfn> method returns an ordered collection of nodes that constitute the <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑥⓪">named flow</a>. The returned list is a static snapshot of the <span>named flow</span> content at the time the method is invoked. This list contains the contents that were moved to the <span>named flow</span> by the flow-into property but not any descendants (unless the descendants are themselves moved to the <span>named flow</span>).</p> <p>The <dfn class="idl-code" data-dfn-for="NamedFlow" data-dfn-type="method" data-export id="dom-namedflow-getregionsbycontent①"><code>getRegionsByContent()</code><a class="self-link" href="#dom-namedflow-getregionsbycontent①"></a></dfn> method returns the sequence of regions that contain at least part of the target content node if it belongs to the <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑥④">named flow</a> directly or one of its ancestors belongs to the <span>named flow</span>. Otherwise, the method returns an empty sequence. The returned value is a static sequence in document order.</p> <p>The <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑥⑥">named flow</a> states are :</p> <ul> <li> <code class="idl">NULL</code>: the <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑥⑦">named flow</a> contains no conent and has no <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain③③">region chain</a>. <li> <code class="idl">CREATED</code>: the <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑥⑧">named flow</a> either contains content or has a <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain③④">region chain</a>. </ul> <p>A <a data-link-type="idl" href="#namedflow" id="ref-for-namedflow①⓪">NamedFlow</a> object is live: it always represents the <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑥⑨">named flow</a> with the corresponding name even if that <span>named flow</span> has transitioned to the <code>NULL</code> state.</p> <h3 class="heading settled" data-level="4.2" id="the-region-interface"><span class="secno">4.2. </span><span class="content"> The Region interface</span><a class="self-link" href="#the-region-interface"></a></h3> <p>The <code class="idl"><a data-link-type="idl" href="#region" id="ref-for-region②">Region</a></code> interface is a <a href="https://www.w3.org/TR/WebIDL/#idl-implements-statements">supplemental interface</a> which must be implemented by all objects (<a href="https://www.w3.org/TR/dom/#interface-element"> <code class="idl">Elements</code></a>, pseudo-elements or other CSS constructs such as <a href="https://drafts.csswg.org/css3-page-template/#templates-and-slots">slots</a>) in an implementation which can be <a data-link-type="dfn" href="#css-region" id="ref-for-css-region④⓪">CSS Regions</a>.</p> <pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed②"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NoInterfaceObject" id="ref-for-NoInterfaceObject"><c- g>NoInterfaceObject</c-></a>] <c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="region"><code><c- g>Region</c-></code></dfn> { <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://drafts.csswg.org/cssom-1/#cssomstring" id="ref-for-cssomstring⑥"><c- n>CSSOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="CSSOMString" href="#dom-region-regionoverset" id="ref-for-dom-region-regionoverset"><c- g>regionOverset</c-></a>; <c- b>sequence</c-><<a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#range" id="ref-for-range"><c- n>Range</c-></a>>? <a class="idl-code" data-link-type="method" href="#dom-region-getregionflowranges" id="ref-for-dom-region-getregionflowranges"><c- g>getRegionFlowRanges</c-></a>(); }; <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#element" id="ref-for-element"><c- n>Element</c-></a> <c- b>implements</c-> <a class="n" data-link-type="idl-name" href="#region" id="ref-for-region③"><c- n>Region</c-></a>; </pre> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Region" data-dfn-type="attribute" data-export id="dom-region-regionoverset"><code class="idl">regionOverset</code></dfn> attribute returns one of the following values:</p> <dl> <dt><span class="css">overset</span> <dd> The region is the <a data-link-type="dfn" href="#last-usable-region" id="ref-for-last-usable-region⑤">last usable region</a> in the <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain③⑤">region chain</a> and not able to fit the remaining content from the <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑦①">named flow</a>. Note that the region’s <a href="https://www.w3.org/TR/CSS21/visufx.html#overflow"> <code class="idl">overflow</code></a> property value can be used to control the visibility of the overflowing content and the <a class="property" data-link-type="propdesc" href="#propdef-region-fragment" id="ref-for-propdef-region-fragment④">region-fragment</a> property controls whether or not fragmentation happens on the content that overflows the <span>last usable region</span>. <dt><span class="css">fit</span> <dd> The region’s flow fragment content fits into the region’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-box-3/#content-box" id="ref-for-content-box">content box</a>. If the region is the <a data-link-type="dfn" href="#last-usable-region" id="ref-for-last-usable-region⑦">last usable region</a> in the <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain③⑥">region chain</a>, it means that the content fits without overflowing. If the region is not the <span>last usable region</span> in the <span>region chain</span>, that means the <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑦②">named flow</a> content may be further fitted in subsequent regions. In this last case, note that the <span>named flow</span> fragment may be empty (for example if the region is too small to accommodate any content). This value is returned if the <a data-link-type="idl" href="#region" id="ref-for-region④">Region</a> object is not (or no longer) a region. <dt><span class="css">empty</span> <dd> All content from the <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑦④">named flow</a> was fitted in prior regions. </dl> <p>If there is no content in the <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑦⑤">named flow</a>, all regions associated with that <span>named flow</span> should have their <a data-link-type="idl" href="#dom-region-regionoverset" id="ref-for-dom-region-regionoverset①">regionOverset</a> attribute return <span class="css">empty</span>. If there is content in the flow but that content does not generate any box for visual formatting, the <span class="css">overset</span> attribute on the first region in the <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain③⑧">region chain</a> associated with the flow will return <span class="css">fit</span>.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Region" data-dfn-type="method" data-export id="dom-region-getregionflowranges"><code>getRegionFlowRanges()</code></dfn> method returns an array of <a href="https://www.w3.org/TR/dom/#interface-range">Range</a> instances corresponding to fragment from the <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑦⑦">named flow</a> that is laid out in the region. If the region has not received a fragment because it is too small to accommodate any, the method returns a single <a data-link-type="idl" href="https://dom.spec.whatwg.org/#range" id="ref-for-range①">Range</a> where the <code>startContainer</code> and <code>startOffset</code> have the same values as the <code>endContainer</code> and <code>endOffset</code> and therefore the collapsed attribute on the <span>Range</span> is true. In that situation, if the region is the first in the <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain③⑨">region chain</a>, the <code>startContainer</code> is the first <code>Node</code> in the <span>named flow</span> and the <code>startOffset</code> is zero. If the region is the <a data-link-type="dfn" href="#last-usable-region" id="ref-for-last-usable-region⑨">last usable region</a> in the <span>region chain</span> (but not the first and only one), the <code>startContainer</code> and <code>startOffset</code> are the same values as the <code>endContainer</code> and <code>endOffset</code> on the previous region in the <span>region chain</span>. The method returns null if the <span>region</span> object is not (or no longer) a region.</p> <p>A <a data-link-type="idl" href="#region" id="ref-for-region⑤">Region</a> instance may represent an object that is no longer a <span>region</span>. This may happen for example if the <a class="property" data-link-type="propdesc" href="#propdef-flow-from" id="ref-for-propdef-flow-from①②">flow-from</a> property on the corresponding pseudo-element, element or other construct becomes <span class="css">none</span> but a script is still holding a reference to the <span>Region</span> object.</p> <h3 class="heading settled" data-level="4.3" id="named-flow-events"><span class="secno">4.3. </span><span class="content"> Named flow events</span><a class="self-link" href="#named-flow-events"></a></h3> <p><a data-link-type="idl" href="#namedflow" id="ref-for-namedflow①①">NamedFlow</a> objects are <a href="https://www.w3.org/TR/dom/#interface-eventtarget">EventTargets</a> which dispatch the following events for their respective triggers. These events are asynchronous, and fire at the end of the <a href="#named-flows-layout">regions visual formatting</a> steps.</p> <p>The regionfragmentchange event is dispatched on any change to a named flow’s fragmentation through its <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain④②">region chain</a>, including changes to any overset fragment.</p> <table class="event-desc" style="border: 1px solid gray"> <tbody> <tr class="assert must"> <th>Type <td class="eventname"><strong><code>regionfragmentchange</code></strong> <tr class="assert must"> <th>Interface <td><code><a href="https://www.w3.org/TR/DOM-Level-3-Events/#events-uievents">UIEvent</a></code> (see <a data-link-type="biblio" href="#biblio-dom-level-3-events">[DOM-LEVEL-3-EVENTS]</a>) <tr class="assert must"> <th>Sync / Async <td>Async <tr class="assert must"> <th>Bubbles <td>No <tr class="assert must"> <th>Target <td><a data-link-type="idl" href="#namedflow" id="ref-for-namedflow①②">NamedFlow</a> <tr class="assert must"> <th>Cancelable <td>Yes <tr class="assert must"> <th>Default action <td>none <tr class="assert must"> <th>Context info <td> <ul> <li><code class="attribute-name">Event.target</code>: <a data-link-type="idl" href="#namedflow" id="ref-for-namedflow①③">NamedFlow</a> whose fragmentation has changed. </ul> </table> <p>The regionoversetchange event is dispatched if any of the regionOverset values change in a named flow’s <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain④③">region chain</a>, including when regions are added or removed from the chain.</p> <table class="event-desc" style="border: 1px solid gray"> <tbody> <tr class="assert must"> <th>Type <td class="eventname"><strong><code>regionoversetchange</code></strong> <tr class="assert must"> <th>Interface <td><code><a href="https://www.w3.org/TR/DOM-Level-3-Events/#events-UIEvent">UIEvent</a></code> (see <a data-link-type="biblio" href="#biblio-dom-level-3-events">[DOM-LEVEL-3-EVENTS]</a>) <tr class="assert must"> <th>Sync / Async <td>Async <tr class="assert must"> <th>Bubbles <td>No <tr class="assert must"> <th>Target <td><a data-link-type="idl" href="#namedflow" id="ref-for-namedflow①④">NamedFlow</a> <tr class="assert must"> <th>Cancelable <td>Yes <tr class="assert must"> <th>Default action <td>none <tr class="assert must"> <th>Context info <td> <ul> <li><code class="attribute-name">Event.target</code>: <a data-link-type="idl" href="#namedflow" id="ref-for-namedflow①⑤">NamedFlow</a> whose <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain④④">region chain</a> has regionOverset values that have changed. </ul> </table> <h3 class="heading settled" data-level="4.4" id="cssomview-and-regions"><span class="secno">4.4. </span><span class="content"> Clarifications on pre-existing APIs</span><a class="self-link" href="#cssomview-and-regions"></a></h3> <h4 class="heading settled" data-level="4.4.1" id="cssomview-getclientrects-and-getboundingclientrect"><span class="secno">4.4.1. </span><span class="content"> <code class="idl">getClientRects()</code> and <code>getBoundingClientRect()</code></span><a class="self-link" href="#cssomview-getclientrects-and-getboundingclientrect"></a></h4> <p>The <a href="https://www.w3.org/TR/cssom-view/">CSSOM View Module</a> defines how user agents compute the bounding client rectangle for an element (<code class="idl">getBoundingClientRect()</code>) and its generated boxes (<code class="idl">getClientRects()</code>).</p> <p>This definition applies to the (possibly) multiple boxes generated for an element in a named flow flowing through a <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain④⑤">region chain</a>. The <code class="idl">getClientRects()</code> method returns the list of boxes generated for each of the element fragments laid out in different regions. The <code>getBoundingClientRect()</code> method operates as specified in the <a href="https://www.w3.org/TR/cssom-view/">CSSOM View Module</a> as well and is computed from the set of rectangles returned by <code class="idl">getClientRects()</code>.</p> <h4 class="heading settled" data-level="4.4.2" id="cssomview-offset-attributes"><span class="secno">4.4.2. </span><span class="content"> <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></span><a class="self-link" href="#cssomview-offset-attributes"></a></h4> <p>The computation of the <a href="https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlelement-interface">offset attributes</a> for elements laid out in a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑦⑨">named flow</a> follow the <a href="https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlelement-interface">specification</a> <a data-link-type="biblio" href="#biblio-cssom">[CSSOM]</a>. For the purpose of these algorithms, the <em>first CSS layout box</em> associated with an element laid out in a <span>named flow</span> is the first box generated for the first region the element is laid out into. In the offsetParent algorithm, the nearest ancestor search skips from the topmost named flow elements directly to the body element.</p> <h2 class="heading settled" data-level="5" id="multi-column-regions"><span class="secno">5. </span><span class="content"> Multi-column regions</span><a class="self-link" href="#multi-column-regions"></a></h2> <p>A <a href="https://drafts.csswg.org/css3-multicol/#multi-column-element">multi-column</a> <a data-link-type="biblio" href="#biblio-css3col">[CSS3COL]</a> element can be assigned to a <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain④⑥">region chain</a>. The element becomes part of the <span>region chain</span> for the associated <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑧①">named flow</a>, and flows its content fragments through columns according to the multi-column specification <span>[CSS3COL]</span>. In particular, when computing the <a href="#rfcb-flow-fragment-height-resolution">flow fragment height</a> of a multi-column container that is associated with a <em><a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑧②">named flow</a></em>, the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-multicol-1/#propdef-column-fill" id="ref-for-propdef-column-fill">column-fill</a> <span>[CSS3COL]</span> property is honored to balance the fragments of content that would flow through its columns.</p> <p>Overflow of multicol regions is mostly handled according to the same rules as other <a data-link-type="dfn" href="#css-region" id="ref-for-css-region④①">CSS Regions</a>. If the remainder of the named flow does not fit in the multicol region, then the rest of the content flows into the remaining <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain④⑧">region chain</a>. However, if a multicol region is the <a data-link-type="dfn" href="#last-usable-region" id="ref-for-last-usable-region①⓪">last usable region</a> in a <span>region chain</span>, then the multicol region must follow the <a href="https://drafts.csswg.org/css3-multicol/#overflow-columns">overflow column rules</a> <a data-link-type="biblio" href="#biblio-css3col">[CSS3COL]</a>.</p> <div class="example" id="example-b3d3d94a"> <a class="self-link" href="#example-b3d3d94a"></a> <p>The following example:</p> <pre><style> article { flow-into: article-flow; } #multi-col { column-count: 2; flow-from: article; height: 6em; column-gap: 1em; } #remainder { flow-from: article; height: auto; } </style> <body> <article>...</article> <div id="multicol"></div> <div id="remainder"></div> </body> </pre> <p>is equivalent in rendering to, for example:</p> <pre><style> article { flow-into: article-flow; } #flex { display: flex; flex-pack: justify; height: 6em; } #flex > div { flow-from: article; width: calc(50% - 0.5em); } #remainder { flow-from: article; height: auto; } </style> <body> <article>...</article> <div id="flex"> <div /> <div /> </div> <div id="remainder"></div> </body> </pre> </div> <h2 class="heading settled" data-level="6" id="pseudo_elements"><span class="secno">6. </span><span class="content"> Pseudo-elements</span><a class="self-link" href="#pseudo_elements"></a></h2> <p>It can be useful to visually mark the content to highlight that a content thread is flowing through the <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain⑤⓪">region chain</a>. For example, a marker such as <em>'continued below'</em> clearly indicates, at the end of a <a data-link-type="dfn" href="#css-region" id="ref-for-css-region④②">CSS Region</a>, that there is more content in the flow which can be found by scrolling past whatever content interrupts the <span>region chain</span>.</p> <p>The '::before' and '::after' pseudo-elements (see <a data-link-type="biblio" href="#biblio-select">[SELECT]</a>) let content authors mark the beginning and end of a region with such markers.</p> <h2 class="heading settled" data-level="7" id="regions-visual-formatting-details"><span class="secno">7. </span><span class="content"> Regions visual formatting details</span><a class="self-link" href="#regions-visual-formatting-details"></a></h2> <p>Regions are laid out by CSS and take part in the normal box model and other layout models offered by CSS modules such as flexible boxes (<a data-link-type="biblio" href="#biblio-css3-flexbox">[CSS3-FLEXBOX]</a>). However, <span>regions</span> lay out a fragment of their <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑧③">named flow</a> instead of laying out descendant content as happens with other boxes.</p> <p>This section describes the model for laying out <span>regions</span> and for laying out <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑧④">named flow</a> content into regions. The descriptions in this section are biased towards a horizontal writing mode, using <span class="css">width</span> for logical width (or measure) and <span class="css">height</span> for logical height (or extent) as <a href="https://www.w3.org/TR/css3-writing-modes/#abstract-dimensions">defined</a> in the CSS Writing Modes Module <a data-link-type="biblio" href="#biblio-css3-writing-modes">[CSS3-WRITING-MODES]</a>). To use this model in a vertical writing mode apply the principles <a href="https://www.w3.org/TR/css3-writing-modes/#vertical-layout">described</a> in that specification.</p> <h3 class="heading settled" data-level="7.1" id="processing-model"><span class="secno">7.1. </span><span class="content"> Processing model</span><a class="self-link" href="#processing-model"></a></h3> <p>The '::before' content is laid out in the region prior to any other content coming from the flow.</p> <p>The '::after' content is laid out in the region after laying out the flow fragment content into the <span>RFCB</span>. Then, flow content is removed from the fragment to accommodate the '::after' content. Accommodating means that the '::after' content is laid out without overflowing the region.</p> <p>If there is not enough room to accommodate the ::before content, the '::after' content after removing all flow fragment content, or a combination of the two, then the ::before and/or ::after content overflows that region.</p> <h3 class="heading settled" data-level="7.2" id="regions-flow-content-box"><span class="secno">7.2. </span><span class="content"> The Region Flow Content Box (RFCB)</span><a class="self-link" href="#regions-flow-content-box"></a></h3> <p>A region box lays out the following boxes:</p> <ul> <li> The boxes generated by its <code>::before</code> and <code>::after</code> pseudo-elements, if any. <li> The anonymous <dfn data-dfn-type="dfn" data-noexport id="region-flow-content-box">region flow content box<a class="self-link" href="#region-flow-content-box"></a></dfn> (called <dfn data-dfn-type="dfn" data-noexport id="rfcb">RFCB<a class="self-link" href="#rfcb"></a></dfn> in this document) which contains the fragment of the <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑧⑤">named flow</a> that the region receives. </ul> <figure> <img alt="The ::before, RFCB and ::after boxes contained in the Region Box" src="images/RFCB.svg" width="600"> <figcaption> The Region Flow Content Box (RFCB) </figcaption> </figure> <p>Laying out a <span>region</span> box follows the same processing rules as for any other <a href="https://www.w3.org/TR/CSS2/visuren.html#block-boxes">block container box</a>.</p> <p>The <span>RFCB</span> is a <a href="https://www.w3.org/TR/CSS21/visuren.html#block-boxes">block container box</a> with a computed <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width" id="ref-for-propdef-width①">width</a> of <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-sizing-3/#valdef-width-auto" id="ref-for-valdef-width-auto">auto</a> and whose used <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height" id="ref-for-propdef-height①">height</a> is resolved as detailed below.</p> <p>Since the <span>RFCB</span> is a <a href="https://www.w3.org/TR/CSS21/visuren.html#block-boxes">block container box</a>, the ::before box and ::after box will also be block containers, though the contents of ::before and ::after may be inline within those boxes.</p> <h4 class="heading settled" data-level="7.2.1" id="rfcb-width-resolution"><span class="secno">7.2.1. </span><span class="content"> RFCB <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width" id="ref-for-propdef-width②">width</a> resolution</span><a class="self-link" href="#rfcb-width-resolution"></a></h4> <p>At various points in the visual formatting of documents containing regions, the used <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width" id="ref-for-propdef-width③">width</a> of RFCBs and regions need to be resolved. In all cases, the resolution is done following the rules for <a href="https://www.w3.org/TR/CSS2/visudet.html#Computing_widths_and_margins">calculating widths and margins</a> (see <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>). Sometimes, resolving the used <span class="property">width</span> value requires measuring the content’s <code>min-content</code> and <code>max-content</code> values (as <a href="https://www.w3.org/TR/css3-writing-modes/#orthogonal-auto">defined</a> in the CSS Writing Modes Module <a data-link-type="biblio" href="#biblio-css3-writing-modes">[CSS3-WRITING-MODES]</a>). or an RFCB, <strong>these measures are made on the <em>entire</em> associated <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑧⑥">named flow</a> content</strong>.</p> <p>As a consequence, all <span>RFCBs</span> of <span>regions</span> associated with a given <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑧⑦">named flow</a> share the same <code>min-content</code> and <code>max-content</code> measures.</p> <p>This approach is consistent with the <a href="https://www.w3.org/TR/css3-break/#varying-size-boxes">box model for breaking</a> (<a data-link-type="biblio" href="#biblio-css3-break">[CSS3-BREAK]</a>).</p> <h3 class="heading settled" data-level="7.3" id="regions-visual-formatting-steps"><span class="secno">7.3. </span><span class="content"> Regions visual formatting steps</span><a class="self-link" href="#regions-visual-formatting-steps"></a></h3> <p>Formatting documents that contain <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑧⑧">named flows</a> laid out in regions is a three-step process:</p> <ul> <li> <em>Step 1: RFCB <dfn data-dfn-type="dfn" data-noexport id="flow-fragment-height">flow fragment height<a class="self-link" href="#flow-fragment-height"></a></dfn> resolution</em>. In this step, the heights of fragments fitting in the regions' RFCBs are resolved. <li> <em>Step 2: document and regions layout</em>. In this step, the document content and regions are laid out. However, <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑧⑨">named flow</a> content is not laid out in regions yet. <li> <em>Step 3: <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑨⓪">named flow</a> layout</em>. In this step, the content of <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑨①">named flows</a> is laid out in their respective <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain⑤②">region chains</a>. </ul> <figure> <img alt="visual representation of the three-step process" src="images/regions-layout-three-steps.svg" width="600"> <figcaption> Regions visual formatting steps </figcaption> </figure> <h4 class="heading settled" data-level="7.3.1" id="rfcb-flow-fragment-height-resolution"><span class="secno">7.3.1. </span><span class="content"> Step 1: RFCB flow fragment height resolution</span><a class="self-link" href="#rfcb-flow-fragment-height-resolution"></a></h4> <p>Conceptually, resolving the flow fragment height is a two phase process.</p> <h5 class="heading settled" data-level="7.3.1.1" id="rfcb-flow-fragment-height-resolution-phase-1"><span class="secno">7.3.1.1. </span><span class="content"> RFCB flow fragment height resolution, Phase 1</span><a class="self-link" href="#rfcb-flow-fragment-height-resolution-phase-1"></a></h5> <p>The document is laid out with a <a href="https://www.w3.org/TR/CSS2/cascade.html#used-value">used</a> height of zero for all <span>RFCB</span>s. In this phase, the content of <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑨②">named flows</a> is not laid out in <span>regions</span>. This phase yields resolved position and sizes for all regions and their RFCBs in the document.</p> <h5 class="heading settled" data-level="7.3.1.2" id="rfcb-flow-fragment-height-resolution-phase-2"><span class="secno">7.3.1.2. </span><span class="content"> RFCB flow fragment height resolution, Phase 2</span><a class="self-link" href="#rfcb-flow-fragment-height-resolution-phase-2"></a></h5> <p><a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑨③">named flows</a> are laid out in <span>regions</span>. The user agent resolves the <em><span>flow fragment height</span></em> for the <span>RFCB</span>s using the remainder of the flow and accounting for <a href="https://www.w3.org/TR/css3-break/">fragmentation rules</a>. This process accounts for constraints such as the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height" id="ref-for-propdef-height②">height</a> or <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-max-height" id="ref-for-propdef-max-height">max-height</a> values, as described in the CSS 2.1 section on <a href="https://www.w3.org/TR/CSS2/visudet.html#Computing_heights_and_margins">calculating heights and margins</a> (see the <a href="https://www.w3.org/TR/CSS2/visudet.html#normal-block">Block-level non-replaced elements in normal flow...</a> section and the <a href="https://www.w3.org/TR/CSS2/visudet.html#block-root-margin">complicated cases</a> section). During this phase, generated content is laid out according to the <a href="#processing-model">rules</a> described earlier in this document.</p> <p>In a <a data-link-type="dfn" href="#nested-region-context" id="ref-for-nested-region-context">nested region context</a>, this phase will trigger the beginning of Step 1 for any inner <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑨④">named flows</a> whose regions are contained in the outer <span>named flow</span>. All of Step 1 for inner flows must recursively complete before Step 1 for an outer flow completes.</p> <h4 class="heading settled" data-level="7.3.2" id="regions-boxes-layout"><span class="secno">7.3.2. </span><span class="content"> Step 2: region boxes layout</span><a class="self-link" href="#regions-boxes-layout"></a></h4> <p>In this step, the document is laid out according to the normal CSS layout rules.</p> <p>If a measure of the content is required to resolve the used <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width" id="ref-for-propdef-width⑤">width</a> of the region box, the value is resolved as described in the <a href="#rfcb-width-resolution">RFCB width resolution</a> section.</p> <p>If a measure of the content is required to resolve the used height of the RFCB (for example if the region box is absolutely positioned), the <span>flow fragment height</span> resolved in Step 1 is used for the vertical content measure of the RFCB.</p> <p>At the end of this step, regions are laid out and ready to receive content from their associated <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑨⑥">named flows</a>.</p> <h4 class="heading settled" data-level="7.3.3" id="named-flows-layout"><span class="secno">7.3.3. </span><span class="content"> Step 3: named flows layout</span><a class="self-link" href="#named-flows-layout"></a></h4> <p>In this final step, the content of <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑨⑦">named flows</a> is laid out in the <span>regions</span>' RFCBs along with the generated content boxes.</p> <p>The used <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width" id="ref-for-propdef-width⑥">width</a> for RFCBs is resolved <a href="#rfcb-width-resolution">as described before</a>.</p> <p>The used <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height" id="ref-for-propdef-height③">height</a> of RFCBs is resolved such that none of the boxes in the region box’s normal flow overflow the region’s box. In other words, the RFCB boxes are stretched vertically to accommodate as much of the flow as possible without overflowing the region box and accounting for <a href="https://www.w3.org/TR/css3-break/">fragmentation rules</a> and generated content boxes.</p> <p>During this phase, generated content is laid out according to the <a href="#processing-model">rules</a> described earlier in this document.</p> <p>In a <a data-link-type="dfn" href="#nested-region-context" id="ref-for-nested-region-context①">nested region context</a>, this step will trigger Step 2 for inner <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow⑨⑧">named flows</a> whose regions are contained in the outer <span>named flow</span>. Fragmentation of the inner regions may result as they are laid out in the outer <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain⑤③">region chain</a>. Once Step 3 for an outer named flow is complete, Step 3 for the inner <span>named flows</span> recursively begins.</p> <p>Once Step 3 for a named flow is complete, The conditions for the <a href="#named-flow-events">named flow events</a> are checked, and if the triggers are met the events dispatch at this point.</p> <div class="note" role="note"> <span class="note-prefix">Note </span> <p>The model for resolving auto sized regions will cause, under certain circumstances, the flow content to be overset or underset. In other words, it will not fit tightly. The model prevents having circular dependencies in the layout model. Implementations may decide to apply further layout steps to ensure that the whole flow content is displayed to the user, even in edge cases.</p> </div> <h3 class="heading settled" data-level="7.4" id="regions-visual-formatting-implementation-note"><span class="secno">7.4. </span><span class="content"> Regions visual formatting: implementation note</span><a class="self-link" href="#regions-visual-formatting-implementation-note"></a></h3> <p>The process for resolving an RFCB’s <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height" id="ref-for-propdef-height④">height</a> and the three-step process used to lay out documents containing regions and <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow①⓪①">named flows</a> are <em>conceptual</em> descriptions of what the layout should yield and implementations should optimize to reduce the number of steps and phases necessary wherever possible.</p> <h3 class="heading settled" data-level="7.5" id="regions-visual-formatting-examples"><span class="secno">7.5. </span><span class="content"> Regions visual formatting example</span><a class="self-link" href="#regions-visual-formatting-examples"></a></h3> <p>This section is non-normative.</p> <p>This example considers a document where content flows between three regions, and region boxes are intermixed with the normal document content.</p> <div class="example" id="example-5a116191"> <a class="self-link" href="#example-5a116191"></a> <pre><style> article { flow-into: article; } #rA, #rB, #rC { flow-from: article; height: auto; margin: 1em 1em 0em 1em; padding: 1em; border: 3px solid #46A4E9; } #rA { width: auto; } #rB { float: left; width: 15em; max-height: 150px; } #rC { float: right; width: 12em; } #main-flow { padding: 0em 1em 0em 1em; } </style> <body> <article> <p style="break-after:region;">I am not a ... </p> <p>...</p> </article> <div id="rA"></div> <div id="rB"></div> <div id="rC"></div> <div id="main-flow"> <p>Lorem ipsum dolor ...</p> </div> </body> </pre> </div> <p>The following sections and figures illustrate the intermediate results for the visual formatting process. In the following, we call RFCB-A, RFCB-B and RFCB-C the <span>RFCBs</span> for regions rA, rB and rC respectively.</p> <h4 class="heading settled" data-level="7.5.1" id="step1-phase1-example"><span class="secno">7.5.1. </span><span class="content"> Step 1 - Phase 1: Laying out RFCBs with used height of zero</span><a class="self-link" href="#step1-phase1-example"></a></h4> <p>Applying the rules for Step 1, Phase 1, the computed <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-sizing-3/#valdef-width-auto" id="ref-for-valdef-width-auto①">auto</a> <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width" id="ref-for-propdef-width⑦">width</a> values for the RFCBs are resolved to used values according to the normal <a href="https://www.w3.org/TR/CSS2/visudet.html#Computing_widths_and_margins">CSS layout rules</a> meaning they stretch to the width of their containing block’s content box.</p> <ol> <li> RFCB-A: stretches to fit the rA content box. <p>Since rA also has an <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-sizing-3/#valdef-width-auto" id="ref-for-valdef-width-auto②">auto</a> <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width" id="ref-for-propdef-width⑧">width</a>, its own used <span class="property">width</span> is stretched to fit the <code><body></code> content box.</p> <li>RFCB-B: stretches to fit the <code>rB</code> content box. <li>RFCB-C: stretches to fit the <code>rC</code> content box. </ol> <p>Also applying the rules for Step 1, Phase 1, the used values for the RFCBs <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height" id="ref-for-propdef-height⑤">height</a> properties are all zero.</p> <p>Conceptually, this produces the layout illustrated below.</p> <figure> <img alt="Step 1 - Phase 1: Layout RFCBs with used heights of 0" src="images/flow-fragment-height-phase-1.png" width="500"> <figcaption> Step 1 - Phase 1: Layout RFCBs with used heights of 0 </figcaption> </figure> <h4 class="heading settled" data-level="7.5.2" id="step1-phase2-example"><span class="secno">7.5.2. </span><span class="content"> Step 1 - Phase 2: Layout flow to compute the RFCBs' flow fragments heights</span><a class="self-link" href="#step1-phase2-example"></a></h4> <p>In this second phase of Step 1, the named flow is laid out in <span>regions</span> and the height of each fragment falling in each RFCB is computed.</p> <p>The user agent lays out as much of the flow into an area with RFCB-A’s used <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width" id="ref-for-propdef-width①⓪">width</a>. rA’s <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height" id="ref-for-propdef-height⑥">height</a> computes to <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-sizing-3/#valdef-width-auto" id="ref-for-valdef-width-auto③">auto</a> and there is no vertical maximum height for RFCA’s <span class="property">height</span>. However, because there is a break after the first paragraph in the "article" <code>named flow</code>, only this first paragraph is laid out in RFCB-A and FH-A (the flow fragment height for RFCB-A) is resolved by laying out this first paragraph in the used <span class="property">width</span>.</p> <p>At this point, the user agent lays out as much of the remaining flow as possible in RFCB-B. Because rB’s <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-max-height" id="ref-for-propdef-max-height①">max-height</a> computed value is "150px", the user agent only lays out the "article" named flow using RFCB-B’s used <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width" id="ref-for-propdef-width①②">width</a> until the point where laying out additional content would cause RFCB-B to overflow rB’s box. The fragment height for RFCB-B is resolved: FH-B (<code>150px</code>).</p> <p>Finally, the user agent lays out the remainder of the flow in RFCB-C. Because rC has no other constraints and no region breaks, the remaining content is laid out in RFCB-C’s used <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width" id="ref-for-propdef-width①③">width</a>. This results in a resolved flow fragment height: FH-C.</p> <figure> <img alt="Step 1 - Phase 2: Measure flow fragments heights" src="images/flow-fragment-height-phase-2.png" width="370"> <figcaption> Step 1 - Phase 2: Measure flow fragments heights </figcaption> </figure> <h4 class="heading settled" data-level="7.5.3" id="step2-example"><span class="secno">7.5.3. </span><span class="content"> Step 2: Layout document and regions without named flows</span><a class="self-link" href="#step2-example"></a></h4> <p>The used <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width" id="ref-for-propdef-width①④">width</a> of RFCB-A, RFCB-B and RFCB-C are resolved as in the previous step. However, the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height" id="ref-for-propdef-height⑧">height</a> is resolved differently.</p> <p>Resolving the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height" id="ref-for-propdef-height⑨">height</a> of rA <a href="https://www.w3.org/TR/CSS2/visudet.html#normal-block">requires a content measure</a> which is FH-A (the flow fragment height for RFCB-A).</p> <p>The <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height" id="ref-for-propdef-height①⓪">height</a> of rB results from first computing its <a href="https://www.w3.org/TR/CSS2/visudet.html#block-root-margin">content measure</a> and then applying the <a href="https://www.w3.org/TR/CSS2/visudet.html#min-max-heights">rules for max-height</a>. Here, the vertical content measure evaluates to FH-B. After applying the rules for <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-max-height" id="ref-for-propdef-max-height②">max-height</a> and accounting for margins, padding and borders, the used <span class="property">height</span> of rB is resolved to LH-B (<code>150px</code>).</p> <p>The <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height" id="ref-for-propdef-height①②">height</a> of rC’s box results from <a href="https://www.w3.org/TR/CSS2/visudet.html#block-root-margin">calculating its content measure</a>: FH-C becomes rC’s used <span class="property">height</span>.</p> <figure> <img alt="Step 2: Layout document and regions without named flows" src="images/regions-visual-formatting-step-2.png" width="370"> <figcaption> Step 2: Layout document and regions without <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow①⓪②">named flows</a> </figcaption> </figure> <h4 class="heading settled" data-level="7.5.4" id="step3-example"><span class="secno">7.5.4. </span><span class="content"> Step 3: named flows layout</span><a class="self-link" href="#step3-example"></a></h4> <p>In this final step, the <code>article</code> <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow①⓪③">named flow</a> is laid out in its <a data-link-type="dfn" href="#region-chain" id="ref-for-region-chain⑤④">region chain</a>. The used <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width" id="ref-for-propdef-width①⑤">width</a> for each of the RFCB is resolved as in step 1 above.</p> <p>The used <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height" id="ref-for-propdef-height①④">height</a> for the RFCB is a result of laying out the as much of the content in the <span>region</span> without overflowing its content box and following the <a href="https://www.w3.org/TR/css3-break/">fragmentation rules</a>.</p> <p>Because the computed <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width" id="ref-for-propdef-width①⑥">width</a> of the RFCB has not changed and the fragmentation rules applied are the same as in Phase 1, Step 2, the used <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height" id="ref-for-propdef-height①⑤">height</a> for RFCB-A, RFCB-B and RFCB-C are LH-A, LH-B and LH-C, respectively.</p> <p>There may be situations where the used <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height" id="ref-for-propdef-height①⑥">height</a> of RFCBs resolved in Step 3 are different from the <span>flow fragment height</span> computed in Step 1 Phase 2.</p> <figure> <img alt="Step 3: Final result after laying out named flows in regions" src="images/regions-visual-formatting-step-3.png" width="370"> <figcaption> Step 3: Final result after laying out <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow①⓪④">named flows</a> in regions </figcaption> </figure> <h2 class="heading settled" data-level="8" id="relation-to-document-events"><span class="secno">8. </span><span class="content"> Relation to document events</span><a class="self-link" href="#relation-to-document-events"></a></h2> <p>The CSS Regions module does not alter the normal processing of events in the document tree. In particular, if an event occurs on an element that is part of a <a data-link-type="dfn" href="#named-flow" id="ref-for-named-flow①⓪⑤">named flow</a>, the <a href="https://www.w3.org/TR/dom/#events">event’s bubble and capture phases</a> happen following the document tree order.</p> <div class="note" role="note"> <span class="note-prefix">Note </span> <p>This means that in most cases <a data-link-type="dfn" href="#css-region" id="ref-for-css-region④③">CSS Regions</a> will not receive user events that trigger on their named flow content. Event handlers for named flow content can check <code><a href="https://drafts.csswg.org/cssom-view/#extensions-to-the-document-interface">getElementsFromPoint()</a></code> <a data-link-type="biblio" href="#biblio-cssom-view">[CSSOM-VIEW]</a> to find the <span>CSS Region</span> where the user event occurred. Future versions of CSS-UI may provide a more general solution for user event bubbling where the stack of elements at the event coordinates</p> </div> <h2 class="heading settled" data-level="9" id="relation-to-other-specifications"><span class="secno">9. </span><span class="content"> Relation to other specifications</span><a class="self-link" href="#relation-to-other-specifications"></a></h2> <p>This specification is related to other specifications as described in the references section. In addition, it is related to the following specifications:</p> <ol> <li> CSS Fragmentation Module Level 3 <a data-link-type="biblio" href="#biblio-css3-break">[CSS3-BREAK]</a>. This module defines the rules for fragmenting content over multiple containers and applies to <a data-link-type="dfn" href="#css-region" id="ref-for-css-region④⑤">CSS Regions</a> in addition to applying to multi-column and paged media. <li> CSS Pagination Templates Module Level 3 <a data-link-type="biblio" href="#biblio-css3-page-template">[CSS3-PAGE-TEMPLATE]</a>. This module defines a syntax to define layout templates which can be used when paginating content. The page templates use regions. <li> CSS Exclusions Module <a data-link-type="biblio" href="#biblio-css3-exclusions">[CSS3-EXCLUSIONS]</a>. This module defines a generic way to define exclusions around which content can flow. This can be seen as an extension to CSS floats. In advanced layout designs, it is expected that the CSS Exclusions module will be commonly combined with the CSS Regions module. <li> CSS Line Grid Module <a data-link-type="biblio" href="#biblio-css3-line-grid">[CSS3-LINE-GRID]</a>. This module defines a concept of line grid to align the position of lines in different elements. The line grid functionality is related and needed for aligning content flowing in separate regions. </ol> <h2 class="heading settled" data-level="10" id="usecases"><span class="secno">10. </span><span class="content"> Use Cases</span><a class="self-link" href="#usecases"></a></h2> <p>Use cases are described on <a href="http://wiki.csswg.org/spec/css3-regions/regions-use-cases">these</a> <a href="http://wiki.csswg.org/spec/css3-regions/regions-print-use-cases">pages</a>.</p> <h2 class="heading settled" data-level="11" id="changes"><span class="secno">11. </span><span class="content"> Changes</span><a class="self-link" href="#changes"></a></h2> <h3 class="heading settled" data-level="11.1" id="changes_from_Feb_18_2014"><span class="secno">11.1. </span><span class="content"> Changes from <a href="https://www.w3.org/TR/2014/WD-css3-regions-20140218/">February 18<sup>th</sup> 2014</a> version</span><a class="self-link" href="#changes_from_Feb_18_2014"></a></h3> <ul> <li>Added three simpler examples to the introduction <li>Moved complex example to the <a href="http://wiki.csswg.org/spec/css3-regions/complex-layout-example">CSSWG wiki</a> <li>Moved the effects of CSS containment to this specification from <a data-link-type="biblio" href="#biblio-css-contain-1">[CSS-CONTAIN-1]</a>. </ul> <h3 class="heading settled" data-level="11.2" id="changes_from_May_28_2013"><span class="secno">11.2. </span><span class="content"> Changes from <a href="https://www.w3.org/TR/2013/WD-css3-regions-20130528/">May 28<sup>th</sup> 2013</a> version</span><a class="self-link" href="#changes_from_May_28_2013"></a></h3> <ul> <li>Removed region styling from this level <li>Changed ::region() to ::region <li>display:none elements do not become CSS Regions <li>Clarify accessibility interactions with flow-into <li>Change NamedFlowCollection to NamedFlowMap <li>Remove mention of run-in and clarify ::before and ::after block containers <li>Removed custom element syntax from examples <li>Changed NamedFlowCollection getters back to null when there is no NamedFlow. <li>Removed issue on user events and added note describing solution(s) <li>Changed type of NamedFlow.getContent() from NodeList to sequence<Node> </ul> <h3 class="heading settled" data-level="11.3" id="changes_from_Aug_28_2012"><span class="secno">11.3. </span><span class="content"> Changes from <a href="https://www.w3.org/TR/2012/WD-css3-regions-20120823/">August 28<sup>th</sup> 2012</a> version</span><a class="self-link" href="#changes_from_Aug_28_2012"></a></h3> <ul> <li>Changed @region rule to ::region() functional pseudo-element <li>Removed CSSRegionStyleRule (see above) <li>Tied named flow event triggers to visual processing model <li>Described how visual formatting of nested regions works <li>Added content and element keywords to flow-into <li>Added regionoversetchange event <li>renamed regionlayoutupdate to regionfragmentchange <li>Defined offsetParent interaction <li>Removed implication of DOM manipulation <li>Changed Appendix A to use custom element layout. <li>Noted change in pseudo-element generation with flow-from. <li>Changed case of regionlayoutupdate to match other events in <a data-link-type="biblio" href="#biblio-dom-level-3-events">[DOM-LEVEL-3-EVENTS]</a>. <li>Added section on fragmenting the fragmenters. <li>Added section on handling circular flow-from and flow-into situations. <li>Added alignment and justification to region styling properties. <li>Added timing for regionLayoutUpdate event. <li>Clarified interaction between content and flow-from for pseudo-elements. <li>Changed NamedFlowCollection getters to return undefined when there is no NamedFlow. <li>Changed region-overflow property to region-fragment. </ul> <h3 class="heading settled" data-level="11.4" id="changes_from_May_03_2012"><span class="secno">11.4. </span><span class="content"> Changes from <a href="https://www.w3.org/TR/2012/WD-css3-regions-20120503/">May 3<sup>rd</sup> 2012</a> version</span><a class="self-link" href="#changes_from_May_03_2012"></a></h3> <ul> <li>Removed exceptions from the Region interface. <li>Changed NamedFlowCollection from live to a static snapshot. <li>Changed NamedFlow to inherit from EventTarget. <li>Removed flowFrom from Region interface and changed method name to getComputedRegionStyle(). <li>Region interface is now a supplemental interface with the [NoInterfaceObject] extended attribute. <li>Added note for regionLayoutUpdate dispatching in nested flows. <li>Removed Document.getFlowByName() in favor of NamedFlowCollection.namedItem(). <li>Changed to overset:false for NULL NamedFlow. <li>Changed regionLayoutUpdate to not bubble. </ul> <h3 class="heading settled" data-level="11.5" id="older_changes"><span class="secno">11.5. </span><span class="content">Older Changes</span><a class="self-link" href="#older_changes"></a></h3> <p>Older changelogs are <a href="http://wiki.csswg.org/spec/css3-regions/older-changelogs">archived</a> on the CSSWG wiki.</p> <h2 class="no-num heading settled" id="acknowledgments"><span class="content"> Acknowledgments</span><a class="self-link" href="#acknowledgments"></a></h2> <p>The editors are grateful to the CSS working group for their feedback and help with the genesis of this specification.</p> <p>In addition, the editors would like to thank the following individuals for their contributions, either during the conception of CSS Regions or during its development and specification review process:</p> <p>Erik Arvidsson, Tab Atkins, Catalin Badea, Mihai Balan, Andrei Bucur, Razvan Caliman, Alexandru Chiculita, Phil Cupp, Arron Eicholz, John Jansen, CJ Gammon, Dimitri Glazkov, Daniel Glazman, Arno Gourdol, Catalin Grigoroscuta, David Hyatt, Brian Heuston, Ian Hickson, Jonathan Hoersch, Michael Jolson, Brad Kemper, Håkon Wium Lie, Kang-Hao (Kenny) Lu, Mihai Maerean, Markus Mielke, Robert O’Callahan, Theresa O’Connor, Mihnea Ovidenie, Virgil Palanciuc, Olga Popiv, Christoph Päper, Anton Prowse, Florian Rivoal, Peter Sorotokin, Elliott Sprehn, Radu Stavila, Christian Stockwell, Eugene Veselov, Boris Zbarsky, Stephen Zilles and the CSS Working Group members.</p> </main> <h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2> <h3 class="heading settled" id="document-conventions"><span class="content"> Document conventions</span><a class="self-link" href="#document-conventions"></a></h3> <p>Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification. </p> <p>All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p> <p>Examples in this specification are introduced with the words “for example” or are set apart from the normative text with <code>class="example"</code>, like this: </p> <div class="example" id="example-ae2b6bc0"> <a class="self-link" href="#example-ae2b6bc0"></a> <p>This is an example of an informative example. </p> </div> <p>Informative notes begin with the word “Note” and are set apart from the normative text with <code>class="note"</code>, like this: </p> <p class="note" role="note">Note, this is an informative note. </p> <p>Advisements are normative sections styled to evoke special attention and are set apart from other normative text with <code><strong class="advisement"></code>, like this: <strong class="advisement"> UAs MUST provide an accessible alternative. </strong> </p> <h3 class="heading settled" id="conform-classes"><span class="content"> Conformance classes</span><a class="self-link" href="#conform-classes"></a></h3> <p>Conformance to this specification is defined for three conformance classes: </p> <dl> <dt>style sheet <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#style-sheet">CSS style sheet</a>. <dt>renderer <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that interprets the semantics of a style sheet and renders documents that use them. <dt>authoring tool <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that writes a style sheet. </dl> <p>A style sheet is conformant to this specification if all of its statements that use syntax defined in this module are valid according to the generic CSS grammar and the individual grammars of each feature defined in this module. </p> <p>A renderer is conformant to this specification if, in addition to interpreting the style sheet as defined by the appropriate specifications, it supports all the features defined by this specification by parsing them correctly and rendering the document accordingly. However, the inability of a UA to correctly render a document due to limitations of the device does not make the UA non-conformant. (For example, a UA is not required to render color on a monochrome monitor.) </p> <p>An authoring tool is conformant to this specification if it writes style sheets that are syntactically correct according to the generic CSS grammar and the individual grammars of each feature in this module, and meet all other conformance requirements of style sheets as described in this module. </p> <h3 class="heading settled" id="conform-responsible"><span class="content"> Requirements for Responsible Implementation of CSS</span><a class="self-link" href="#conform-responsible"></a></h3> <p>The following sections define several conformance requirements for implementing CSS responsibly, in a way that promotes interoperability in the present and future. </p> <h4 class="heading settled" id="conform-partial"><span class="content"> Partial Implementations</span><a class="self-link" href="#conform-partial"></a></h4> <p>So that authors can exploit the forward-compatible parsing rules to assign fallback values, <strong>CSS renderers <em>must</em> treat as invalid (and <a href="http://www.w3.org/TR/CSS2/conform.html#ignore">ignore as appropriate</a>) any at-rules, properties, property values, keywords, and other syntactic constructs for which they have no usable level of support</strong>. In particular, user agents <em>must not</em> selectively ignore unsupported property values and honor supported values in a single multi-value property declaration: if any value is considered invalid (as unsupported values must be), CSS requires that the entire declaration be ignored. </p> <h4 class="heading settled" id="conform-future-proofing"><span class="content"> Implementations of Unstable and Proprietary Features</span><a class="self-link" href="#conform-future-proofing"></a></h4> <p>To avoid clashes with future stable CSS features, the CSSWG recommends <a href="http://www.w3.org/TR/CSS/#future-proofing">following best practices</a> for the implementation of <a href="http://www.w3.org/TR/CSS/#unstable">unstable</a> features and <a href="http://www.w3.org/TR/CSS/#proprietary-extension">proprietary extensions</a> to CSS. </p> <h4 class="heading settled" id="conform-testing"><span class="content"> Implementations of CR-level Features</span><a class="self-link" href="#conform-testing"></a></h4> <p>Once a specification reaches the Candidate Recommendation stage, implementers should release an <a data-link-type="dfn" href="http://www.w3.org/TR/CSS/#vendor-prefix">unprefixed</a> implementation of any CR-level feature they can demonstrate to be correctly implemented according to spec, and should avoid exposing a prefixed variant of that feature. </p> <p>To establish and maintain the interoperability of CSS across implementations, the CSS Working Group requests that non-experimental CSS renderers submit an implementation report (and, if necessary, the testcases used for that implementation report) to the W3C before releasing an unprefixed implementation of any CSS features. Testcases submitted to W3C are subject to review and correction by the CSS Working Group. </p> <p> Further information on submitting testcases and implementation reports can be found from on the CSS Working Group’s website at <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>. Questions should be directed to the <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a> mailing list. <script src="https://www.w3.org/scripts/TR/2016/fixup.js"></script> </p> <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2> <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3> <ul class="index"> <li><a href="#propdef-break-after">break-after</a><span>, in §3.3</span> <li><a href="#propdef-break-before">break-before</a><span>, in §3.3</span> <li><a href="#propdef-break-inside">break-inside</a><span>, in §3.3</span> <li><a href="#content">content</a><span>, in §3.1</span> <li><a href="#css-region">CSS Region</a><span>, in §2.1</span> <li><a href="#dom-namedflowmap-delete①">delete()</a><span>, in §4.1</span> <li><a href="#dom-namedflowmap-delete">delete(flowName)</a><span>, in §4.1</span> <li><a href="#element">element</a><span>, in §3.1</span> <li><a href="#dom-namedflow-firstemptyregionindex">firstEmptyRegionIndex</a><span>, in §4.1</span> <li><a href="#flow-fragment-height">flow fragment height</a><span>, in §7.3</span> <li><a href="#propdef-flow-from">flow-from</a><span>, in §3.2</span> <li><a href="#propdef-flow-into">flow-into</a><span>, in §3.1</span> <li><a href="#dom-namedflowmap-get①">get()</a><span>, in §4.1</span> <li><a href="#dom-namedflow-getcontent">getContent()</a><span>, in §4.1</span> <li><a href="#dom-namedflowmap-get">get(flowName)</a><span>, in §4.1</span> <li><a href="#dom-region-getregionflowranges">getRegionFlowRanges()</a><span>, in §4.2</span> <li><a href="#dom-namedflow-getregions">getRegions()</a><span>, in §4.1</span> <li><a href="#dom-namedflow-getregionsbycontent①">getRegionsByContent()</a><span>, in §4.1</span> <li><a href="#dom-namedflow-getregionsbycontent">getRegionsByContent(node)</a><span>, in §4.1</span> <li><a href="#dom-namedflowmap-has①">has()</a><span>, in §4.1</span> <li><a href="#dom-namedflowmap-has">has(flowName)</a><span>, in §4.1</span> <li><a href="#last-usable-region">last usable CSS region</a><span>, in §2.3</span> <li><a href="#last-usable-region">last usable region</a><span>, in §2.3</span> <li><a href="#dom-namedflow-name">name</a><span>, in §4.1</span> <li><a href="#named-flow">named flow</a><span>, in §2.4</span> <li><a href="#namedflow">NamedFlow</a><span>, in §4.1</span> <li><a href="#namedflowmap">NamedFlowMap</a><span>, in §4.1</span> <li> namedFlows <ul> <li><a href="#dom-document-namedflows">attribute for Document</a><span>, in §4.1</span> <li><a href="#document-namedflows">definition of</a><span>, in §4.1</span> </ul> <li><a href="#nested-region-context">nested region context</a><span>, in §3.2.2</span> <li><a href="#dom-namedflow-overset">overset</a><span>, in §4.1</span> <li><a href="#region">Region</a><span>, in §4.2</span> <li><a href="#region-chain">region chain</a><span>, in §2.2</span> <li><a href="#region-flow-content-box">region flow content box</a><span>, in §7.2</span> <li><a href="#propdef-region-fragment">region-fragment</a><span>, in §3.4</span> <li><a href="#dom-region-regionoverset">regionOverset</a><span>, in §4.2</span> <li><a href="#rfcb">RFCB</a><span>, in §7.2</span> <li><a href="#dom-namedflowmap-set①">set()</a><span>, in §4.1</span> <li><a href="#dom-namedflowmap-set">set(flowName, flowValue)</a><span>, in §4.1</span> <li><a href="#specified-flow">specified flow</a><span>, in §3.1</span> </ul> <aside class="dfn-panel" data-for="term-for-content-box"> <a href="https://drafts.csswg.org/css-box-3/#content-box">https://drafts.csswg.org/css-box-3/#content-box</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-content-box">4.2. The Region interface</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-layout-containment"> <a href="https://drafts.csswg.org/css-contain-1/#layout-containment">https://drafts.csswg.org/css-contain-1/#layout-containment</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-layout-containment">2.3. Last region</a> <a href="#ref-for-layout-containment①">(2)</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-property-scoped"> <a href="https://drafts.csswg.org/css-contain-1/#property-scoped">https://drafts.csswg.org/css-contain-1/#property-scoped</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-property-scoped">3.1. The flow-into property</a> <li><a href="#ref-for-property-scoped①">3.2. The flow-from property</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-style-containment"> <a href="https://drafts.csswg.org/css-contain-1/#style-containment">https://drafts.csswg.org/css-contain-1/#style-containment</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-style-containment">3.1. The flow-into property</a> <li><a href="#ref-for-style-containment①">3.2. The flow-from property</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-propdef-content"> <a href="https://drafts.csswg.org/css-content-3/#propdef-content">https://drafts.csswg.org/css-content-3/#propdef-content</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-propdef-content">3.2. The flow-from property</a> <a href="#ref-for-propdef-content①">(2)</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-valdef-content-none"> <a href="https://drafts.csswg.org/css-content-3/#valdef-content-none">https://drafts.csswg.org/css-content-3/#valdef-content-none</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-valdef-content-none">3.2. The flow-from property</a> <a href="#ref-for-valdef-content-none①">(2)</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-valdef-content-normal"> <a href="https://drafts.csswg.org/css-content-3/#valdef-content-normal">https://drafts.csswg.org/css-content-3/#valdef-content-normal</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-valdef-content-normal">3.2. The flow-from property</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-propdef-display"> <a href="https://drafts.csswg.org/css-display-3/#propdef-display">https://drafts.csswg.org/css-display-3/#propdef-display</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-propdef-display">3.2. The flow-from property</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-valdef-display-none"> <a href="https://drafts.csswg.org/css-display-3/#valdef-display-none">https://drafts.csswg.org/css-display-3/#valdef-display-none</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-valdef-display-none">3.2. The flow-from property</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-propdef-overflow"> <a href="https://drafts.csswg.org/css-overflow-3/#propdef-overflow">https://drafts.csswg.org/css-overflow-3/#propdef-overflow</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-propdef-overflow">3.4. The region-fragment property</a> <a href="#ref-for-propdef-overflow①">(2)</a> <a href="#ref-for-propdef-overflow②">(3)</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-valdef-width-auto"> <a href="https://drafts.csswg.org/css-sizing-3/#valdef-width-auto">https://drafts.csswg.org/css-sizing-3/#valdef-width-auto</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-valdef-width-auto">7.2. The Region Flow Content Box (RFCB)</a> <li><a href="#ref-for-valdef-width-auto①">7.5.1. Step 1 - Phase 1: Laying out RFCBs with used height of zero</a> <a href="#ref-for-valdef-width-auto②">(2)</a> <li><a href="#ref-for-valdef-width-auto③">7.5.2. Step 1 - Phase 2: Layout flow to compute the RFCBs' flow fragments heights</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-typedef-ident"> <a href="https://drafts.csswg.org/css-values-4/#typedef-ident">https://drafts.csswg.org/css-values-4/#typedef-ident</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-typedef-ident">3.1. The flow-into property</a> <li><a href="#ref-for-typedef-ident①">3.2. The flow-from property</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-mult-opt"> <a href="https://drafts.csswg.org/css-values-4/#mult-opt">https://drafts.csswg.org/css-values-4/#mult-opt</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-mult-opt">3.1. The flow-into property</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-comb-one"> <a href="https://drafts.csswg.org/css-values-4/#comb-one">https://drafts.csswg.org/css-values-4/#comb-one</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-comb-one">3.1. The flow-into property</a> <a href="#ref-for-comb-one①">(2)</a> <li><a href="#ref-for-comb-one②">3.2. The flow-from property</a> <a href="#ref-for-comb-one③">(2)</a> <li><a href="#ref-for-comb-one④">3.3. Region flow break properties: break-before, break-after, break-inside</a> <a href="#ref-for-comb-one⑤">(2)</a> <a href="#ref-for-comb-one⑥">(3)</a> <a href="#ref-for-comb-one⑦">(4)</a> <a href="#ref-for-comb-one⑧">(5)</a> <a href="#ref-for-comb-one⑨">(6)</a> <a href="#ref-for-comb-one①⓪">(7)</a> <a href="#ref-for-comb-one①①">(8)</a> <a href="#ref-for-comb-one①②">(9)</a> <a href="#ref-for-comb-one①③">(10)</a> <a href="#ref-for-comb-one①④">(11)</a> <a href="#ref-for-comb-one①⑤">(12)</a> <a href="#ref-for-comb-one①⑥">(13)</a> <a href="#ref-for-comb-one①⑦">(14)</a> <a href="#ref-for-comb-one①⑧">(15)</a> <a href="#ref-for-comb-one①⑨">(16)</a> <a href="#ref-for-comb-one②⓪">(17)</a> <a href="#ref-for-comb-one②①">(18)</a> <a href="#ref-for-comb-one②②">(19)</a> <a href="#ref-for-comb-one②③">(20)</a> <a href="#ref-for-comb-one②④">(21)</a> <a href="#ref-for-comb-one②⑤">(22)</a> <a href="#ref-for-comb-one②⑥">(23)</a> <a href="#ref-for-comb-one②⑦">(24)</a> <li><a href="#ref-for-comb-one②⑧">3.4. The region-fragment property</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-propdef-height"> <a href="https://drafts.csswg.org/css2/visudet.html#propdef-height">https://drafts.csswg.org/css2/visudet.html#propdef-height</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-propdef-height">3.2. The flow-from property</a> <li><a href="#ref-for-propdef-height①">7.2. The Region Flow Content Box (RFCB)</a> <li><a href="#ref-for-propdef-height②">7.3.1.2. RFCB flow fragment height resolution, Phase 2</a> <li><a href="#ref-for-propdef-height③">7.3.3. Step 3: named flows layout</a> <li><a href="#ref-for-propdef-height④">7.4. Regions visual formatting: implementation note</a> <li><a href="#ref-for-propdef-height⑤">7.5.1. Step 1 - Phase 1: Laying out RFCBs with used height of zero</a> <li><a href="#ref-for-propdef-height⑥">7.5.2. Step 1 - Phase 2: Layout flow to compute the RFCBs' flow fragments heights</a> <a href="#ref-for-propdef-height⑦">(2)</a> <li><a href="#ref-for-propdef-height⑧">7.5.3. Step 2: Layout document and regions without named flows</a> <a href="#ref-for-propdef-height⑨">(2)</a> <a href="#ref-for-propdef-height①⓪">(3)</a> <a href="#ref-for-propdef-height①①">(4)</a> <a href="#ref-for-propdef-height①②">(5)</a> <a href="#ref-for-propdef-height①③">(6)</a> <li><a href="#ref-for-propdef-height①④">7.5.4. Step 3: named flows layout</a> <a href="#ref-for-propdef-height①⑤">(2)</a> <a href="#ref-for-propdef-height①⑥">(3)</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-propdef-max-height"> <a href="https://drafts.csswg.org/css2/visudet.html#propdef-max-height">https://drafts.csswg.org/css2/visudet.html#propdef-max-height</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-propdef-max-height">7.3.1.2. RFCB flow fragment height resolution, Phase 2</a> <li><a href="#ref-for-propdef-max-height①">7.5.2. Step 1 - Phase 2: Layout flow to compute the RFCBs' flow fragments heights</a> <li><a href="#ref-for-propdef-max-height②">7.5.3. Step 2: Layout document and regions without named flows</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-propdef-width"> <a href="https://drafts.csswg.org/css2/visudet.html#propdef-width">https://drafts.csswg.org/css2/visudet.html#propdef-width</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-propdef-width">3.2. The flow-from property</a> <li><a href="#ref-for-propdef-width①">7.2. The Region Flow Content Box (RFCB)</a> <li><a href="#ref-for-propdef-width②">7.2.1. RFCB width resolution</a> <a href="#ref-for-propdef-width③">(2)</a> <a href="#ref-for-propdef-width④">(3)</a> <li><a href="#ref-for-propdef-width⑤">7.3.2. Step 2: region boxes layout</a> <li><a href="#ref-for-propdef-width⑥">7.3.3. Step 3: named flows layout</a> <li><a href="#ref-for-propdef-width⑦">7.5.1. Step 1 - Phase 1: Laying out RFCBs with used height of zero</a> <a href="#ref-for-propdef-width⑧">(2)</a> <a href="#ref-for-propdef-width⑨">(3)</a> <li><a href="#ref-for-propdef-width①⓪">7.5.2. Step 1 - Phase 2: Layout flow to compute the RFCBs' flow fragments heights</a> <a href="#ref-for-propdef-width①①">(2)</a> <a href="#ref-for-propdef-width①②">(3)</a> <a href="#ref-for-propdef-width①③">(4)</a> <li><a href="#ref-for-propdef-width①④">7.5.3. Step 2: Layout document and regions without named flows</a> <li><a href="#ref-for-propdef-width①⑤">7.5.4. Step 3: named flows layout</a> <a href="#ref-for-propdef-width①⑥">(2)</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-propdef-column-fill"> <a href="https://drafts.csswg.org/css-multicol-1/#propdef-column-fill">https://drafts.csswg.org/css-multicol-1/#propdef-column-fill</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-propdef-column-fill">5. Multi-column regions</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-cssomstring"> <a href="https://drafts.csswg.org/cssom-1/#cssomstring">https://drafts.csswg.org/cssom-1/#cssomstring</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-cssomstring">4.1. The NamedFlow interface</a> <a href="#ref-for-cssomstring①">(2)</a> <a href="#ref-for-cssomstring②">(3)</a> <a href="#ref-for-cssomstring③">(4)</a> <a href="#ref-for-cssomstring④">(5)</a> <a href="#ref-for-cssomstring⑤">(6)</a> <li><a href="#ref-for-cssomstring⑥">4.2. The Region interface</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-document"> <a href="https://dom.spec.whatwg.org/#document">https://dom.spec.whatwg.org/#document</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-document">4.1. The NamedFlow interface</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-element"> <a href="https://dom.spec.whatwg.org/#element">https://dom.spec.whatwg.org/#element</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-element">4.2. The Region interface</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-eventtarget"> <a href="https://dom.spec.whatwg.org/#eventtarget">https://dom.spec.whatwg.org/#eventtarget</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-eventtarget">4.1. The NamedFlow interface</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-node"> <a href="https://dom.spec.whatwg.org/#node">https://dom.spec.whatwg.org/#node</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-node">4.1. The NamedFlow interface</a> <a href="#ref-for-node①">(2)</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-range"> <a href="https://dom.spec.whatwg.org/#range">https://dom.spec.whatwg.org/#range</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-range">4.2. The Region interface</a> <a href="#ref-for-range①">(2)</a> <a href="#ref-for-range②">(3)</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-Exposed"> <a href="https://heycam.github.io/webidl/#Exposed">https://heycam.github.io/webidl/#Exposed</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-Exposed">4.1. The NamedFlow interface</a> <a href="#ref-for-Exposed①">(2)</a> <li><a href="#ref-for-Exposed②">4.2. The Region interface</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-NoInterfaceObject"> <a href="https://heycam.github.io/webidl/#NoInterfaceObject">https://heycam.github.io/webidl/#NoInterfaceObject</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-NoInterfaceObject">4.2. The Region interface</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-idl-boolean"> <a href="https://heycam.github.io/webidl/#idl-boolean">https://heycam.github.io/webidl/#idl-boolean</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-idl-boolean">4.1. The NamedFlow interface</a> <a href="#ref-for-idl-boolean①">(2)</a> <a href="#ref-for-idl-boolean②">(3)</a> </ul> </aside> <aside class="dfn-panel" data-for="term-for-idl-short"> <a href="https://heycam.github.io/webidl/#idl-short">https://heycam.github.io/webidl/#idl-short</a><b>Referenced in:</b> <ul> <li><a href="#ref-for-idl-short">4.1. The NamedFlow interface</a> </ul> </aside> <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3> <ul class="index"> <li> <a data-link-type="biblio">[css-box-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="term-for-content-box" style="color:initial">content box</span> </ul> <li> <a data-link-type="biblio">[CSS-CONTAIN-1]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="term-for-layout-containment" style="color:initial">layout containment</span> <li><span class="dfn-paneled" id="term-for-property-scoped" style="color:initial">scoped</span> <li><span class="dfn-paneled" id="term-for-style-containment" style="color:initial">style containment</span> </ul> <li> <a data-link-type="biblio">[css-content-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="term-for-propdef-content" style="color:initial">content</span> <li><span class="dfn-paneled" id="term-for-valdef-content-none" style="color:initial">none</span> <li><span class="dfn-paneled" id="term-for-valdef-content-normal" style="color:initial">normal</span> </ul> <li> <a data-link-type="biblio">[css-display-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="term-for-propdef-display" style="color:initial">display</span> <li><span class="dfn-paneled" id="term-for-valdef-display-none" style="color:initial">none</span> </ul> <li> <a data-link-type="biblio">[css-overflow-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="term-for-propdef-overflow" style="color:initial">overflow</span> </ul> <li> <a data-link-type="biblio">[css-sizing-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="term-for-valdef-width-auto" style="color:initial">auto</span> </ul> <li> <a data-link-type="biblio">[css-values-4]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="term-for-typedef-ident" style="color:initial"><ident></span> <li><span class="dfn-paneled" id="term-for-mult-opt" style="color:initial">?</span> <li><span class="dfn-paneled" id="term-for-comb-one" style="color:initial">|</span> </ul> <li> <a data-link-type="biblio">[CSS21]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="term-for-propdef-height" style="color:initial">height</span> <li><span class="dfn-paneled" id="term-for-propdef-max-height" style="color:initial">max-height</span> <li><span class="dfn-paneled" id="term-for-propdef-width" style="color:initial">width</span> </ul> <li> <a data-link-type="biblio">[CSS3COL]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="term-for-propdef-column-fill" style="color:initial">column-fill</span> </ul> <li> <a data-link-type="biblio">[CSSOM]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="term-for-cssomstring" style="color:initial">CSSOMString</span> </ul> <li> <a data-link-type="biblio">[DOM]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="term-for-document" style="color:initial">Document</span> <li><span class="dfn-paneled" id="term-for-element" style="color:initial">Element</span> <li><span class="dfn-paneled" id="term-for-eventtarget" style="color:initial">EventTarget</span> <li><span class="dfn-paneled" id="term-for-node" style="color:initial">Node</span> <li><span class="dfn-paneled" id="term-for-range" style="color:initial">Range</span> </ul> <li> <a data-link-type="biblio">[WebIDL]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="term-for-Exposed" style="color:initial">Exposed</span> <li><span class="dfn-paneled" id="term-for-NoInterfaceObject" style="color:initial">NoInterfaceObject</span> <li><span class="dfn-paneled" id="term-for-idl-boolean" style="color:initial">boolean</span> <li><span class="dfn-paneled" id="term-for-idl-short" style="color:initial">short</span> </ul> </ul> <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2> <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3> <dl> <dt id="biblio-css-box-3">[CSS-BOX-3] <dd>Elika Etemad. <a href="https://www.w3.org/TR/css-box-3/">CSS Box Model Module Level 3</a>. 9 August 2018. WD. URL: <a href="https://www.w3.org/TR/css-box-3/">https://www.w3.org/TR/css-box-3/</a> <dt id="biblio-css-contain-1">[CSS-CONTAIN-1] <dd>Tab Atkins Jr.; Florian Rivoal. <a href="https://www.w3.org/TR/css-contain-1/">CSS Containment Module Level 1</a>. 24 May 2018. CR. URL: <a href="https://www.w3.org/TR/css-contain-1/">https://www.w3.org/TR/css-contain-1/</a> <dt id="biblio-css-content-3">[CSS-CONTENT-3] <dd>Elika Etemad; Dave Cramer. <a href="https://www.w3.org/TR/css-content-3/">CSS Generated Content Module Level 3</a>. 2 June 2016. WD. URL: <a href="https://www.w3.org/TR/css-content-3/">https://www.w3.org/TR/css-content-3/</a> <dt id="biblio-css-display-3">[CSS-DISPLAY-3] <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-display-3/">CSS Display Module Level 3</a>. 28 August 2018. CR. URL: <a href="https://www.w3.org/TR/css-display-3/">https://www.w3.org/TR/css-display-3/</a> <dt id="biblio-css-sizing-3">[CSS-SIZING-3] <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-sizing-3/">CSS Intrinsic & Extrinsic Sizing Module Level 3</a>. 4 March 2018. WD. URL: <a href="https://www.w3.org/TR/css-sizing-3/">https://www.w3.org/TR/css-sizing-3/</a> <dt id="biblio-css-values-4">[CSS-VALUES-4] <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-values-4/">CSS Values and Units Module Level 4</a>. 14 August 2018. WD. URL: <a href="https://www.w3.org/TR/css-values-4/">https://www.w3.org/TR/css-values-4/</a> <dt id="biblio-css21">[CSS21] <dd>Bert Bos; et al. <a href="https://www.w3.org/TR/CSS2/">Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a>. 7 June 2011. REC. URL: <a href="https://www.w3.org/TR/CSS2/">https://www.w3.org/TR/CSS2/</a> <dt id="biblio-css3-break">[CSS3-BREAK] <dd>Rossen Atanassov; Elika Etemad. <a href="https://www.w3.org/TR/css-break-3/">CSS Fragmentation Module Level 3</a>. 9 February 2017. CR. URL: <a href="https://www.w3.org/TR/css-break-3/">https://www.w3.org/TR/css-break-3/</a> <dt id="biblio-css3-writing-modes">[CSS3-WRITING-MODES] <dd>Elika Etemad; Koji Ishii. <a href="https://www.w3.org/TR/css-writing-modes-3/">CSS Writing Modes Level 3</a>. 24 May 2018. CR. URL: <a href="https://www.w3.org/TR/css-writing-modes-3/">https://www.w3.org/TR/css-writing-modes-3/</a> <dt id="biblio-css3col">[CSS3COL] <dd>Florian Rivoal; Rachel Andrew. <a href="https://www.w3.org/TR/css-multicol-1/">CSS Multi-column Layout Module Level 1</a>. 28 May 2018. WD. URL: <a href="https://www.w3.org/TR/css-multicol-1/">https://www.w3.org/TR/css-multicol-1/</a> <dt id="biblio-cssom">[CSSOM] <dd>Simon Pieters; Glenn Adams. <a href="https://www.w3.org/TR/cssom-1/">CSS Object Model (CSSOM)</a>. 17 March 2016. WD. URL: <a href="https://www.w3.org/TR/cssom-1/">https://www.w3.org/TR/cssom-1/</a> <dt id="biblio-dom">[DOM] <dd>Anne van Kesteren. <a href="https://dom.spec.whatwg.org/">DOM Standard</a>. Living Standard. URL: <a href="https://dom.spec.whatwg.org/">https://dom.spec.whatwg.org/</a> <dt id="biblio-dom-level-3-events">[DOM-LEVEL-3-EVENTS] <dd>Gary Kacmarcik; Travis Leithead. <a href="https://www.w3.org/TR/uievents/">UI Events</a>. 4 August 2016. WD. URL: <a href="https://www.w3.org/TR/uievents/">https://www.w3.org/TR/uievents/</a> <dt id="biblio-rfc2119">[RFC2119] <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a> <dt id="biblio-select">[SELECT] <dd>Tantek Çelik; et al. <a href="https://www.w3.org/TR/selectors-3/">Selectors Level 3</a>. 11 September 2018. PR. URL: <a href="https://www.w3.org/TR/selectors-3/">https://www.w3.org/TR/selectors-3/</a> <dt id="biblio-webidl">[WebIDL] <dd>Cameron McCormack; Boris Zbarsky; Tobie Langel. <a href="https://heycam.github.io/webidl/">Web IDL</a>. 15 December 2016. ED. URL: <a href="https://heycam.github.io/webidl/">https://heycam.github.io/webidl/</a> </dl> <h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3> <dl> <dt id="biblio-css-overflow-3">[CSS-OVERFLOW-3] <dd>David Baron; Elika Etemad; Florian Rivoal. <a href="https://www.w3.org/TR/css-overflow-3/">CSS Overflow Module Level 3</a>. 31 July 2018. WD. URL: <a href="https://www.w3.org/TR/css-overflow-3/">https://www.w3.org/TR/css-overflow-3/</a> <dt id="biblio-css3-exclusions">[CSS3-EXCLUSIONS] <dd>Rossen Atanassov; Vincent Hardy; Alan Stearns. <a href="https://www.w3.org/TR/css3-exclusions/">CSS Exclusions Module Level 1</a>. 15 January 2015. WD. URL: <a href="https://www.w3.org/TR/css3-exclusions/">https://www.w3.org/TR/css3-exclusions/</a> <dt id="biblio-css3-flexbox">[CSS3-FLEXBOX] <dd>Tab Atkins Jr.; Elika Etemad; Rossen Atanassov. <a href="https://www.w3.org/TR/css-flexbox-1/">CSS Flexible Box Layout Module Level 1</a>. 19 October 2017. CR. URL: <a href="https://www.w3.org/TR/css-flexbox-1/">https://www.w3.org/TR/css-flexbox-1/</a> <dt id="biblio-css3-line-grid">[CSS3-LINE-GRID] <dd>Elika Etemad; Koji Ishii; Alan Stearns. <a href="https://www.w3.org/TR/css-line-grid-1/">CSS Line Grid Module Level 1</a>. 16 September 2014. WD. URL: <a href="https://www.w3.org/TR/css-line-grid-1/">https://www.w3.org/TR/css-line-grid-1/</a> <dt id="biblio-css3-page-template">[CSS3-PAGE-TEMPLATE] <dd>Alan Stearns. <a href="https://drafts.csswg.org/css3-page-template/">CSS Pagination Templates Module Level 3</a>. Proposal for a CSS module. URL: <a href="https://drafts.csswg.org/css3-page-template/">https://drafts.csswg.org/css3-page-template/</a> <dt id="biblio-css3page">[CSS3PAGE] <dd>Melinda Grant; et al. <a href="https://www.w3.org/TR/css3-page/">CSS Paged Media Module Level 3</a>. 14 March 2013. WD. URL: <a href="https://www.w3.org/TR/css3-page/">https://www.w3.org/TR/css3-page/</a> <dt id="biblio-cssom-view">[CSSOM-VIEW] <dd>Simon Pieters. <a href="https://www.w3.org/TR/cssom-view-1/">CSSOM View Module</a>. 17 March 2016. WD. URL: <a href="https://www.w3.org/TR/cssom-view-1/">https://www.w3.org/TR/cssom-view-1/</a> <dt id="biblio-html401">[HTML401] <dd>Dave Raggett; Arnaud Le Hors; Ian Jacobs. <a href="https://www.w3.org/TR/html401/">HTML 4.01 Specification</a>. 27 March 2018. REC. URL: <a href="https://www.w3.org/TR/html401/">https://www.w3.org/TR/html401/</a> </dl> <h2 class="no-num no-ref heading settled" id="property-index"><span class="content">Property Index</span><a class="self-link" href="#property-index"></a></h2> <div class="big-element-wrapper"> <table class="index"> <thead> <tr> <th scope="col">Name <th scope="col">Value <th scope="col">Initial <th scope="col">Applies to <th scope="col">Inh. <th scope="col">%ages <th scope="col">Animation type <th scope="col">Canonical order <th scope="col">Computed value <tbody> <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-break-after" id="ref-for-propdef-break-after②">break-after</a> <td>auto | always | avoid | left | right | page | column | region | avoid-page | avoid-column | avoid-region <td>auto <td>block-level elements <td>no <td>n/a <td>discrete <td>per grammar <td>as specified <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-break-before" id="ref-for-propdef-break-before②">break-before</a> <td>auto | always | avoid | left | right | page | column | region | avoid-page | avoid-column | avoid-region <td>auto <td>block-level elements <td>no <td>n/a <td>discrete <td>per grammar <td>as specified <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-break-inside" id="ref-for-propdef-break-inside②">break-inside</a> <td>auto | avoid | avoid-page | avoid-column | avoid-region <td>auto <td>block-level elements <td>no <td>n/a <td>discrete <td>per grammar <td>as specified <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-flow-from" id="ref-for-propdef-flow-from①③">flow-from</a> <td><ident> | none | inherit <td>none <td>Non-replaced block containers. This might be expanded in future versions of the specification to allow other types of containers to receive flow content. <td>no <td>n/a <td>discrete <td>per grammar <td>as specified <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-flow-into" id="ref-for-propdef-flow-into①⓪">flow-into</a> <td>none | <ident> [element|content]? <td>none <td>All elements, but not pseudo-elements such as ::first-line, ::first-letter, ::before or ::after. <td>no <td>n/a <td>discrete <td>per grammar <td>as specified <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-region-fragment" id="ref-for-propdef-region-fragment⑤">region-fragment</a> <td>auto | break <td>auto <td>CSS Regions <td>no <td>n/a <td>discrete <td>per grammar <td>as specified </table> </div> <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">IDL Index</span><a class="self-link" href="#idl-index"></a></h2> <pre class="idl highlight def"><c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://dom.spec.whatwg.org/#document" id="ref-for-document①"><c- g>Document</c-></a> { <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#namedflowmap" id="ref-for-namedflowmap⑥"><c- n>NamedFlowMap</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="NamedFlowMap" href="#dom-document-namedflows" id="ref-for-dom-document-namedflows①"><c- g>namedFlows</c-></a>; }; [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed③"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute"><c- g>MapClass</c-></a>=(<a class="n" data-link-type="idl-name" href="https://drafts.csswg.org/cssom-1/#cssomstring" id="ref-for-cssomstring⑦"><c- n>CSSOMString</c-></a>, <a class="n" data-link-type="idl-name" href="#namedflow" id="ref-for-namedflow②①"><c- n>NamedFlow</c-></a>)] <c- b>interface</c-> <a href="#namedflowmap"><code><c- g>NamedFlowMap</c-></code></a> { <a class="n" data-link-type="idl-name" href="#namedflow" id="ref-for-namedflow③①"><c- n>NamedFlow</c-></a>? <a href="#dom-namedflowmap-get"><code><c- g>get</c-></code></a>(<a class="n" data-link-type="idl-name" href="https://drafts.csswg.org/cssom-1/#cssomstring" id="ref-for-cssomstring①①"><c- n>CSSOMString</c-></a> <a href="#dom-namedflowmap-get-flowname-flowname"><code><c- g>flowName</c-></code></a>); <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean③"><c- b>boolean</c-></a> <a href="#dom-namedflowmap-has"><code><c- g>has</c-></code></a>(<a class="n" data-link-type="idl-name" href="https://drafts.csswg.org/cssom-1/#cssomstring" id="ref-for-cssomstring②①"><c- n>CSSOMString</c-></a> <a href="#dom-namedflowmap-has-flowname-flowname"><code><c- g>flowName</c-></code></a>); <a class="n" data-link-type="idl-name" href="#namedflowmap" id="ref-for-namedflowmap③①"><c- n>NamedFlowMap</c-></a> <a href="#dom-namedflowmap-set"><code><c- g>set</c-></code></a>(<a class="n" data-link-type="idl-name" href="https://drafts.csswg.org/cssom-1/#cssomstring" id="ref-for-cssomstring③①"><c- n>CSSOMString</c-></a> <a href="#dom-namedflowmap-set-flowname-flowvalue-flowname"><code><c- g>flowName</c-></code></a>, <a class="n" data-link-type="idl-name" href="#namedflow" id="ref-for-namedflow④①"><c- n>NamedFlow</c-></a> <a href="#dom-namedflowmap-set-flowname-flowvalue-flowvalue"><code><c- g>flowValue</c-></code></a>); <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①①"><c- b>boolean</c-></a> <a href="#dom-namedflowmap-delete"><code><c- g>delete</c-></code></a>(<a class="n" data-link-type="idl-name" href="https://drafts.csswg.org/cssom-1/#cssomstring" id="ref-for-cssomstring④①"><c- n>CSSOMString</c-></a> <a href="#dom-namedflowmap-delete-flowname-flowname"><code><c- g>flowName</c-></code></a>); }; [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①①"><c- g>Exposed</c-></a>=<c- n>Window</c->] <c- b>interface</c-> <a href="#namedflow"><code><c- g>NamedFlow</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget①"><c- n>EventTarget</c-></a> { <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://drafts.csswg.org/cssom-1/#cssomstring" id="ref-for-cssomstring⑤①"><c- n>CSSOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="CSSOMString" href="#dom-namedflow-name" id="ref-for-dom-namedflow-name①"><c- g>name</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean②①"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-namedflow-overset" id="ref-for-dom-namedflow-overset①①"><c- g>overset</c-></a>; <c- b>sequence</c-><<a class="n" data-link-type="idl-name" href="#region" id="ref-for-region⑦"><c- n>Region</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-namedflow-getregions" id="ref-for-dom-namedflow-getregions①"><c- g>getRegions</c-></a>(); <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-short" id="ref-for-idl-short①"><c- b>short</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="short" href="#dom-namedflow-firstemptyregionindex" id="ref-for-dom-namedflow-firstemptyregionindex①"><c- g>firstEmptyRegionIndex</c-></a>; <c- b>sequence</c-><<a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#node" id="ref-for-node②"><c- n>Node</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-namedflow-getcontent" id="ref-for-dom-namedflow-getcontent①"><c- g>getContent</c-></a>(); <c- b>sequence</c-><<a class="n" data-link-type="idl-name" href="#region" id="ref-for-region①①"><c- n>Region</c-></a>> <a href="#dom-namedflow-getregionsbycontent"><code><c- g>getRegionsByContent</c-></code></a>(<a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#node" id="ref-for-node①①"><c- n>Node</c-></a> <a href="#dom-namedflow-getregionsbycontent-node-node"><code><c- g>node</c-></code></a>); }; [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed②①"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NoInterfaceObject" id="ref-for-NoInterfaceObject①"><c- g>NoInterfaceObject</c-></a>] <c- b>interface</c-> <a href="#region"><code><c- g>Region</c-></code></a> { <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://drafts.csswg.org/cssom-1/#cssomstring" id="ref-for-cssomstring⑥①"><c- n>CSSOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="CSSOMString" href="#dom-region-regionoverset" id="ref-for-dom-region-regionoverset②"><c- g>regionOverset</c-></a>; <c- b>sequence</c-><<a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#range" id="ref-for-range③"><c- n>Range</c-></a>>? <a class="idl-code" data-link-type="method" href="#dom-region-getregionflowranges" id="ref-for-dom-region-getregionflowranges①"><c- g>getRegionFlowRanges</c-></a>(); }; <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#element" id="ref-for-element①"><c- n>Element</c-></a> <c- b>implements</c-> <a class="n" data-link-type="idl-name" href="#region" id="ref-for-region③①"><c- n>Region</c-></a>; </pre> <aside class="dfn-panel" data-for="css-region"> <b><a href="#css-region">#css-region</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-css-region">1. Introduction</a> <a href="#ref-for-css-region①">(2)</a> <a href="#ref-for-css-region②">(3)</a> <a href="#ref-for-css-region③">(4)</a> <li><a href="#ref-for-css-region④">2.2. Region chain</a> <a href="#ref-for-css-region⑤">(2)</a> <li><a href="#ref-for-css-region⑥">2.3. Last region</a> <li><a href="#ref-for-css-region⑦">2.4. Named flows</a> <li><a href="#ref-for-css-region⑧">2.5. Regions flow breaking rules</a> <a href="#ref-for-css-region⑨">(2)</a> <li><a href="#ref-for-css-region①⓪">3.1. The flow-into property</a> <a href="#ref-for-css-region①①">(2)</a> <a href="#ref-for-css-region①②">(3)</a> <li><a href="#ref-for-css-region①③">3.2. The flow-from property</a> <a href="#ref-for-css-region①④">(2)</a> <a href="#ref-for-css-region①⑤">(3)</a> <a href="#ref-for-css-region①⑥">(4)</a> <a href="#ref-for-css-region①⑦">(5)</a> <a href="#ref-for-css-region①⑧">(6)</a> <a href="#ref-for-css-region①⑨">(7)</a> <a href="#ref-for-css-region②⓪">(8)</a> <a href="#ref-for-css-region②①">(9)</a> <a href="#ref-for-css-region②②">(10)</a> <a href="#ref-for-css-region②③">(11)</a> <a href="#ref-for-css-region②④">(12)</a> <a href="#ref-for-css-region②⑤">(13)</a> <li><a href="#ref-for-css-region②⑥">3.2.1. Cycle Detection</a> <a href="#ref-for-css-region②⑦">(2)</a> <a href="#ref-for-css-region②⑧">(3)</a> <a href="#ref-for-css-region②⑨">(4)</a> <a href="#ref-for-css-region③⓪">(5)</a> <li><a href="#ref-for-css-region③①">3.2.2. Nested fragmentation contexts</a> <a href="#ref-for-css-region③②">(2)</a> <a href="#ref-for-css-region③③">(3)</a> <a href="#ref-for-css-region③④">(4)</a> <li><a href="#ref-for-css-region③⑤">3.4. The region-fragment property</a> <a href="#ref-for-css-region③⑥">(2)</a> <a href="#ref-for-css-region③⑦">(3)</a> <a href="#ref-for-css-region③⑧">(4)</a> <li><a href="#ref-for-css-region③⑨">4.1. The NamedFlow interface</a> <li><a href="#ref-for-css-region④⓪">4.2. The Region interface</a> <li><a href="#ref-for-css-region④①">5. Multi-column regions</a> <li><a href="#ref-for-css-region④②">6. Pseudo-elements</a> <li><a href="#ref-for-css-region④③">8. Relation to document events</a> <a href="#ref-for-css-region④④">(2)</a> <li><a href="#ref-for-css-region④⑤">9. Relation to other specifications</a> </ul> </aside> <aside class="dfn-panel" data-for="region-chain"> <b><a href="#region-chain">#region-chain</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-region-chain">1. Introduction</a> <a href="#ref-for-region-chain①">(2)</a> <a href="#ref-for-region-chain②">(3)</a> <a href="#ref-for-region-chain③">(4)</a> <a href="#ref-for-region-chain④">(5)</a> <li><a href="#ref-for-region-chain⑤">2.2. Region chain</a> <a href="#ref-for-region-chain⑥">(2)</a> <li><a href="#ref-for-region-chain⑦">2.3. Last region</a> <li><a href="#ref-for-region-chain⑧">2.4. Named flows</a> <li><a href="#ref-for-region-chain⑨">2.5. Regions flow breaking rules</a> <a href="#ref-for-region-chain①⓪">(2)</a> <a href="#ref-for-region-chain①①">(3)</a> <a href="#ref-for-region-chain①②">(4)</a> <li><a href="#ref-for-region-chain①③">3.1. The flow-into property</a> <a href="#ref-for-region-chain①④">(2)</a> <a href="#ref-for-region-chain①⑤">(3)</a> <a href="#ref-for-region-chain①⑥">(4)</a> <a href="#ref-for-region-chain①⑦">(5)</a> <a href="#ref-for-region-chain①⑧">(6)</a> <li><a href="#ref-for-region-chain①⑨">3.2. The flow-from property</a> <a href="#ref-for-region-chain②⓪">(2)</a> <a href="#ref-for-region-chain②①">(3)</a> <a href="#ref-for-region-chain②②">(4)</a> <a href="#ref-for-region-chain②③">(5)</a> <li><a href="#ref-for-region-chain②④">3.2.1. Cycle Detection</a> <a href="#ref-for-region-chain②⑤">(2)</a> <li><a href="#ref-for-region-chain②⑥">3.2.2. Nested fragmentation contexts</a> <li><a href="#ref-for-region-chain②⑦">3.3. Region flow break properties: break-before, break-after, break-inside</a> <li><a href="#ref-for-region-chain②⑧">4.1. The NamedFlow interface</a> <a href="#ref-for-region-chain②⑨">(2)</a> <a href="#ref-for-region-chain③⓪">(3)</a> <a href="#ref-for-region-chain③①">(4)</a> <a href="#ref-for-region-chain③②">(5)</a> <a href="#ref-for-region-chain③③">(6)</a> <a href="#ref-for-region-chain③④">(7)</a> <li><a href="#ref-for-region-chain③⑤">4.2. The Region interface</a> <a href="#ref-for-region-chain③⑥">(2)</a> <a href="#ref-for-region-chain③⑦">(3)</a> <a href="#ref-for-region-chain③⑧">(4)</a> <a href="#ref-for-region-chain③⑨">(5)</a> <a href="#ref-for-region-chain④⓪">(6)</a> <a href="#ref-for-region-chain④①">(7)</a> <li><a href="#ref-for-region-chain④②">4.3. Named flow events</a> <a href="#ref-for-region-chain④③">(2)</a> <a href="#ref-for-region-chain④④">(3)</a> <li><a href="#ref-for-region-chain④⑤">4.4.1. getClientRects() and getBoundingClientRect()</a> <li><a href="#ref-for-region-chain④⑥">5. Multi-column regions</a> <a href="#ref-for-region-chain④⑦">(2)</a> <a href="#ref-for-region-chain④⑧">(3)</a> <a href="#ref-for-region-chain④⑨">(4)</a> <li><a href="#ref-for-region-chain⑤⓪">6. Pseudo-elements</a> <a href="#ref-for-region-chain⑤①">(2)</a> <li><a href="#ref-for-region-chain⑤②">7.3. Regions visual formatting steps</a> <li><a href="#ref-for-region-chain⑤③">7.3.3. Step 3: named flows layout</a> <li><a href="#ref-for-region-chain⑤④">7.5.4. Step 3: named flows layout</a> </ul> </aside> <aside class="dfn-panel" data-for="last-usable-region"> <b><a href="#last-usable-region">#last-usable-region</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-last-usable-region">2.5. Regions flow breaking rules</a> <li><a href="#ref-for-last-usable-region①">3.4. The region-fragment property</a> <a href="#ref-for-last-usable-region②">(2)</a> <a href="#ref-for-last-usable-region③">(3)</a> <li><a href="#ref-for-last-usable-region④">4.1. The NamedFlow interface</a> <li><a href="#ref-for-last-usable-region⑤">4.2. The Region interface</a> <a href="#ref-for-last-usable-region⑥">(2)</a> <a href="#ref-for-last-usable-region⑦">(3)</a> <a href="#ref-for-last-usable-region⑧">(4)</a> <a href="#ref-for-last-usable-region⑨">(5)</a> <li><a href="#ref-for-last-usable-region①⓪">5. Multi-column regions</a> </ul> </aside> <aside class="dfn-panel" data-for="named-flow"> <b><a href="#named-flow">#named-flow</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-named-flow">1. Introduction</a> <a href="#ref-for-named-flow①">(2)</a> <a href="#ref-for-named-flow②">(3)</a> <a href="#ref-for-named-flow③">(4)</a> <a href="#ref-for-named-flow④">(5)</a> <a href="#ref-for-named-flow⑤">(6)</a> <li><a href="#ref-for-named-flow⑥">2.1. Regions</a> <li><a href="#ref-for-named-flow⑦">2.2. Region chain</a> <a href="#ref-for-named-flow⑧">(2)</a> <li><a href="#ref-for-named-flow⑨">2.4. Named flows</a> <a href="#ref-for-named-flow①⓪">(2)</a> <a href="#ref-for-named-flow①①">(3)</a> <a href="#ref-for-named-flow①②">(4)</a> <a href="#ref-for-named-flow①③">(5)</a> <a href="#ref-for-named-flow①④">(6)</a> <li><a href="#ref-for-named-flow①⑤">2.5. Regions flow breaking rules</a> <a href="#ref-for-named-flow①⑥">(2)</a> <a href="#ref-for-named-flow①⑦">(3)</a> <a href="#ref-for-named-flow①⑧">(4)</a> <li><a href="#ref-for-named-flow①⑨">3.1. The flow-into property</a> <a href="#ref-for-named-flow②⓪">(2)</a> <a href="#ref-for-named-flow②①">(3)</a> <a href="#ref-for-named-flow②②">(4)</a> <a href="#ref-for-named-flow②③">(5)</a> <a href="#ref-for-named-flow②④">(6)</a> <a href="#ref-for-named-flow②⑤">(7)</a> <a href="#ref-for-named-flow②⑥">(8)</a> <a href="#ref-for-named-flow②⑦">(9)</a> <a href="#ref-for-named-flow②⑧">(10)</a> <a href="#ref-for-named-flow②⑨">(11)</a> <a href="#ref-for-named-flow③⓪">(12)</a> <a href="#ref-for-named-flow③①">(13)</a> <a href="#ref-for-named-flow③②">(14)</a> <a href="#ref-for-named-flow③③">(15)</a> <a href="#ref-for-named-flow③④">(16)</a> <li><a href="#ref-for-named-flow③⑤">3.2. The flow-from property</a> <a href="#ref-for-named-flow③⑥">(2)</a> <a href="#ref-for-named-flow③⑦">(3)</a> <li><a href="#ref-for-named-flow③⑧">3.2.1. Cycle Detection</a> <a href="#ref-for-named-flow③⑨">(2)</a> <a href="#ref-for-named-flow④⓪">(3)</a> <a href="#ref-for-named-flow④①">(4)</a> <a href="#ref-for-named-flow④②">(5)</a> <a href="#ref-for-named-flow④③">(6)</a> <a href="#ref-for-named-flow④④">(7)</a> <a href="#ref-for-named-flow④⑤">(8)</a> <a href="#ref-for-named-flow④⑥">(9)</a> <a href="#ref-for-named-flow④⑦">(10)</a> <li><a href="#ref-for-named-flow④⑧">3.2.2. Nested fragmentation contexts</a> <li><a href="#ref-for-named-flow④⑨">3.3. Region flow break properties: break-before, break-after, break-inside</a> <li><a href="#ref-for-named-flow⑤⓪">3.4. The region-fragment property</a> <li><a href="#ref-for-named-flow⑤①">4.1. The NamedFlow interface</a> <a href="#ref-for-named-flow⑤②">(2)</a> <a href="#ref-for-named-flow⑤③">(3)</a> <a href="#ref-for-named-flow⑤④">(4)</a> <a href="#ref-for-named-flow⑤⑤">(5)</a> <a href="#ref-for-named-flow⑤⑥">(6)</a> <a href="#ref-for-named-flow⑤⑦">(7)</a> <a href="#ref-for-named-flow⑤⑧">(8)</a> <a href="#ref-for-named-flow⑤⑨">(9)</a> <a href="#ref-for-named-flow⑥⓪">(10)</a> <a href="#ref-for-named-flow⑥①">(11)</a> <a href="#ref-for-named-flow⑥②">(12)</a> <a href="#ref-for-named-flow⑥③">(13)</a> <a href="#ref-for-named-flow⑥④">(14)</a> <a href="#ref-for-named-flow⑥⑤">(15)</a> <a href="#ref-for-named-flow⑥⑥">(16)</a> <a href="#ref-for-named-flow⑥⑦">(17)</a> <a href="#ref-for-named-flow⑥⑧">(18)</a> <a href="#ref-for-named-flow⑥⑨">(19)</a> <a href="#ref-for-named-flow⑦⓪">(20)</a> <li><a href="#ref-for-named-flow⑦①">4.2. The Region interface</a> <a href="#ref-for-named-flow⑦②">(2)</a> <a href="#ref-for-named-flow⑦③">(3)</a> <a href="#ref-for-named-flow⑦④">(4)</a> <a href="#ref-for-named-flow⑦⑤">(5)</a> <a href="#ref-for-named-flow⑦⑥">(6)</a> <a href="#ref-for-named-flow⑦⑦">(7)</a> <a href="#ref-for-named-flow⑦⑧">(8)</a> <li><a href="#ref-for-named-flow⑦⑨">4.4.2. offsetTop, offsetLeft, offsetWidth, offsetHeight and offsetParent</a> <a href="#ref-for-named-flow⑧⓪">(2)</a> <li><a href="#ref-for-named-flow⑧①">5. Multi-column regions</a> <a href="#ref-for-named-flow⑧②">(2)</a> <li><a href="#ref-for-named-flow⑧③">7. Regions visual formatting details</a> <a href="#ref-for-named-flow⑧④">(2)</a> <li><a href="#ref-for-named-flow⑧⑤">7.2. The Region Flow Content Box (RFCB)</a> <li><a href="#ref-for-named-flow⑧⑥">7.2.1. RFCB width resolution</a> <a href="#ref-for-named-flow⑧⑦">(2)</a> <li><a href="#ref-for-named-flow⑧⑧">7.3. Regions visual formatting steps</a> <a href="#ref-for-named-flow⑧⑨">(2)</a> <a href="#ref-for-named-flow⑨⓪">(3)</a> <a href="#ref-for-named-flow⑨①">(4)</a> <li><a href="#ref-for-named-flow⑨②">7.3.1.1. RFCB flow fragment height resolution, Phase 1</a> <li><a href="#ref-for-named-flow⑨③">7.3.1.2. RFCB flow fragment height resolution, Phase 2</a> <a href="#ref-for-named-flow⑨④">(2)</a> <a href="#ref-for-named-flow⑨⑤">(3)</a> <li><a href="#ref-for-named-flow⑨⑥">7.3.2. Step 2: region boxes layout</a> <li><a href="#ref-for-named-flow⑨⑦">7.3.3. Step 3: named flows layout</a> <a href="#ref-for-named-flow⑨⑧">(2)</a> <a href="#ref-for-named-flow⑨⑨">(3)</a> <a href="#ref-for-named-flow①⓪⓪">(4)</a> <li><a href="#ref-for-named-flow①⓪①">7.4. Regions visual formatting: implementation note</a> <li><a href="#ref-for-named-flow①⓪②">7.5.3. Step 2: Layout document and regions without named flows</a> <li><a href="#ref-for-named-flow①⓪③">7.5.4. Step 3: named flows layout</a> <a href="#ref-for-named-flow①⓪④">(2)</a> <li><a href="#ref-for-named-flow①⓪⑤">8. Relation to document events</a> </ul> </aside> <aside class="dfn-panel" data-for="propdef-flow-into"> <b><a href="#propdef-flow-into">#propdef-flow-into</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-propdef-flow-into">2.4. Named flows</a> <li><a href="#ref-for-propdef-flow-into①">3.1. The flow-into property</a> <a href="#ref-for-propdef-flow-into②">(2)</a> <a href="#ref-for-propdef-flow-into③">(3)</a> <a href="#ref-for-propdef-flow-into④">(4)</a> <a href="#ref-for-propdef-flow-into⑤">(5)</a> <a href="#ref-for-propdef-flow-into⑥">(6)</a> <a href="#ref-for-propdef-flow-into⑦">(7)</a> <a href="#ref-for-propdef-flow-into⑧">(8)</a> <a href="#ref-for-propdef-flow-into⑨">(9)</a> </ul> </aside> <aside class="dfn-panel" data-for="propdef-flow-from"> <b><a href="#propdef-flow-from">#propdef-flow-from</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-propdef-flow-from">1. Introduction</a> <li><a href="#ref-for-propdef-flow-from①">2.1. Regions</a> <li><a href="#ref-for-propdef-flow-from②">2.4. Named flows</a> <li><a href="#ref-for-propdef-flow-from③">3.2. The flow-from property</a> <a href="#ref-for-propdef-flow-from④">(2)</a> <a href="#ref-for-propdef-flow-from⑤">(3)</a> <a href="#ref-for-propdef-flow-from⑥">(4)</a> <a href="#ref-for-propdef-flow-from⑦">(5)</a> <li><a href="#ref-for-propdef-flow-from⑧">3.2.1. Cycle Detection</a> <a href="#ref-for-propdef-flow-from⑨">(2)</a> <a href="#ref-for-propdef-flow-from①⓪">(3)</a> <a href="#ref-for-propdef-flow-from①①">(4)</a> <li><a href="#ref-for-propdef-flow-from①②">4.2. The Region interface</a> </ul> </aside> <aside class="dfn-panel" data-for="nested-region-context"> <b><a href="#nested-region-context">#nested-region-context</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-nested-region-context">7.3.1.2. RFCB flow fragment height resolution, Phase 2</a> <li><a href="#ref-for-nested-region-context①">7.3.3. Step 3: named flows layout</a> </ul> </aside> <aside class="dfn-panel" data-for="propdef-break-before"> <b><a href="#propdef-break-before">#propdef-break-before</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-propdef-break-before">3.3. Region flow break properties: break-before, break-after, break-inside</a> <a href="#ref-for-propdef-break-before①">(2)</a> </ul> </aside> <aside class="dfn-panel" data-for="propdef-break-after"> <b><a href="#propdef-break-after">#propdef-break-after</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-propdef-break-after">3.3. Region flow break properties: break-before, break-after, break-inside</a> <a href="#ref-for-propdef-break-after①">(2)</a> </ul> </aside> <aside class="dfn-panel" data-for="propdef-break-inside"> <b><a href="#propdef-break-inside">#propdef-break-inside</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-propdef-break-inside">3.3. Region flow break properties: break-before, break-after, break-inside</a> <a href="#ref-for-propdef-break-inside①">(2)</a> </ul> </aside> <aside class="dfn-panel" data-for="propdef-region-fragment"> <b><a href="#propdef-region-fragment">#propdef-region-fragment</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-propdef-region-fragment">2.5. Regions flow breaking rules</a> <li><a href="#ref-for-propdef-region-fragment①">3.4. The region-fragment property</a> <a href="#ref-for-propdef-region-fragment②">(2)</a> <a href="#ref-for-propdef-region-fragment③">(3)</a> <li><a href="#ref-for-propdef-region-fragment④">4.2. The Region interface</a> </ul> </aside> <aside class="dfn-panel" data-for="dom-document-namedflows"> <b><a href="#dom-document-namedflows">#dom-document-namedflows</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-dom-document-namedflows">4.1. The NamedFlow interface</a> </ul> </aside> <aside class="dfn-panel" data-for="namedflowmap"> <b><a href="#namedflowmap">#namedflowmap</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-namedflowmap">4.1. The NamedFlow interface</a> <a href="#ref-for-namedflowmap①">(2)</a> <a href="#ref-for-namedflowmap②">(3)</a> <a href="#ref-for-namedflowmap③">(4)</a> <a href="#ref-for-namedflowmap④">(5)</a> <a href="#ref-for-namedflowmap⑤">(6)</a> </ul> </aside> <aside class="dfn-panel" data-for="namedflow"> <b><a href="#namedflow">#namedflow</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-namedflow">4.1. The NamedFlow interface</a> <a href="#ref-for-namedflow①">(2)</a> <a href="#ref-for-namedflow②">(3)</a> <a href="#ref-for-namedflow③">(4)</a> <a href="#ref-for-namedflow④">(5)</a> <a href="#ref-for-namedflow⑤">(6)</a> <a href="#ref-for-namedflow⑥">(7)</a> <a href="#ref-for-namedflow⑦">(8)</a> <a href="#ref-for-namedflow⑧">(9)</a> <a href="#ref-for-namedflow⑨">(10)</a> <a href="#ref-for-namedflow①⓪">(11)</a> <li><a href="#ref-for-namedflow①①">4.3. Named flow events</a> <a href="#ref-for-namedflow①②">(2)</a> <a href="#ref-for-namedflow①③">(3)</a> <a href="#ref-for-namedflow①④">(4)</a> <a href="#ref-for-namedflow①⑤">(5)</a> </ul> </aside> <aside class="dfn-panel" data-for="dom-namedflow-name"> <b><a href="#dom-namedflow-name">#dom-namedflow-name</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-dom-namedflow-name">4.1. The NamedFlow interface</a> </ul> </aside> <aside class="dfn-panel" data-for="dom-namedflow-overset"> <b><a href="#dom-namedflow-overset">#dom-namedflow-overset</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-dom-namedflow-overset">4.1. The NamedFlow interface</a> <a href="#ref-for-dom-namedflow-overset①">(2)</a> </ul> </aside> <aside class="dfn-panel" data-for="dom-namedflow-getregions"> <b><a href="#dom-namedflow-getregions">#dom-namedflow-getregions</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-dom-namedflow-getregions">4.1. The NamedFlow interface</a> </ul> </aside> <aside class="dfn-panel" data-for="dom-namedflow-firstemptyregionindex"> <b><a href="#dom-namedflow-firstemptyregionindex">#dom-namedflow-firstemptyregionindex</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-dom-namedflow-firstemptyregionindex">4.1. The NamedFlow interface</a> </ul> </aside> <aside class="dfn-panel" data-for="dom-namedflow-getcontent"> <b><a href="#dom-namedflow-getcontent">#dom-namedflow-getcontent</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-dom-namedflow-getcontent">4.1. The NamedFlow interface</a> </ul> </aside> <aside class="dfn-panel" data-for="region"> <b><a href="#region">#region</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-region">4.1. The NamedFlow interface</a> <a href="#ref-for-region①">(2)</a> <li><a href="#ref-for-region②">4.2. The Region interface</a> <a href="#ref-for-region③">(2)</a> <a href="#ref-for-region④">(3)</a> <a href="#ref-for-region⑤">(4)</a> <a href="#ref-for-region⑥">(5)</a> </ul> </aside> <aside class="dfn-panel" data-for="dom-region-regionoverset"> <b><a href="#dom-region-regionoverset">#dom-region-regionoverset</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-dom-region-regionoverset">4.2. The Region interface</a> <a href="#ref-for-dom-region-regionoverset①">(2)</a> </ul> </aside> <aside class="dfn-panel" data-for="dom-region-getregionflowranges"> <b><a href="#dom-region-getregionflowranges">#dom-region-getregionflowranges</a></b><b>Referenced in:</b> <ul> <li><a href="#ref-for-dom-region-getregionflowranges">4.2. The Region interface</a> </ul> </aside> <script>/* script-dfn-panel */ document.body.addEventListener("click", function(e) { var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); } // Find the dfn element or panel, if any, that was clicked on. var el = e.target; var target; var hitALink = false; while(el.parentElement) { if(el.tagName == "A") { // Clicking on a link in a <dfn> shouldn't summon the panel hitALink = true; } if(el.classList.contains("dfn-paneled")) { target = "dfn"; break; } if(el.classList.contains("dfn-panel")) { target = "dfn-panel"; break; } el = el.parentElement; } if(target != "dfn-panel") { // Turn off any currently "on" or "activated" panels. queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){ el.classList.remove("on"); el.classList.remove("activated"); }); } if(target == "dfn" && !hitALink) { // open the panel var dfnPanel = document.querySelector(".dfn-panel[data-for='" + el.id + "']"); if(dfnPanel) { dfnPanel.classList.add("on"); var rect = el.getBoundingClientRect(); dfnPanel.style.left = window.scrollX + rect.right + 5 + "px"; dfnPanel.style.top = window.scrollY + rect.top + "px"; var panelRect = dfnPanel.getBoundingClientRect(); var panelWidth = panelRect.right - panelRect.left; if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) { // Reposition, because the panel is overflowing dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + "px"; } } else { console.log("Couldn't find .dfn-panel[data-for='" + el.id + "']"); } } else if(target == "dfn-panel") { // Switch it to "activated" state, which pins it. el.classList.add("activated"); el.style.left = null; el.style.top = null; } }); </script><a class='warning' href='/date/2018-09-21T07:22:30/bikeshed/css-regions-1/' id='generator' title='Bikeshed Warnings'><svg height='24' viewbox='0 0 100 100' width='24'><g stroke="blue" stroke-width="6" fill="none"><path fill="blue" stroke="none" d="M 5 95 L 5 35 L 50 10 L 50 95"/><path d="M 1 37 L 54 8"/><path fill="blue" stroke="none" d="M 1 40 v -6 l 60 -32 v 6 z" /><circle cx="75" cy="79" r="15" /><circle fill="blue" stroke="none" cx="75" cy="79" r="4" /><path d="M 75 79 L 65 49 L 55 49" /><path d="M 67 55 L 48 69" /></g></svg></a>