1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/css-overflow/Overview.bs Tue Jan 27 15:56:33 2015 -0800 1.3 @@ -0,0 +1,1133 @@ 1.4 +<h1>CSS Overflow Module Level 3</h1> 1.5 +<pre class="metadata"> 1.6 +Status: ED 1.7 +ED: http://dev.w3.org/csswg/css-overflow/ 1.8 +Shortname: css-overflow 1.9 +Group: csswg 1.10 +Level: 1 1.11 +TR: http://www.w3.org/TR/css-overflow-3/ 1.12 +Previous version: http://www.w3.org/TR/2013/WD-css-overflow-3-20130418/ 1.13 +Editor: L. David Baron, Mozilla, http://dbaron.org/ 1.14 +Abstract: This module contains the features of CSS relating to new mechanisms of overflow handling in visual media (e.g., screen or paper). In interactive media, it describes features that allow the overflow from a fixed size container to be handled by pagination (displaying one page at a time). It also describes features, applying to all visual media, that allow the contents of an element to be spread across multiple fragments, allowing the contents to flow across multiple regions or to have different styles for different fragments. 1.15 +Status Text: The following features are at risk: … 1.16 +!Change Log: <a href="https://dvcs.w3.org/hg/csswg/log/tip/css-overflow/Overview.bs">from 27 January 2015 to the present</a> 1.17 +!Change Log: <a href="https://dvcs.w3.org/hg/csswg/log/tip/css-overflow/Overview.src.html">from 28 March 2013 to 27 January 2015</a> 1.18 +!Change Log: <a href="https://dvcs.w3.org/hg/csswg/log/tip/css3-overflow/Overview.src.html">from 31 July 2012to 27 March 2013</a> 1.19 +</pre> 1.20 +<pre class="link-defaults"> 1.21 +spec:css-transforms-1; type:property; text:transform-style 1.22 +</pre> 1.23 +<!-- FIXME: the break-* link doesn't actually work! --> 1.24 +<pre class="anchors"> 1.25 +url: http://www.w3.org/TR/2008/CR-css3-marquee-20081205/#the-overflow-style; type: property; text: overflow-style; 1.26 +url: http://dev.w3.org/csswg/css-break/#breaking-controls; type: property; text: break-*; 1.27 +url: http://dev.w3.org/csswg/css-multicol/#overflow-columns; type: dfn; text: overflow columns; 1.28 +url: http://dev.w3.org/csswg/selectors-3/#subject; type: dfn; text: subject; 1.29 +</pre> 1.30 + <style> 1.31 + table.source-demo-pair { 1.32 + width: 100%; 1.33 + } 1.34 + 1.35 + .in-cards-demo { 1.36 + width: 13em; 1.37 + height: 8em; 1.38 + 1.39 + padding: 4px; 1.40 + border: medium solid blue; 1.41 + margin: 6px; 1.42 + 1.43 + font: medium/1.3 Times New Roman, Times, serif; 1.44 + white-space: nowrap; 1.45 + } 1.46 + 1.47 + .bouncy-columns-demo { 1.48 + width: 6em; 1.49 + height: 10em; 1.50 + float: left; 1.51 + margin: 1em; 1.52 + font: medium/1.25 Times New Roman, Times, serif; 1.53 + white-space: nowrap; 1.54 + } 1.55 + .bouncy-columns-demo.one { 1.56 + background: aqua; color: black; 1.57 + transform: rotate(-3deg); 1.58 + } 1.59 + .bouncy-columns-demo.two { 1.60 + background: yellow; color: black; 1.61 + transform: rotate(3deg); 1.62 + } 1.63 + 1.64 + .article-font-inherit-demo { 1.65 + font: 1em/1.25 Times New Roman, Times, serif; 1.66 + white-space: nowrap; 1.67 + } 1.68 + .article-font-inherit-demo.one { 1.69 + width: 12em; 1.70 + font-size: 1.5em; 1.71 + margin-bottom: 1em; 1.72 + height: 4em; 1.73 + } 1.74 + .article-font-inherit-demo.two { 1.75 + width: 11em; 1.76 + margin-left: 5em; 1.77 + margin-right: 2em; 1.78 + } 1.79 + 1.80 + .dark-columns-demo { 1.81 + width: 6em; 1.82 + height: 10em; 1.83 + float: left; 1.84 + margin-right: 1em; 1.85 + font: medium/1.25 Times New Roman, Times, serif; 1.86 + white-space: nowrap; 1.87 + } 1.88 + .dark-columns-demo.one { 1.89 + background: aqua; color: black; 1.90 + } 1.91 + .dark-columns-demo.one :link { 1.92 + color: blue; 1.93 + } 1.94 + .dark-columns-demo.one :visited { 1.95 + color: purple; 1.96 + } 1.97 + .dark-columns-demo.two { 1.98 + background: navy; color: white; 1.99 + } 1.100 + .dark-columns-demo.two :link { 1.101 + color: aqua; 1.102 + } 1.103 + .dark-columns-demo.two :visited { 1.104 + color: fuchsia; 1.105 + } 1.106 + 1.107 + .article-max-lines-demo { 1.108 + font: 1em/1.25 Times New Roman, Times, serif; 1.109 + white-space: nowrap; 1.110 + } 1.111 + .article-max-lines-demo.one::first-letter { 1.112 + font-size: 2em; 1.113 + line-height: 0.9; 1.114 + } 1.115 + .article-max-lines-demo.one { 1.116 + font-size: 1.5em; 1.117 + width: 16em; 1.118 + } 1.119 + .article-max-lines-demo.two { 1.120 + width: 11.5em; 1.121 + float: left; margin-right: 1em; 1.122 + } 1.123 + .article-max-lines-demo.three { 1.124 + width: 11.5em; 1.125 + float: left; 1.126 + } 1.127 + </style> 1.128 + 1.129 + <p> 1.130 + </p> 1.131 + 1.132 +<h2 id="intro"> 1.133 +Introduction</h2> 1.134 + 1.135 + <p> 1.136 + In CSS Level 1 [[CSS1]], placing more content than would fit 1.137 + inside an element with a specified size 1.138 + was generally an authoring error. 1.139 + Doing so caused the content to extend 1.140 + outside the bounds of the element, 1.141 + which would likely cause 1.142 + that content to overlap with other elements. 1.143 + </p> 1.144 + 1.145 + <p> 1.146 + CSS Level 2 [[CSS21]] introduced the 'overflow' property, 1.147 + which allows authors to have overflow be handled by scrolling, 1.148 + which means it is no longer an authoring error. 1.149 + It also allows authors to specify 1.150 + that overflow is handled by clipping, 1.151 + which makes sense when the author's intent 1.152 + is that the content not be shown. 1.153 + </p> 1.154 + 1.155 + <p> 1.156 + However, scrolling is not the only way 1.157 + to present large amounts of content, 1.158 + and may even not be the optimal way. 1.159 + After all, the codex replaced the scroll 1.160 + as the common format for large written works 1.161 + because of its advantages. 1.162 + </p> 1.163 + 1.164 + <p> 1.165 + This specification introduces 1.166 + a mechanism for Web pages to specify 1.167 + that an element of a page should handle overflow 1.168 + through pagination rather than through scrolling. 1.169 + </p> 1.170 + 1.171 + <p> 1.172 + This specification also extends the concept of overflow 1.173 + in another direction. 1.174 + Instead of requiring that authors specify a single area 1.175 + into which the content of an element must flow, 1.176 + this specification allows authors to specify multiple fragments, 1.177 + each with their own dimensions and styles, 1.178 + so that the content of the element can flow from one to the next, 1.179 + using as many as needed to place the content without overflowing. 1.180 + </p> 1.181 + 1.182 + <p> 1.183 + In both of these cases, implementations must 1.184 + break the content in the block-progression dimension. 1.185 + Implementations must do this is described 1.186 + in the CSS Fragmentation Module [[!CSS3-BREAK]]. 1.187 + </p> 1.188 + 1.189 +<h2 id="overflow-concepts">Types of overflow</h2> 1.190 + 1.191 + <p> 1.192 + CSS uses the term <dfn>overflow</dfn> to describe 1.193 + the contents of a box 1.194 + that extend outside that one of that box's edges 1.195 + (i.e., its <i>content edge</i>, <i>padding edge</i>, 1.196 + <i>border edge</i>, or <i>margin edge</i>). 1.197 + The overflow might be described as the elements or features 1.198 + that cause this overflow, 1.199 + the non-rectangular region occupied by these features, 1.200 + or, more commonly, 1.201 + as the minimal rectangle that bounds that region. 1.202 + A box's overflow is computed based on the boxes and styles 1.203 + of the box and of all its descendants whose containing block chain 1.204 + <span class="issue">undefined term?</span> 1.205 + includes the box. 1.206 + </p> 1.207 + 1.208 + <p> 1.209 + In most cases, any of these types of overflow 1.210 + can be computed for any box 1.211 + from the bounds and properties of that box, 1.212 + and from the overflow (of that type) 1.213 + of each of its children. 1.214 + However, this is not always the case; for example, 1.215 + when ''transform-style: preserve-3d'' [[CSS3-TRANSFORMS]] is used on 1.216 + some of the children, their descendants with 1.217 + ''transform-style: preserve-3d'' must also be examined. 1.218 + </p> 1.219 + 1.220 +<h3 id="ink-overflow">Ink overflow</h3> 1.221 + 1.222 + <p> 1.223 + The <dfn id="ink-overflow0">ink overflow</dfn> of a box 1.224 + is the part of that box and its contents that 1.225 + creates a visual effect outside of 1.226 + the box's border box. 1.227 + </p> 1.228 + 1.229 + <p> 1.230 + Since some effects in CSS (for example, the blurs in 1.231 + 'text-shadow' [[CSS3TEXT]] and 'box-shadow' [[CSS3BG]]) 1.232 + do not define what visual extent they cover, the extent 1.233 + of the <a>ink overflow</a> is undefined. 1.234 + </p> 1.235 + 1.236 + <p class="issue"> 1.237 + Should we try to define it at all and just leave pieces undefined? 1.238 + </p> 1.239 + 1.240 + <p> 1.241 + The <dfn>ink overflow region</dfn> is the non-rectangular region 1.242 + occupied by the <a>ink overflow</a>, and the 1.243 + <dfn>ink overflow rectangle</dfn> is 1.244 + the minimal rectangle whose axis is aligned to the box's axes 1.245 + and contains the <a>ink overflow region</a>. 1.246 + Note that the <a>ink overflow rectangle</a> is a rectangle 1.247 + in the box's coordinate system, but might be non-rectangular 1.248 + in other coordinate systems due to transforms [[CSS3-TRANSFORMS]]. 1.249 + </p> 1.250 + 1.251 +<h3 id="scrollable-overflow">Scrollable overflow</h3> 1.252 + 1.253 + <p> 1.254 + The <dfn id="scrollable-overflow0">scrollable overflow</dfn> of a box is the 1.255 + set of things extending outside of that box's padding edge 1.256 + for which a scrolling mechanism needs to be provided. 1.257 + </p> 1.258 + 1.259 + <p class="issue"> 1.260 + The following definition should be rewritten to use 1.261 + the concept of <a href="http://dev.w3.org/csswg/css-transforms/#3d-rendering-context">3D rendering context</a> [[!CSS3-TRANSFORMS]] 1.262 + and related terms, 1.263 + particularly once those concepts stabilize following changes 1.264 + proposed in the CSS WG meeting on the morning of 2014-01-28. 1.265 + </p> 1.266 + 1.267 + <p> 1.268 + Given the following definitions 1.269 + <span class="issue">which belong in [[CSS3-TRANSFORMS]]</span>: 1.270 + </p> 1.271 + 1.272 + <dl> 1.273 + <dt><dfn>3d-preserving child</dfn></dt> 1.274 + <dd> 1.275 + A child box B of a containing block C is a 3d-preserving 1.276 + child if it has ''transform-style: preserve-3d'' 1.277 + and the user-agent is not required to flatten it 1.278 + based on the <a href="http://www.w3.org/TR/css3-transforms/#transform-style-property">requirements</a> in [[!CSS3-TRANSFORMS]]. 1.279 + </dt> 1.280 + <dt><dfn>non-3d-preserving child</dfn></dt> 1.281 + <dd> 1.282 + A child C of a box P is a non-3d-preserving-child if 1.283 + it is not a <a>3d-preserving child</a>. 1.284 + </dd> 1.285 + <dt><dfn>3d-preserving descendant</dfn></dt> 1.286 + <dd> 1.287 + Box D is a 3d-preserving descendant of box A if A is 1.288 + an ancestor of D, and D and all of the boxes (if any) 1.289 + in the containing block chain from D to A 1.290 + are <a>3d-preserving child</a> boxes. 1.291 + </dd> 1.292 + </dl> 1.293 + 1.294 + <p>The scrollable overflow of a box is the union of the following things, 1.295 + all adjusted for transforms <span class="issue">undefined concept!</span> into the box's coordinate space:</p> 1.296 + 1.297 + <ul> 1.298 + <li> 1.299 + for the box and all of its <a>3d-preserving descendant</a> boxes: 1.300 + <ul> 1.301 + <li>the box's own padding edge (for the box itself) or border edge (for <a>3d-preserving descendant</a> boxes)</li> 1.302 + <li>the bounds <span class="issue">undefined term!</span> of any text directly in the box</li> 1.303 + <li><span class="issue">MORE HERE!</span> 1.304 + </ul> 1.305 + <li> 1.306 + for all the <a>non-3d-preserving child</a> boxes of the 1.307 + box and its <a>3d-preserving descendant</a> boxes, 1.308 + the scrollable overflow of the box 1.309 + </li> 1.310 + </ul> 1.311 + 1.312 + <p class="issue"> 1.313 + I wrote this definition off the top of my head, 1.314 + so it can't possibly be right. 1.315 + It's missing tons of pieces! 1.316 + </p> 1.317 + 1.318 + <p class="issue"> 1.319 + The handling of preserve-3d subtrees here is probably wrong; 1.320 + the elements should probably count 1.321 + only towards the overflow of the element that flattens them. 1.322 + </p> 1.323 + 1.324 + <p> 1.325 + The <dfn>scrollable overflow region</dfn> is the non-rectangular region 1.326 + occupied by the <a>scrollable overflow</a>, and the 1.327 + <dfn>scrollable overflow rectangle</dfn> is 1.328 + the minimal rectangle whose axis is aligned to the box's axes 1.329 + and contains the <a>scrollable overflow region</a>. 1.330 + Note that the <a>scrollable overflow rectangle</a> is a rectangle 1.331 + in the box's coordinate system, but might be non-rectangular 1.332 + in other coordinate systems due to transforms [[CSS3-TRANSFORMS]]. 1.333 + </p> 1.334 + 1.335 +<h3 id="border-box-overflow">Border box overflow</h3> 1.336 + 1.337 + <p class="issue"> 1.338 + This concept has been proposed for some uses, such as for 1.339 + determining what the 'outline' property goes around, and 1.340 + as the basis of a coordinate system for specifying clips and masks, 1.341 + but it's not clear if it's needed. 1.342 + </p> 1.343 + 1.344 + <p> 1.345 + The <dfn>border-box overflow</dfn> of a box is the 1.346 + union of the box's border edge and the border edges of 1.347 + the box's descendants.</p> 1.348 + </p> 1.349 + 1.350 + <p class="issue"> 1.351 + If needed, define more formally, as for scrollable overflow above. 1.352 + (Maybe even share the definitions in an appropriate way!) 1.353 + </p> 1.354 + 1.355 + <p> 1.356 + The <dfn>border-box overflow region</dfn> is the non-rectangular region 1.357 + occupied by the <a>border-box overflow</a>, and the 1.358 + <dfn>border-box overflow rectangle</dfn> is 1.359 + the minimal rectangle whose axis is aligned to the box's axes 1.360 + and contains the <a>border-box overflow region</a>. 1.361 + Note that the <a>border-box overflow rectangle</a> is a rectangle 1.362 + in the box's coordinate system, but might be non-rectangular 1.363 + in other coordinate systems due to transforms [[CSS3-TRANSFORMS]]. 1.364 + </p> 1.365 + 1.366 +<h2 id="overflow-properties">Overflow properties</h2> 1.367 + 1.368 + <p> 1.369 + The 'overflow-x' property specifies 1.370 + the handling of overflow in the horizontal direction 1.371 + (i.e., overflow from the left and right sides of the box), 1.372 + and the 'overflow-y' property specifies the handling 1.373 + of overflow in the vertical direction 1.374 + (i.e., overflow from the top and bottom sides of the box) 1.375 + </p> 1.376 + 1.377 + <table class=propdef> 1.378 + <tr> 1.379 + <th>Name: 1.380 + <td><dfn>overflow-x</dfn>, <dfn>overflow-y</dfn> 1.381 + <tr> 1.382 + <th>Value: 1.383 + <td>visible | hidden | scroll | auto | paged-x | paged-y | paged-x-controls | paged-y-controls | fragments 1.384 + <tr> 1.385 + <th>Initial: 1.386 + <td>visible 1.387 + <tr> 1.388 + <th>Applies to: 1.389 + <td>block containers [[!CSS21]], flex containers [[!CSS3-FLEXBOX]], and grid containers [[!CSS3-GRID-LAYOUT]] 1.390 + <tr> 1.391 + <th>Inherited: 1.392 + <td>no 1.393 + <tr> 1.394 + <th>Percentages: 1.395 + <td>N/A 1.396 + <tr> 1.397 + <th>Media: 1.398 + <td>visual 1.399 + <tr> 1.400 + <th>Computed value: 1.401 + <td>see below 1.402 + <tr> 1.403 + <th>Animatable: 1.404 + <td>no 1.405 + <tr> 1.406 + <th>Canonical order: 1.407 + <td><abbr title="follows order of property value definition">per grammar</abbr> 1.408 + </table> 1.409 + 1.410 + <p> 1.411 + The 'overflow' property is a shorthand property 1.412 + that sets the specified values of both 'overflow-x' and 'overflow-y' 1.413 + to the value specified for 'overflow'. 1.414 + </p> 1.415 + 1.416 + <table class=propdef> 1.417 + <tr> 1.418 + <th>Name: 1.419 + <td><dfn>overflow</dfn> 1.420 + <tr> 1.421 + <th>Value: 1.422 + <td>visible | hidden | scroll | auto | paged-x | paged-y | paged-x-controls | paged-y-controls | fragments 1.423 + <tr> 1.424 + <th>Initial: 1.425 + <td>see individual properties 1.426 + <tr> 1.427 + <th>Applies to: 1.428 + <td>block containers [[!CSS21]], flex containers [[!CSS3-FLEXBOX]], and grid containers [[!CSS3-GRID-LAYOUT]] 1.429 + <tr> 1.430 + <th>Inherited: 1.431 + <td>no 1.432 + <tr> 1.433 + <th>Percentages: 1.434 + <td>N/A 1.435 + <tr> 1.436 + <th>Media: 1.437 + <td>visual 1.438 + <tr> 1.439 + <th>Computed value: 1.440 + <td>see individual properties 1.441 + <tr> 1.442 + <th>Animatable: 1.443 + <td>no 1.444 + <tr> 1.445 + <th>Canonical order: 1.446 + <td><abbr title="follows order of property value definition">per grammar</abbr> 1.447 + </table> 1.448 + 1.449 + <p>The values of these properties are:</p> 1.450 + 1.451 + <dl dfn-for="overflow" dfn-type="value"> 1.452 + <dt><dfn>visible</dfn> 1.453 + <dd> 1.454 + There is no special handling of overflow, that is, it 1.455 + may be rendered outside the block container. 1.456 + </dd> 1.457 + <dt><dfn>hidden</dfn> 1.458 + <dt><dfn>scroll</dfn> 1.459 + <dt><dfn>auto</dfn> 1.460 + <dd> 1.461 + These values are collectively the <dfn dfn>scrolling values</dfn>; 1.462 + they are defined in the section on 1.463 + <a href="#scrolling-overflow">scrolling and hidden overflow</a>. 1.464 + </dd> 1.465 + <dt><dfn>paged-x</dfn> 1.466 + <dt><dfn>paged-y</dfn> 1.467 + <dt><dfn>paged-x-controls</dfn> 1.468 + <dt><dfn>paged-y-controls</dfn> 1.469 + <dt><dfn>fragments</dfn> 1.470 + <dd> 1.471 + These values are collectively the <dfn dfn>fragmenting values</dfn>; 1.472 + they are defined in the sections on 1.473 + <a href="#paginated-overflow">paginated overflow</a> and 1.474 + <a href="#fragment-overflow">fragment overflow</a>. 1.475 + </dd> 1.476 + </dl> 1.477 + 1.478 + <div id="overflow-computed-values"> 1.479 + <p>The computed values of 'overflow-x' and 'overflow-y' 1.480 + are determined from the cascaded values [[!CSS3CASCADE]] 1.481 + based on the following rules:</p> 1.482 + 1.483 + <ol> 1.484 + <li> 1.485 + If one or both of the cascaded values are 1.486 + <a>fragmenting values</a>, then: 1.487 + <ol> 1.488 + <li> 1.489 + If one of the cascaded values is one of the 1.490 + <a>fragmenting values</a> 1.491 + and the other is not, 1.492 + then the computed values are 1.493 + the same as the cascaded values. 1.494 + </li> 1.495 + <li> 1.496 + If both of the cascaded values are <a>fragmenting values</a>, then: 1.497 + <ol> 1.498 + <li> 1.499 + for horizontal writing mode [[!CSS3-WRITING-MODES]], 1.500 + the computed value for 'overflow-y' is the cascaded value 1.501 + and the computed value for 'overflow-x' is ''overflow/hidden'', or 1.502 + </li> 1.503 + <li> 1.504 + for vertical writing mode [[!CSS3-WRITING-MODES]], 1.505 + the computed value for 'overflow-x' is the cascaded value 1.506 + and the computed value for 'overflow-y' is ''overflow/hidden''. 1.507 + </li> 1.508 + </ol> 1.509 + </li> 1.510 + </ol> 1.511 + </li> 1.512 + <li> 1.513 + Otherwise, if one cascaded values is 1.514 + one of the <a>scrolling values</a> 1.515 + and the other is ''overflow/visible'', 1.516 + then computed values are the cascaded values 1.517 + with ''overflow/visible'' changed to ''overflow/auto''. 1.518 + </li> 1.519 + <li> 1.520 + Otherwise, the computed values are as specified. 1.521 + </li> 1.522 + </ol> 1.523 + </div> 1.524 + 1.525 + <p class="issue"> 1.526 + Are all 4 of the ''paged-*'' values really needed? 1.527 + </p> 1.528 + 1.529 + <p> 1.530 + When the <a>fragmenting values</a> are used, 1.531 + the overflow from the fragments themselves 1.532 + treats the fragmenting value as ''overflow/hidden''. 1.533 + <span class="issue">Is this the right behavior?</span> 1.534 + <span class="issue">Give example.</span> 1.535 + </p> 1.536 + 1.537 + <p class="issue"> 1.538 + [[CSS3-MARQUEE]] describes an 'overflow-style' property, 1.539 + but it has not picked up implementation experience 1.540 + that the working group is aware of. 1.541 + Should this document treat 'overflow-style' as a defunct proposal, 1.542 + or should this document describe the 'overflow-style' property 1.543 + and attempt to revive it, 1.544 + despite that implementations have implemented 1.545 + 'overflow-x' and 'overflow-y' instead? 1.546 + </p> 1.547 + 1.548 + <p class="issue"> 1.549 + There are <a href="http://lists.w3.org/Archives/Public/www-style/2012May/1197.html">discussions</a> 1.550 + about how overflow, overflow-style, overflow-x and overflow-y 1.551 + should work and interact with each other. 1.552 + Until consensus on this topic is reached, 1.553 + it is not completely clear which of these 1.554 + should be used for 1.555 + paged-x | paged-y | paged-x-controls | paged-y-controls | fragments 1.556 + </p> 1.557 + 1.558 +<h2 id="scrolling-overflow">Scrolling and hidden overflow</h2> 1.559 + 1.560 + <p class="issue"> 1.561 + Move material from [[CSS21]] and [[CSS3BOX]] here. 1.562 + </p> 1.563 + 1.564 + <p class="issue"> 1.565 + Explain which directions allow scrolling and which don't, 1.566 + as a function of 'direction' 1.567 + (including propagation of 'direction' to the ICB). 1.568 + </p> 1.569 + 1.570 +<h2 id="paginated-overflow">Paginated overflow</h2> 1.571 + 1.572 +<p class="issue">overflow:paginate or overflow:pages (or paged-x, paged-y, paged-x-controls, paged-y-controls as [[CSS3GCPM]] has?)</p> 1.573 + 1.574 +<p class="issue">Ability to display N pages at once 1.575 +rather than just one page at once?</p> 1.576 + 1.577 + <p class="issue"> 1.578 + The current implementation of paginated overflow uses 1.579 + the 'overflow'/'overflow-x'/'overflow-y' properties 1.580 + rather than the 'overflow-style' property as proposed 1.581 + in the [[CSS3GCPM]] draft 1.582 + (which also matches the [[CSS3-MARQUEE]] proposal). 1.583 + We should probably switch away from 'overflow-style', 1.584 + but that's not 100% clear. 1.585 + </p> 1.586 + 1.587 +<h2 id="fragment-overflow">Fragment overflow</h2> 1.588 + 1.589 + <p> 1.590 + This section introduces and defines the meaning of 1.591 + the new ''fragments'' value of the 'overflow' property. 1.592 + </p> 1.593 + 1.594 + <p> 1.595 + When the computed value of 'overflow' for an element is ''fragments'', 1.596 + and implementations would otherwise have created a box for the element, 1.597 + then implementations must create a sequence of <dfn>fragment box</dfn>es 1.598 + for that element. 1.599 + (It is possible for an element with ''overflow: fragments'' 1.600 + to generate only one <a>fragment box</a>. 1.601 + However, if an element's computed 'overflow' is not ''fragments'', 1.602 + then its box is not a <a>fragment box</a>.) 1.603 + Every <a>fragment box</a> is a fragmentation container, 1.604 + and any overflow 1.605 + that would cause that fragmentation container to fragment 1.606 + causes another <a>fragment box</a> created as a next sibling 1.607 + of the previous one. 1.608 + <span class="issue">Or is it as though it's a next sibling of 1.609 + the element? Need to figure out exactly how this interacts with 1.610 + other box-level fixup.</span> 1.611 + Additionally, if the <a>fragment box</a> is also 1.612 + a multi-column box (as defined in [[!CSS3COL]] 1.613 + <span class="issue">though it defines <i>multi-column element</i></span>) 1.614 + any content that would lead to the creation of <a>overflow columns</a> [[!CSS3COL]] 1.615 + instead is flown into an additional fragment box. 1.616 + However, fragment boxes may themselves be broken 1.617 + (due to fragmentation in a fragmentation context outside of them, 1.618 + such as pages, columns, or other fragment boxes); 1.619 + such breaking leads to fragments of the same fragment box 1.620 + rather than multiple fragment boxes. 1.621 + (This matters because fragment boxes may be styled by their index; 1.622 + such breaking leads to multiple fragments of a fragment box 1.623 + with a single index. 1.624 + This design choice is so that 1.625 + breaking a fragment box across pages does not break 1.626 + the association of indices to particular pieces of content.) 1.627 + <span class="issue">Should a forced break that breaks to 1.628 + an outer fragmentation context cause a new fragment of a single 1.629 + fragment box or a new fragment box?</span> 1.630 + <span class="issue">Should we find a term other than 1.631 + <a>fragment box</a> here to make this a little less confusing?</span> 1.632 + </p> 1.633 + 1.634 + <p class="issue"> 1.635 + What if we want to be able to style the pieces of an element 1.636 + split within another type of fragmentation context? 1.637 + These rules prevent ever using ''::nth-fragment()'' for that, 1.638 + despite that the name seems the most logical name for such a feature. 1.639 + </p> 1.640 + 1.641 + <div class="example"> 1.642 + <table class="source-demo-pair"><tr><td><pre><!DOCTYPE HTML> 1.643 +<title>Breaking content into 1.644 + equal-sized cards</title> 1.645 +<style> 1.646 + .in-cards { 1.647 + overflow: fragments; 1.648 + 1.649 + width: 13em; 1.650 + height: 8em; 1.651 + 1.652 + padding: 4px; 1.653 + border: medium solid blue; 1.654 + margin: 6px; 1.655 + 1.656 + font: medium/1.3 Times New 1.657 + Roman, Times, serif; 1.658 + } 1.659 +</style> 1.660 +<div class="in-cards"> 1.661 + In this example, the text in the div 1.662 + is broken into a series of cards. 1.663 + These cards all have the same style. 1.664 + The presence of enough content to 1.665 + overflow one of the cards causes 1.666 + another one to be created. The second 1.667 + card is created just like it's the 1.668 + next sibling of the first. 1.669 +</div></pre></td><td> 1.670 + <div class="in-cards-demo">In this example, the text in the<br>div is broken into a series of<br>cards. These cards all have the<br>same style. The presence of<br>enough content to overflow<br>one of the cards causes another</div> 1.671 + <div class="in-cards-demo">one to be created. The second<br>card is created just like it's the<br>next sibling of the first.</div> 1.672 + </td></tr></table> 1.673 + </div> 1.674 + 1.675 + <p class="issue"> 1.676 + We should specify that ''overflow: fragments'' does not apply 1.677 + to at least some table parts, 1.678 + and perhaps other elements as well. 1.679 + We need to determine exactly which ones. 1.680 + </p> 1.681 + 1.682 + <p class="issue"> 1.683 + This specification needs to say which type of 1.684 + fragmentation context is created 1.685 + so that it's clear which values of the 'break-*' properties 1.686 + cause breaks within this context. 1.687 + We probably want ''break-*: region'' to apply. 1.688 + </p> 1.689 + 1.690 + <p class="issue"> 1.691 + This specification needs a processing model 1.692 + that will apply in cases where the layout containing the 1.693 + fragments has characteristics that use the intrinsic size of the fragments 1.694 + to change the amount of space available for them, 1.695 + such as [[CSS3-GRID-LAYOUT]]. 1.696 + There has already been some work on such a processing model 1.697 + in [[CSS3-REGIONS]], 1.698 + and the work done on a model there, 1.699 + and the editors of that specification, 1.700 + should inform what happens in this specification. 1.701 + </p> 1.702 + 1.703 +<h3 id="fragment-styling">Fragment styling</h3> 1.704 + 1.705 +<h4 id="fragment-pseudo-element">The ::nth-fragment() pseudo-element</h4> 1.706 + 1.707 + <p> 1.708 + The ::nth-fragment() pseudo-element is a pseudo-element 1.709 + that describes some of the <a>fragment box</a>es generated by an element. 1.710 + The argument to the pseudo-element takes the same syntax 1.711 + as the argument to the :nth-child() pseudo-class 1.712 + defined in [[!SELECT]], and has the same meaning 1.713 + except that the number is relative to 1.714 + <a>fragment box</a>es generated by the element 1.715 + instead of siblings of the element. 1.716 + </p> 1.717 + 1.718 + <p class="note"> 1.719 + Selectors that allow addressing fragments 1.720 + by counting from the end rather than the start 1.721 + are intentionally not provided. 1.722 + Such selectors would interfere with determining 1.723 + the number of fragments. 1.724 + </p> 1.725 + 1.726 + <p class="issue"> 1.727 + Depending on future discussions, 1.728 + this ''::nth-fragment(<var>an+b</var>)'' syntax 1.729 + may be replaced with 1.730 + the new ''::fragment:nth(<var>an+b</var>)'' syntax. 1.731 + </p> 1.732 + 1.733 +<h4 id="style-of-fragments">Styling of fragments</h4> 1.734 + 1.735 + <p class="issue"> 1.736 + Should this apply to fragment overflow only, 1.737 + or also to paginated overflow? 1.738 + (If it applies, 1.739 + then stricter property restrictions would be needed 1.740 + for paginated overflow.) 1.741 + </p> 1.742 + 1.743 + <p> 1.744 + In the absence of rules with ''::nth-fragment()'' pseudo-elements, 1.745 + the computed style for each <a>fragment box</a> 1.746 + is the computed style for the element 1.747 + for which the <a>fragment box</a> was created. 1.748 + However, the style for a <a>fragment box</a> is also influenced 1.749 + by rules whose selector's <a>subject</a> [[!SELECT]] 1.750 + has an ''::nth-fragment()'' pseudo-element, 1.751 + if the 1-based number of the <a>fragment box</a> matches 1.752 + that ''::nth-fragment()'' pseudo-element 1.753 + and the selector (excluding the ''::nth-fragment()'' pseudo-element) 1.754 + matches the element generating the fragments. 1.755 + </p> 1.756 + 1.757 + <p> 1.758 + When determining the style of the <a>fragment box</a>, 1.759 + these rules that match the fragment pseudo-element 1.760 + cascade together with the rules that match the element, 1.761 + with the fragment pseudo-element adding the specificity 1.762 + of a pseudo-class to the specificity calculation. 1.763 + <span class="issue">Does this need to be specified in 1.764 + the cascading module as well?</span> 1.765 + </p> 1.766 + 1.767 + <div class="example"> 1.768 + <table class="source-demo-pair"><tr><td><pre><!DOCTYPE HTML> 1.769 +<style> 1.770 + .bouncy-columns { 1.771 + overflow: fragments; 1.772 + width: 6em; 1.773 + height: 10em; 1.774 + float: left; 1.775 + margin: 1em; 1.776 + font: medium/1.25 Times New 1.777 + Roman, Times, serif; 1.778 + } 1.779 + .bouncy-columns::nth-fragment(1) { 1.780 + background: aqua; color: black; 1.781 + transform: rotate(-3deg); 1.782 + } 1.783 + .bouncy-columns::nth-fragment(2) { 1.784 + background: yellow; color: black; 1.785 + transform: rotate(3deg); 1.786 + } 1.787 +</style> 1.788 +<div class="bouncy-columns"> 1.789 + <i>...</i> 1.790 +</div></pre></td><td> 1.791 + <div class="bouncy-columns-demo one">In this<br>example, the<br>text in the div<br>is broken into<br>a series of<br>columns. The<br>author<br>probably</div> 1.792 + <div class="bouncy-columns-demo two">intended the<br>text to fill two<br>columns. But<br>if it happens to<br>fill three<br>columns, the<br>third column is<br>still created. It</div> 1.793 + <div class="bouncy-columns-demo">just doesn't<br>have any<br>fragment-specific<br>styling because<br>the author<br>didn't give it<br>any.</div> 1.794 + </td></tr></table> 1.795 + </div> 1.796 + 1.797 + <p> 1.798 + Styling an ''::nth-fragment()'' pseudo-element with the 'overflow' 1.799 + property does take effect; 1.800 + if a <a>fragment box</a> has a 1.801 + computed value of 'overflow' other than ''fragments'' 1.802 + then that fragment box is the last fragment. 1.803 + However, overriding 'overflow' on the first fragment 1.804 + does not cause the <a>fragment box</a> not to exist; 1.805 + whether there are fragment boxes at all is determined by 1.806 + the computed value of overflow for the element. 1.807 + <span class="issue">Need to reword this to refer to the 1.808 + appropriate choice of 'overflow-x' or 'overflow-y', 1.809 + and then point to rule about the handling of the other one 1.810 + of 'overflow-x' or 'overflow-y'.</span> 1.811 + </p> 1.812 + 1.813 + <p> 1.814 + Styling an ''::nth-fragment()'' pseudo-element with the 'content' 1.815 + property has no effect; 1.816 + the computed value of 'content' for the fragment box 1.817 + remains the same as the computed value of content for the element. 1.818 + </p> 1.819 + 1.820 + <p> 1.821 + Specifying ''display: none'' for a <a>fragment box</a> causes 1.822 + the fragment box with that index not to be generated. 1.823 + However, in terms of the indices 1.824 + used for matching ''::nth-fragment()'' pseudo-elements 1.825 + of later fragment boxes, 1.826 + it still counts as though it was generated. 1.827 + However, since it is not generated, it does not contain any content. 1.828 + </p> 1.829 + 1.830 + <p> 1.831 + Specifying other values of 'display', 'position', 1.832 + or 'float' is permitted, but is not allowed to change 1.833 + the computed value of 'display-inside'. 1.834 + (Since 'overflow', 'overflow-x', and 'overflow-y' only 1.835 + apply to block containers, flex containers, and grid containers 1.836 + the computed value of 'display-inside' is always 1.837 + ''display-inside/block'', ''display-inside/flex'', or 1.838 + ''display-inside/grid''. 1.839 + <span class="issue">Need to specify exactly how this works, 1.840 + but it depends on 1.841 + having 'display-inside' and 'display-outside' specified.</span> 1.842 + </p> 1.843 + 1.844 + <p> 1.845 + To match the model for other pseudo-elements 1.846 + where the pseudo-elements live inside their corresponding element, 1.847 + declarations in ''::nth-fragment()'' pseudo-elements override 1.848 + declarations in rules without the pseudo-element. 1.849 + The relative priority within such declarations is determined 1.850 + by normal cascading order (see [[!CSS21]]). 1.851 + </p> 1.852 + 1.853 + <p> 1.854 + Styles specified on ''::nth-fragment()'' pseudo-elements 1.855 + do affect inheritance to content within the <a>fragment box</a>. 1.856 + In other words, the content within the <a>fragment box</a> must 1.857 + inherit from the fragment box's style (i.e., the pseudo-element style) 1.858 + rather than directly from the element. 1.859 + This means that elements split between fragment boxes may 1.860 + have different styles for different parts of the element. 1.861 + </p> 1.862 + 1.863 + <p class="issue"> 1.864 + This inheritance rule allows specifying styles indirectly 1.865 + (by using explicit ''inherit'' or using default inheritance 1.866 + on properties that don't apply to '':first-letter'') 1.867 + that can't be specified directly 1.868 + (based on the rules in the next section). 1.869 + This is a problem. 1.870 + The restrictions that apply to styling inside fragments 1.871 + should also apply to inheritance from fragments. 1.872 + </p> 1.873 + 1.874 + <div class="example"> 1.875 + <table class="source-demo-pair"><tr><td><pre><!DOCTYPE HTML> 1.876 +<style> 1.877 + .article { 1.878 + overflow: fragments; 1.879 + } 1.880 + .article::nth-fragment(1) { 1.881 + font-size: 1.5em; 1.882 + margin-bottom: 1em; 1.883 + height: 4em; 1.884 + } 1.885 + .article::nth-fragment(2) { 1.886 + margin-left: 5em; 1.887 + margin-right: 2em; 1.888 + } 1.889 +</style> 1.890 +<div class="article"> 1.891 + The <code>font-size</code> property<i>...</i> 1.892 +</div></pre></td><td> 1.893 + <div class="article-font-inherit-demo one">The <code>font-size</code> property<br>specified on the fragment<br>is inherited into the</div> 1.894 + <div class="article-font-inherit-demo two">descendants of the fragment.<br>This means that inherited<br>properties can be used<br>reliably on a fragment, as in<br>this example.</div> 1.895 + </td></tr></table> 1.896 + </div> 1.897 + 1.898 +<h4 id="style-in-fragments">Styling inside fragments</h4> 1.899 + 1.900 + <p class="issue"> 1.901 + Should this apply to fragment overflow only, 1.902 + or also to paginated overflow, 1.903 + or even to pagination across pages? 1.904 + </p> 1.905 + 1.906 + <p> 1.907 + The ''::nth-fragment()'' pseudo-element 1.908 + can also be used to style 1.909 + content inside of a <a>fragment box</a>. 1.910 + Unlike the ''::first-line'' and ''::first-letter'' pseudo-elements, 1.911 + the ''::nth-fragment()'' pseudo-element can be applied 1.912 + to parts of the selector other than the subject: 1.913 + in particular, it can match ancestors of the subject. 1.914 + However, the only CSS properties applied 1.915 + by rules with such selectors 1.916 + are those that apply 1.917 + to the ''::first-letter'' pseudo-element. 1.918 + </p> 1.919 + 1.920 + <p> 1.921 + To be more precise, 1.922 + when a rule's selector has ''::nth-fragment()'' pseudo-elements 1.923 + attached to parts of the selector other than the subject, 1.924 + the declarations in that rule apply to 1.925 + a fragment (or pseudo-element thereof) when: 1.926 + </p> 1.927 + <ol> 1.928 + <li> 1.929 + the declarations are for properties that apply to the 1.930 + ''::first-letter'' pseudo-element, 1.931 + </li> 1.932 + <li> 1.933 + the declarations would apply to 1.934 + that fragment (or pseudo-element thereof) 1.935 + had those ''::nth-fragment()'' pseudo-elements been removed, 1.936 + with a particular association between 1.937 + each sequence of simple selectors and the element it matched, 1.938 + and 1.939 + </li> 1.940 + <li> 1.941 + for each removed ''::nth-fragment()'' pseudo-element, 1.942 + the fragment lives within a <a>fragment box</a> 1.943 + of the element associated in that association 1.944 + with the selector that the pseudo-element was attached to, 1.945 + and whose index matches the pseudo-element. 1.946 + </li> 1.947 + </ol> 1.948 + 1.949 + <div class="example"> 1.950 + <table class="source-demo-pair"><tr><td><pre><!DOCTYPE HTML> 1.951 +<style> 1.952 + .dark-columns { 1.953 + overflow: fragments; 1.954 + width: 6em; 1.955 + height: 10em; 1.956 + float: left; 1.957 + margin-right: 1em; 1.958 + font: medium/1.25 Times New 1.959 + Roman, Times, serif; 1.960 + } 1.961 + .dark-columns::nth-fragment(1) { 1.962 + background: aqua; color: black; 1.963 + } 1.964 + .dark-columns::nth-fragment(1) :link { 1.965 + color: blue; 1.966 + } 1.967 + .dark-columns::nth-fragment(1) :visited { 1.968 + color: purple; 1.969 + } 1.970 + .dark-columns::nth-fragment(2) { 1.971 + background: navy; color: white; 1.972 + } 1.973 + .dark-columns::nth-fragment(2) :link { 1.974 + color: aqua; 1.975 + } 1.976 + .dark-columns::nth-fragment(2) :visited { 1.977 + color: fuchsia; 1.978 + } 1.979 +</style> 1.980 +<div class="dark-columns"> 1.981 + <i>...</i> 1.982 +</div></pre></td><td> 1.983 + <div class="dark-columns-demo one">In this<br><a href="http://en.wiktionary.org/wiki/example">example</a>, the<br>text flows<br>from one<br>light-colored<br>fragment into<br>another<br>dark-colored</div> 1.984 + <div class="dark-columns-demo two">fragment. We<br>therefore want<br>different styles<br>for <a href="http://www.w3.org/Provider/Style/IntoContext.html">hyperlinks</a><br>in the different<br>fragments.</div> 1.985 + </td></tr></table> 1.986 + </div> 1.987 + 1.988 + 1.989 +<h3 id="max-lines">The 'max-lines' property</h3> 1.990 + 1.991 + <p> 1.992 + Authors may wish to style the opening lines of an element 1.993 + with different styles 1.994 + by putting those opening lines in a separate fragment. 1.995 + However, since it may be difficult to predict the exact height 1.996 + occupied by those lines 1.997 + in order to restrict the first fragment to that height, 1.998 + this specification introduces a 'max-lines' property 1.999 + that forces a fragment to break 1.1000 + after a specified number of lines. 1.1001 + This forces a break after the given number of lines 1.1002 + contained within the element or its descendants, 1.1003 + as long as those lines are in the same block formatting context. 1.1004 + </p> 1.1005 + 1.1006 + <table class=propdef> 1.1007 + <tr> 1.1008 + <th>Name: 1.1009 + <td><dfn>max-lines</dfn> 1.1010 + <tr> 1.1011 + <th>Value: 1.1012 + <td>none | <integer> 1.1013 + <tr> 1.1014 + <th>Initial: 1.1015 + <td>none 1.1016 + <tr> 1.1017 + <th>Applies to: 1.1018 + <td>fragment boxes 1.1019 + <tr> 1.1020 + <th>Inherited: 1.1021 + <td>no 1.1022 + <tr> 1.1023 + <th>Animatable: 1.1024 + <td>as <a href="http://www.w3.org/TR/css3-transitions/#animatable-types">integer</a> 1.1025 + <tr> 1.1026 + <th>Percentages: 1.1027 + <td>N/A 1.1028 + <tr> 1.1029 + <th>Media: 1.1030 + <td>visual 1.1031 + <tr> 1.1032 + <th>Computed value: 1.1033 + <td>specified value 1.1034 + <tr> 1.1035 + <th>Canonical order: 1.1036 + <td><abbr title="follows order of property value definition">per grammar</abbr> 1.1037 + </table> 1.1038 + 1.1039 + <dl dfn-for="max-lines" dfn-type="value"> 1.1040 + <dt><dfn>none</dfn> 1.1041 + <dd> 1.1042 + <p> 1.1043 + Breaks occur only as specified elsewhere. 1.1044 + </p> 1.1045 + </dd> 1.1046 + 1.1047 + <dt><dfn><integer></dfn> 1.1048 + <dd> 1.1049 + <p> 1.1050 + In addition to any breaks specified elsewhere, 1.1051 + a break is forced before any line that would exceed 1.1052 + the given number of lines 1.1053 + being placed inside the element 1.1054 + (excluding lines that are in 1.1055 + a different block formatting context from 1.1056 + the block formatting context to which 1.1057 + an unstyled child of the element would belong). 1.1058 + </p> 1.1059 + 1.1060 + <p class="issue"> 1.1061 + If there are multiple boundaries between this line 1.1062 + and the previous, where exactly (in terms of element 1.1063 + boundaries) is the break forced? 1.1064 + </p> 1.1065 + 1.1066 + <p> 1.1067 + Only positive integers are accepted. 1.1068 + Zero or negative integers are a parse error. 1.1069 + </p> 1.1070 + </dd> 1.1071 + </dl> 1.1072 + 1.1073 +<p class="issue">Should this apply to fragment overflow only, or also 1.1074 +to pagination?</p> 1.1075 + 1.1076 + <div class="example"> 1.1077 + <table class="source-demo-pair"><tr><td><pre><!DOCTYPE HTML> 1.1078 +<style> 1.1079 + .article { 1.1080 + overflow: fragments; 1.1081 + } 1.1082 + .article::first-letter { 1.1083 + font-size: 2em; 1.1084 + line-height: 0.9; 1.1085 + } 1.1086 + .article::nth-fragment(1) { 1.1087 + font-size: 1.5em; 1.1088 + max-lines: 3; 1.1089 + } 1.1090 + .article::nth-fragment(2) { 1.1091 + column-count: 2; 1.1092 + } 1.1093 +</style> 1.1094 +<div class="article"> 1.1095 + <i>...</i> 1.1096 +</div></pre></td><td> 1.1097 + <div class="article-max-lines-demo one">The max-lines property allows<br>authors to use a larger font for the first<br>few lines of an article. Without the</div> 1.1098 + <div class="article-max-lines-demo two">max-lines property, authors<br>might have to use the<br>'height' property instead, but<br>that would leave a slight gap<br>if the author miscalculated<br>how much height a given<br>number of lines would<br>occupy (which might be</div> 1.1099 + <div class="article-max-lines-demo three">particularly hard if the author<br>didn't know what text would<br>be filling the space, exactly<br>what font would be used, or<br>exactly which platform's font<br>rendering would be used to<br>display the font).</div> 1.1100 + </td></tr></table> 1.1101 + </div> 1.1102 + 1.1103 +<h2 id="static-media">Overflow in static media</h2> 1.1104 + 1.1105 + <p class="issue"> 1.1106 + This specification should define useful behavior 1.1107 + for all values of 'overflow' 1.1108 + in static media (such as print). 1.1109 + Current implementation behavior is quite poor and 1.1110 + produces unexpected results when authors have not considered 1.1111 + what will happen when 1.1112 + the content they produce for interactive media 1.1113 + is printed. 1.1114 + </p> 1.1115 + 1.1116 +<h2 class=no-num id="acknowledgments"> 1.1117 +Acknowledgments</h2> 1.1118 + 1.1119 + <p> 1.1120 + Thanks especially to the feedback from 1.1121 + Rossen Atanassov, 1.1122 + Bert Bos, 1.1123 + Tantek Ãelik, 1.1124 + John Daggett, 1.1125 + fantasai, 1.1126 + Daniel Glazman, 1.1127 + Vincent Hardy, 1.1128 + Håkon Wium Lie, 1.1129 + Peter Linss, 1.1130 + Robert O'Callahan, 1.1131 + Florian Rivoal, 1.1132 + Alan Stearns, 1.1133 + Steve Zilles, 1.1134 + and all the rest of the 1.1135 + <a href="http://lists.w3.org/Archives/Public/www-style/">www-style</a> community. 1.1136 + </p>