css-overflow/Overview.bs

Tue, 27 Jan 2015 15:56:33 -0800

author
L. David Baron <[email protected]>
date
Tue, 27 Jan 2015 15:56:33 -0800
changeset 15115
78c5e55ca9b7
parent 15114
css-overflow/Overview.src.html@d17b5de417e2
child 15116
62a63b65c530
permissions
-rw-r--r--

[css-overflow] Convert css-overflow to bikeshed preprocessor.

dbaron@15115 1 <h1>CSS Overflow Module Level 3</h1>
dbaron@15115 2 <pre class="metadata">
dbaron@15115 3 Status: ED
dbaron@15115 4 ED: http://dev.w3.org/csswg/css-overflow/
dbaron@15115 5 Shortname: css-overflow
dbaron@15115 6 Group: csswg
dbaron@15115 7 Level: 1
dbaron@15115 8 TR: http://www.w3.org/TR/css-overflow-3/
dbaron@15115 9 Previous version: http://www.w3.org/TR/2013/WD-css-overflow-3-20130418/
dbaron@15115 10 Editor: L. David Baron, Mozilla, http://dbaron.org/
dbaron@15115 11 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.
dbaron@15115 12 Status Text: The following features are at risk: &hellip;
dbaron@15115 13 !Change Log: <a href="https://dvcs.w3.org/hg/csswg/log/tip/css-overflow/Overview.bs">from 27 January 2015 to the present</a>
dbaron@15115 14 !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>
dbaron@15115 15 !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>
dbaron@15115 16 </pre>
dbaron@15115 17 <pre class="link-defaults">
dbaron@15115 18 spec:css-transforms-1; type:property; text:transform-style
dbaron@15115 19 </pre>
dbaron@15115 20 <!-- FIXME: the break-* link doesn't actually work! -->
dbaron@15115 21 <pre class="anchors">
dbaron@15115 22 url: http://www.w3.org/TR/2008/CR-css3-marquee-20081205/#the-overflow-style; type: property; text: overflow-style;
dbaron@15115 23 url: http://dev.w3.org/csswg/css-break/#breaking-controls; type: property; text: break-*;
dbaron@15115 24 url: http://dev.w3.org/csswg/css-multicol/#overflow-columns; type: dfn; text: overflow columns;
dbaron@15115 25 url: http://dev.w3.org/csswg/selectors-3/#subject; type: dfn; text: subject;
dbaron@15115 26 </pre>
dbaron@6475 27 <style>
dbaron@6477 28 table.source-demo-pair {
dbaron@6477 29 width: 100%;
dbaron@6477 30 }
dbaron@6481 31
dbaron@6475 32 .in-cards-demo {
dbaron@6475 33 width: 13em;
dbaron@6475 34 height: 8em;
dbaron@6475 35
dbaron@6475 36 padding: 4px;
dbaron@6475 37 border: medium solid blue;
dbaron@6475 38 margin: 6px;
dbaron@6475 39
dbaron@6475 40 font: medium/1.3 Times New Roman, Times, serif;
dbaron@6475 41 white-space: nowrap;
dbaron@6475 42 }
dbaron@6481 43
dbaron@6477 44 .bouncy-columns-demo {
dbaron@6477 45 width: 6em;
dbaron@6477 46 height: 10em;
dbaron@6477 47 float: left;
dbaron@6477 48 margin: 1em;
dbaron@6477 49 font: medium/1.25 Times New Roman, Times, serif;
dbaron@6477 50 white-space: nowrap;
dbaron@6477 51 }
dbaron@6477 52 .bouncy-columns-demo.one {
dbaron@6477 53 background: aqua; color: black;
dbaron@6477 54 transform: rotate(-3deg);
dbaron@6477 55 }
dbaron@6477 56 .bouncy-columns-demo.two {
dbaron@6477 57 background: yellow; color: black;
dbaron@6477 58 transform: rotate(3deg);
dbaron@6477 59 }
dbaron@6479 60
dbaron@6480 61 .article-font-inherit-demo {
dbaron@6480 62 font: 1em/1.25 Times New Roman, Times, serif;
dbaron@6480 63 white-space: nowrap;
dbaron@6480 64 }
dbaron@6480 65 .article-font-inherit-demo.one {
dbaron@6480 66 width: 12em;
dbaron@6480 67 font-size: 1.5em;
dbaron@6480 68 margin-bottom: 1em;
dbaron@6480 69 height: 4em;
dbaron@6480 70 }
dbaron@6480 71 .article-font-inherit-demo.two {
dbaron@6480 72 width: 11em;
dbaron@6480 73 margin-left: 5em;
dbaron@6480 74 margin-right: 2em;
dbaron@6480 75 }
dbaron@6480 76
dbaron@6481 77 .dark-columns-demo {
dbaron@6481 78 width: 6em;
dbaron@6481 79 height: 10em;
dbaron@6481 80 float: left;
dbaron@6481 81 margin-right: 1em;
dbaron@6481 82 font: medium/1.25 Times New Roman, Times, serif;
dbaron@6481 83 white-space: nowrap;
dbaron@6481 84 }
dbaron@6481 85 .dark-columns-demo.one {
dbaron@6481 86 background: aqua; color: black;
dbaron@6481 87 }
dbaron@6481 88 .dark-columns-demo.one :link {
dbaron@6481 89 color: blue;
dbaron@6481 90 }
dbaron@6481 91 .dark-columns-demo.one :visited {
dbaron@6481 92 color: purple;
dbaron@6481 93 }
dbaron@6481 94 .dark-columns-demo.two {
dbaron@6481 95 background: navy; color: white;
dbaron@6481 96 }
dbaron@6481 97 .dark-columns-demo.two :link {
dbaron@6481 98 color: aqua;
dbaron@6481 99 }
dbaron@6481 100 .dark-columns-demo.two :visited {
dbaron@6481 101 color: fuchsia;
dbaron@6481 102 }
dbaron@6481 103
dbaron@6479 104 .article-max-lines-demo {
dbaron@6479 105 font: 1em/1.25 Times New Roman, Times, serif;
dbaron@6479 106 white-space: nowrap;
dbaron@6479 107 }
dbaron@6479 108 .article-max-lines-demo.one::first-letter {
dbaron@6479 109 font-size: 2em;
dbaron@6479 110 line-height: 0.9;
dbaron@6479 111 }
dbaron@6479 112 .article-max-lines-demo.one {
dbaron@6479 113 font-size: 1.5em;
dbaron@6479 114 width: 16em;
dbaron@6479 115 }
dbaron@6479 116 .article-max-lines-demo.two {
dbaron@6479 117 width: 11.5em;
dbaron@6479 118 float: left; margin-right: 1em;
dbaron@6479 119 }
dbaron@6479 120 .article-max-lines-demo.three {
dbaron@6479 121 width: 11.5em;
dbaron@6479 122 float: left;
dbaron@6479 123 }
dbaron@6475 124 </style>
dbaron@6470 125
dbaron@6470 126 <p>
dbaron@6470 127 </p>
dbaron@6470 128
dbaron@6470 129 <h2 id="intro">
dbaron@6470 130 Introduction</h2>
dbaron@6470 131
dbaron@6470 132 <p>
dbaron@6470 133 In CSS Level 1 [[CSS1]], placing more content than would fit
dbaron@6470 134 inside an element with a specified size
dbaron@6470 135 was generally an authoring error.
dbaron@6470 136 Doing so caused the content to extend
dbaron@6470 137 outside the bounds of the element,
dbaron@6470 138 which would likely cause
dbaron@6470 139 that content to overlap with other elements.
dbaron@6470 140 </p>
dbaron@6470 141
dbaron@6470 142 <p>
dbaron@6470 143 CSS Level 2 [[CSS21]] introduced the 'overflow' property,
dbaron@6470 144 which allows authors to have overflow be handled by scrolling,
dbaron@6470 145 which means it is no longer an authoring error.
dbaron@6470 146 It also allows authors to specify
dbaron@6470 147 that overflow is handled by clipping,
dbaron@6470 148 which makes sense when the author's intent
dbaron@6470 149 is that the content not be shown.
dbaron@6470 150 </p>
dbaron@6470 151
dbaron@6470 152 <p>
dbaron@6470 153 However, scrolling is not the only way
dbaron@6470 154 to present large amounts of content,
dbaron@6470 155 and may even not be the optimal way.
dbaron@6470 156 After all, the codex replaced the scroll
dbaron@6470 157 as the common format for large written works
dbaron@6470 158 because of its advantages.
dbaron@6470 159 </p>
dbaron@6470 160
dbaron@6470 161 <p>
dbaron@6470 162 This specification introduces
dbaron@6470 163 a mechanism for Web pages to specify
dbaron@6484 164 that an element of a page should handle overflow
dbaron@6470 165 through pagination rather than through scrolling.
dbaron@6470 166 </p>
dbaron@6470 167
dbaron@6470 168 <p>
dbaron@6470 169 This specification also extends the concept of overflow
dbaron@6470 170 in another direction.
dbaron@6484 171 Instead of requiring that authors specify a single area
dbaron@6470 172 into which the content of an element must flow,
dbaron@6484 173 this specification allows authors to specify multiple fragments,
dbaron@6470 174 each with their own dimensions and styles,
dbaron@6470 175 so that the content of the element can flow from one to the next,
dbaron@6470 176 using as many as needed to place the content without overflowing.
dbaron@6470 177 </p>
dbaron@6470 178
dbaron@6470 179 <p>
dbaron@6470 180 In both of these cases, implementations must
dbaron@6470 181 break the content in the block-progression dimension.
dbaron@6470 182 Implementations must do this is described
dbaron@6470 183 in the CSS Fragmentation Module [[!CSS3-BREAK]].
dbaron@6470 184 </p>
dbaron@6470 185
dbaron@9850 186 <h2 id="overflow-concepts">Types of overflow</h2>
dbaron@9850 187
dbaron@9850 188 <p>
dbaron@9850 189 CSS uses the term <dfn>overflow</dfn> to describe
dbaron@9850 190 the contents of a box
dbaron@9850 191 that extend outside that one of that box's edges
dbaron@9850 192 (i.e., its <i>content edge</i>, <i>padding edge</i>,
dbaron@9850 193 <i>border edge</i>, or <i>margin edge</i>).
dbaron@9850 194 The overflow might be described as the elements or features
dbaron@9850 195 that cause this overflow,
dbaron@9850 196 the non-rectangular region occupied by these features,
dbaron@9850 197 or, more commonly,
dbaron@9850 198 as the minimal rectangle that bounds that region.
dbaron@9850 199 A box's overflow is computed based on the boxes and styles
dbaron@9850 200 of the box and of all its descendants whose containing block chain
dbaron@9850 201 <span class="issue">undefined term?</span>
dbaron@9850 202 includes the box.
dbaron@9850 203 </p>
dbaron@9850 204
dbaron@9850 205 <p>
dbaron@9850 206 In most cases, any of these types of overflow
dbaron@9850 207 can be computed for any box
dbaron@9850 208 from the bounds and properties of that box,
dbaron@9850 209 and from the overflow (of that type)
dbaron@9850 210 of each of its children.
dbaron@9850 211 However, this is not always the case; for example,
dbaron@9850 212 when ''transform-style: preserve-3d'' [[CSS3-TRANSFORMS]] is used on
dbaron@9850 213 some of the children, their descendants with
dbaron@9850 214 ''transform-style: preserve-3d'' must also be examined.
dbaron@9850 215 </p>
dbaron@9850 216
dbaron@9850 217 <h3 id="ink-overflow">Ink overflow</h3>
dbaron@9850 218
dbaron@9850 219 <p>
dbaron@15115 220 The <dfn id="ink-overflow0">ink overflow</dfn> of a box
dbaron@9850 221 is the part of that box and its contents that
dbaron@9850 222 creates a visual effect outside of
dbaron@9850 223 the box's border box.
dbaron@9850 224 </p>
dbaron@9850 225
dbaron@9850 226 <p>
dbaron@9850 227 Since some effects in CSS (for example, the blurs in
dbaron@9850 228 'text-shadow' [[CSS3TEXT]] and 'box-shadow' [[CSS3BG]])
dbaron@9850 229 do not define what visual extent they cover, the extent
dbaron@15115 230 of the <a>ink overflow</a> is undefined.
dbaron@9850 231 </p>
dbaron@9850 232
dbaron@9850 233 <p class="issue">
dbaron@9850 234 Should we try to define it at all and just leave pieces undefined?
dbaron@9850 235 </p>
dbaron@9850 236
dbaron@9850 237 <p>
dbaron@9850 238 The <dfn>ink overflow region</dfn> is the non-rectangular region
dbaron@15115 239 occupied by the <a>ink overflow</a>, and the
dbaron@9850 240 <dfn>ink overflow rectangle</dfn> is
dbaron@9850 241 the minimal rectangle whose axis is aligned to the box's axes
dbaron@15115 242 and contains the <a>ink overflow region</a>.
dbaron@15115 243 Note that the <a>ink overflow rectangle</a> is a rectangle
dbaron@9850 244 in the box's coordinate system, but might be non-rectangular
dbaron@9850 245 in other coordinate systems due to transforms [[CSS3-TRANSFORMS]].
dbaron@9850 246 </p>
dbaron@9850 247
dbaron@9850 248 <h3 id="scrollable-overflow">Scrollable overflow</h3>
dbaron@9850 249
dbaron@9850 250 <p>
dbaron@15115 251 The <dfn id="scrollable-overflow0">scrollable overflow</dfn> of a box is the
dbaron@9850 252 set of things extending outside of that box's padding edge
dbaron@9850 253 for which a scrolling mechanism needs to be provided.
dbaron@9850 254 </p>
dbaron@9850 255
dbaron@9865 256 <p class="issue">
dbaron@9865 257 The following definition should be rewritten to use
dbaron@9865 258 the concept of <a href="http://dev.w3.org/csswg/css-transforms/#3d-rendering-context">3D rendering context</a> [[!CSS3-TRANSFORMS]]
dbaron@9865 259 and related terms,
dbaron@9865 260 particularly once those concepts stabilize following changes
dbaron@9865 261 proposed in the CSS WG meeting on the morning of 2014-01-28.
dbaron@9865 262 </p>
dbaron@9865 263
dbaron@9850 264 <p>
dbaron@9850 265 Given the following definitions
dbaron@9850 266 <span class="issue">which belong in [[CSS3-TRANSFORMS]]</span>:
dbaron@9850 267 </p>
dbaron@9850 268
dbaron@9850 269 <dl>
dbaron@9850 270 <dt><dfn>3d-preserving child</dfn></dt>
dbaron@9850 271 <dd>
dbaron@9865 272 A child box B of a containing block C is a 3d-preserving
dbaron@9850 273 child if it has ''transform-style: preserve-3d''
dbaron@9850 274 and the user-agent is not required to flatten it
dbaron@9850 275 based on the <a href="http://www.w3.org/TR/css3-transforms/#transform-style-property">requirements</a> in [[!CSS3-TRANSFORMS]].
dbaron@9850 276 </dt>
dbaron@9850 277 <dt><dfn>non-3d-preserving child</dfn></dt>
dbaron@9850 278 <dd>
dbaron@9850 279 A child C of a box P is a non-3d-preserving-child if
dbaron@15115 280 it is not a <a>3d-preserving child</a>.
dbaron@9850 281 </dd>
dbaron@9850 282 <dt><dfn>3d-preserving descendant</dfn></dt>
dbaron@9850 283 <dd>
dbaron@9850 284 Box D is a 3d-preserving descendant of box A if A is
dbaron@9850 285 an ancestor of D, and D and all of the boxes (if any)
dbaron@9865 286 in the containing block chain from D to A
dbaron@15115 287 are <a>3d-preserving child</a> boxes.
dbaron@9850 288 </dd>
dbaron@9850 289 </dl>
dbaron@9850 290
dbaron@9850 291 <p>The scrollable overflow of a box is the union of the following things,
dbaron@9850 292 all adjusted for transforms <span class="issue">undefined concept!</span> into the box's coordinate space:</p>
dbaron@9850 293
dbaron@9850 294 <ul>
dbaron@9850 295 <li>
dbaron@15115 296 for the box and all of its <a>3d-preserving descendant</a> boxes:
dbaron@9850 297 <ul>
dbaron@15115 298 <li>the box's own padding edge (for the box itself) or border edge (for <a>3d-preserving descendant</a> boxes)</li>
dbaron@9850 299 <li>the bounds <span class="issue">undefined term!</span> of any text directly in the box</li>
dbaron@9850 300 <li><span class="issue">MORE HERE!</span>
dbaron@9850 301 </ul>
dbaron@9850 302 <li>
dbaron@15115 303 for all the <a>non-3d-preserving child</a> boxes of the
dbaron@15115 304 box and its <a>3d-preserving descendant</a> boxes,
dbaron@9850 305 the scrollable overflow of the box
dbaron@9850 306 </li>
dbaron@9850 307 </ul>
dbaron@9850 308
dbaron@9850 309 <p class="issue">
dbaron@9850 310 I wrote this definition off the top of my head,
dbaron@9850 311 so it can't possibly be right.
dbaron@9850 312 It's missing tons of pieces!
dbaron@9850 313 </p>
dbaron@9850 314
dbaron@9966 315 <p class="issue">
dbaron@9966 316 The handling of preserve-3d subtrees here is probably wrong;
dbaron@9966 317 the elements should probably count
dbaron@9966 318 only towards the overflow of the element that flattens them.
dbaron@9966 319 </p>
dbaron@9966 320
dbaron@9850 321 <p>
dbaron@9850 322 The <dfn>scrollable overflow region</dfn> is the non-rectangular region
dbaron@15115 323 occupied by the <a>scrollable overflow</a>, and the
dbaron@9850 324 <dfn>scrollable overflow rectangle</dfn> is
dbaron@9850 325 the minimal rectangle whose axis is aligned to the box's axes
dbaron@15115 326 and contains the <a>scrollable overflow region</a>.
dbaron@15115 327 Note that the <a>scrollable overflow rectangle</a> is a rectangle
dbaron@9850 328 in the box's coordinate system, but might be non-rectangular
dbaron@9850 329 in other coordinate systems due to transforms [[CSS3-TRANSFORMS]].
dbaron@9850 330 </p>
dbaron@9850 331
dbaron@9850 332 <h3 id="border-box-overflow">Border box overflow</h3>
dbaron@9850 333
dbaron@9850 334 <p class="issue">
dbaron@9850 335 This concept has been proposed for some uses, such as for
dbaron@9850 336 determining what the 'outline' property goes around, and
dbaron@9850 337 as the basis of a coordinate system for specifying clips and masks,
dbaron@9850 338 but it's not clear if it's needed.
dbaron@9850 339 </p>
dbaron@9850 340
dbaron@9850 341 <p>
dbaron@9850 342 The <dfn>border-box overflow</dfn> of a box is the
dbaron@9850 343 union of the box's border edge and the border edges of
dbaron@9850 344 the box's descendants.</p>
dbaron@9850 345 </p>
dbaron@9850 346
dbaron@9850 347 <p class="issue">
dbaron@9850 348 If needed, define more formally, as for scrollable overflow above.
dbaron@9850 349 (Maybe even share the definitions in an appropriate way!)
dbaron@9850 350 </p>
dbaron@9850 351
dbaron@9850 352 <p>
dbaron@9850 353 The <dfn>border-box overflow region</dfn> is the non-rectangular region
dbaron@15115 354 occupied by the <a>border-box overflow</a>, and the
dbaron@9850 355 <dfn>border-box overflow rectangle</dfn> is
dbaron@9850 356 the minimal rectangle whose axis is aligned to the box's axes
dbaron@15115 357 and contains the <a>border-box overflow region</a>.
dbaron@15115 358 Note that the <a>border-box overflow rectangle</a> is a rectangle
dbaron@9850 359 in the box's coordinate system, but might be non-rectangular
dbaron@9850 360 in other coordinate systems due to transforms [[CSS3-TRANSFORMS]].
dbaron@9850 361 </p>
dbaron@9850 362
dbaron@7811 363 <h2 id="overflow-properties">Overflow properties</h2>
dbaron@7811 364
dbaron@7814 365 <p>
dbaron@15114 366 The 'overflow-x' property specifies
dbaron@7814 367 the handling of overflow in the horizontal direction
dbaron@7814 368 (i.e., overflow from the left and right sides of the box),
dbaron@15114 369 and the 'overflow-y' property specifies the handling
dbaron@7814 370 of overflow in the vertical direction
dbaron@7814 371 (i.e., overflow from the top and bottom sides of the box)
dbaron@7814 372 </p>
dbaron@7814 373
dbaron@7811 374 <table class=propdef>
dbaron@7811 375 <tr>
dbaron@7811 376 <th>Name:
dbaron@7811 377 <td><dfn>overflow-x</dfn>, <dfn>overflow-y</dfn>
dbaron@7811 378 <tr>
dbaron@15115 379 <th>Value:
dbaron@7811 380 <td>visible | hidden | scroll | auto | paged-x | paged-y | paged-x-controls | paged-y-controls | fragments
dbaron@7811 381 <tr>
dbaron@7811 382 <th>Initial:
dbaron@7811 383 <td>visible
dbaron@7811 384 <tr>
dbaron@7811 385 <th>Applies to:
dbaron@7819 386 <td>block containers [[!CSS21]], flex containers [[!CSS3-FLEXBOX]], and grid containers [[!CSS3-GRID-LAYOUT]]
dbaron@7811 387 <tr>
dbaron@7811 388 <th>Inherited:
dbaron@7811 389 <td>no
dbaron@7811 390 <tr>
dbaron@7811 391 <th>Percentages:
dbaron@7811 392 <td>N/A
dbaron@7811 393 <tr>
dbaron@7811 394 <th>Media:
dbaron@7811 395 <td>visual
dbaron@7811 396 <tr>
dbaron@7811 397 <th>Computed&nbsp;value:
dbaron@7811 398 <td>see below
dbaron@7811 399 <tr>
dbaron@7811 400 <th>Animatable:
dbaron@7811 401 <td>no
dbaron@7811 402 <tr>
dbaron@7811 403 <th>Canonical order:
dbaron@7811 404 <td><abbr title="follows order of property value definition">per grammar</abbr>
dbaron@7811 405 </table>
dbaron@7811 406
dbaron@7814 407 <p>
dbaron@7814 408 The 'overflow' property is a shorthand property
dbaron@7814 409 that sets the specified values of both 'overflow-x' and 'overflow-y'
dbaron@7814 410 to the value specified for 'overflow'.
dbaron@7814 411 </p>
dbaron@7814 412
dbaron@7811 413 <table class=propdef>
dbaron@7811 414 <tr>
dbaron@7811 415 <th>Name:
dbaron@7811 416 <td><dfn>overflow</dfn>
dbaron@7811 417 <tr>
dbaron@15115 418 <th>Value:
dbaron@7811 419 <td>visible | hidden | scroll | auto | paged-x | paged-y | paged-x-controls | paged-y-controls | fragments
dbaron@7811 420 <tr>
dbaron@7811 421 <th>Initial:
dbaron@7811 422 <td>see individual properties
dbaron@7811 423 <tr>
dbaron@7811 424 <th>Applies to:
dbaron@8332 425 <td>block containers [[!CSS21]], flex containers [[!CSS3-FLEXBOX]], and grid containers [[!CSS3-GRID-LAYOUT]]
dbaron@7811 426 <tr>
dbaron@7811 427 <th>Inherited:
dbaron@7811 428 <td>no
dbaron@7811 429 <tr>
dbaron@7811 430 <th>Percentages:
dbaron@7811 431 <td>N/A
dbaron@7811 432 <tr>
dbaron@7811 433 <th>Media:
dbaron@7811 434 <td>visual
dbaron@7811 435 <tr>
dbaron@7811 436 <th>Computed&nbsp;value:
dbaron@7811 437 <td>see individual properties
dbaron@7811 438 <tr>
dbaron@7811 439 <th>Animatable:
dbaron@7811 440 <td>no
dbaron@7811 441 <tr>
dbaron@7811 442 <th>Canonical order:
dbaron@7811 443 <td><abbr title="follows order of property value definition">per grammar</abbr>
dbaron@7811 444 </table>
dbaron@7811 445
dbaron@7811 446 <p>The values of these properties are:</p>
dbaron@7811 447
dbaron@15115 448 <dl dfn-for="overflow" dfn-type="value">
dbaron@7811 449 <dt><dfn>visible</dfn>
dbaron@7811 450 <dd>
dbaron@7811 451 There is no special handling of overflow, that is, it
dbaron@7811 452 may be rendered outside the block container.
dbaron@7811 453 </dd>
dbaron@7811 454 <dt><dfn>hidden</dfn>
dbaron@7811 455 <dt><dfn>scroll</dfn>
dbaron@7811 456 <dt><dfn>auto</dfn>
dbaron@7811 457 <dd>
dbaron@15115 458 These values are collectively the <dfn dfn>scrolling values</dfn>;
dbaron@7811 459 they are defined in the section on
dbaron@7811 460 <a href="#scrolling-overflow">scrolling and hidden overflow</a>.
dbaron@7811 461 </dd>
dbaron@7811 462 <dt><dfn>paged-x</dfn>
dbaron@7811 463 <dt><dfn>paged-y</dfn>
dbaron@7811 464 <dt><dfn>paged-x-controls</dfn>
dbaron@7811 465 <dt><dfn>paged-y-controls</dfn>
dbaron@7811 466 <dt><dfn>fragments</dfn>
dbaron@7811 467 <dd>
dbaron@15115 468 These values are collectively the <dfn dfn>fragmenting values</dfn>;
dbaron@7811 469 they are defined in the sections on
dbaron@7811 470 <a href="#paginated-overflow">paginated overflow</a> and
dbaron@7811 471 <a href="#fragment-overflow">fragment overflow</a>.
dbaron@7811 472 </dd>
dbaron@7811 473 </dl>
dbaron@7811 474
dbaron@7811 475 <div id="overflow-computed-values">
dbaron@7811 476 <p>The computed values of 'overflow-x' and 'overflow-y'
dbaron@7811 477 are determined from the cascaded values [[!CSS3CASCADE]]
dbaron@7811 478 based on the following rules:</p>
dbaron@7811 479
dbaron@7811 480 <ol>
dbaron@7811 481 <li>
dbaron@7811 482 If one or both of the cascaded values are
dbaron@15115 483 <a>fragmenting values</a>, then:
dbaron@7811 484 <ol>
dbaron@7811 485 <li>
dbaron@7811 486 If one of the cascaded values is one of the
dbaron@15115 487 <a>fragmenting values</a>
dbaron@7811 488 and the other is not,
dbaron@7811 489 then the computed values are
dbaron@7811 490 the same as the cascaded values.
dbaron@7811 491 </li>
dbaron@7811 492 <li>
dbaron@15115 493 If both of the cascaded values are <a>fragmenting values</a>, then:
dbaron@7811 494 <ol>
dbaron@7811 495 <li>
dbaron@7811 496 for horizontal writing mode [[!CSS3-WRITING-MODES]],
dbaron@15114 497 the computed value for 'overflow-y' is the cascaded value
dbaron@15115 498 and the computed value for 'overflow-x' is ''overflow/hidden'', or
dbaron@7811 499 </li>
dbaron@7811 500 <li>
dbaron@7811 501 for vertical writing mode [[!CSS3-WRITING-MODES]],
dbaron@15114 502 the computed value for 'overflow-x' is the cascaded value
dbaron@15115 503 and the computed value for 'overflow-y' is ''overflow/hidden''.
dbaron@7811 504 </li>
dbaron@7811 505 </ol>
dbaron@7811 506 </li>
dbaron@7811 507 </ol>
dbaron@7811 508 </li>
dbaron@7811 509 <li>
dbaron@7811 510 Otherwise, if one cascaded values is
dbaron@15115 511 one of the <a>scrolling values</a>
dbaron@15115 512 and the other is ''overflow/visible'',
dbaron@7811 513 then computed values are the cascaded values
dbaron@15115 514 with ''overflow/visible'' changed to ''overflow/auto''.
dbaron@7811 515 </li>
dbaron@7811 516 <li>
dbaron@7811 517 Otherwise, the computed values are as specified.
dbaron@7811 518 </li>
dbaron@7811 519 </ol>
dbaron@7811 520 </div>
dbaron@7811 521
dbaron@7811 522 <p class="issue">
dbaron@7811 523 Are all 4 of the ''paged-*'' values really needed?
dbaron@7811 524 </p>
dbaron@7811 525
dbaron@7811 526 <p>
dbaron@15115 527 When the <a>fragmenting values</a> are used,
dbaron@7811 528 the overflow from the fragments themselves
dbaron@15115 529 treats the fragmenting value as ''overflow/hidden''.
dbaron@7811 530 <span class="issue">Is this the right behavior?</span>
dbaron@7811 531 <span class="issue">Give example.</span>
dbaron@7811 532 </p>
dbaron@7811 533
dbaron@7820 534 <p class="issue">
dbaron@7820 535 [[CSS3-MARQUEE]] describes an 'overflow-style' property,
dbaron@7820 536 but it has not picked up implementation experience
dbaron@7820 537 that the working group is aware of.
dbaron@7820 538 Should this document treat 'overflow-style' as a defunct proposal,
dbaron@7820 539 or should this document describe the 'overflow-style' property
dbaron@7820 540 and attempt to revive it,
dbaron@7820 541 despite that implementations have implemented
dbaron@7820 542 'overflow-x' and 'overflow-y' instead?
dbaron@7820 543 </p>
dbaron@7820 544
dbaron@7916 545 <p class="issue">
dbaron@7916 546 There are <a href="http://lists.w3.org/Archives/Public/www-style/2012May/1197.html">discussions</a>
dbaron@7916 547 about how overflow, overflow-style, overflow-x and overflow-y
dbaron@7916 548 should work and interact with each other.
dbaron@7916 549 Until consensus on this topic is reached,
dbaron@7916 550 it is not completely clear which of these
dbaron@7916 551 should be used for
dbaron@7916 552 paged-x | paged-y | paged-x-controls | paged-y-controls | fragments
dbaron@7916 553 </p>
dbaron@7916 554
dbaron@6483 555 <h2 id="scrolling-overflow">Scrolling and hidden overflow</h2>
dbaron@6483 556
dbaron@6483 557 <p class="issue">
dbaron@6483 558 Move material from [[CSS21]] and [[CSS3BOX]] here.
dbaron@6483 559 </p>
dbaron@6470 560
dbaron@14821 561 <p class="issue">
dbaron@14821 562 Explain which directions allow scrolling and which don't,
dbaron@14821 563 as a function of 'direction'
dbaron@14821 564 (including propagation of 'direction' to the ICB).
dbaron@14821 565 </p>
dbaron@14821 566
dbaron@6470 567 <h2 id="paginated-overflow">Paginated overflow</h2>
dbaron@6470 568
dbaron@6497 569 <p class="issue">overflow:paginate or overflow:pages (or paged-x, paged-y, paged-x-controls, paged-y-controls as [[CSS3GCPM]] has?)</p>
dbaron@6470 570
dbaron@6470 571 <p class="issue">Ability to display N pages at once
dbaron@6470 572 rather than just one page at once?</p>
dbaron@6470 573
dbaron@6497 574 <p class="issue">
dbaron@6497 575 The current implementation of paginated overflow uses
dbaron@6497 576 the 'overflow'/'overflow-x'/'overflow-y' properties
dbaron@6497 577 rather than the 'overflow-style' property as proposed
dbaron@6497 578 in the [[CSS3GCPM]] draft
dbaron@6497 579 (which also matches the [[CSS3-MARQUEE]] proposal).
dbaron@6497 580 We should probably switch away from 'overflow-style',
dbaron@6497 581 but that's not 100% clear.
dbaron@6497 582 </p>
dbaron@6497 583
dbaron@6484 584 <h2 id="fragment-overflow">Fragment overflow</h2>
dbaron@6470 585
dbaron@6470 586 <p>
dbaron@6470 587 This section introduces and defines the meaning of
dbaron@6484 588 the new ''fragments'' value of the 'overflow' property.
dbaron@6470 589 </p>
dbaron@6470 590
dbaron@6470 591 <p>
dbaron@6484 592 When the computed value of 'overflow' for an element is ''fragments'',
dbaron@6470 593 and implementations would otherwise have created a box for the element,
dbaron@6491 594 then implementations must create a sequence of <dfn>fragment box</dfn>es
dbaron@6470 595 for that element.
dbaron@6491 596 (It is possible for an element with ''overflow: fragments''
dbaron@15115 597 to generate only one <a>fragment box</a>.
dbaron@6484 598 However, if an element's computed 'overflow' is not ''fragments'',
dbaron@15115 599 then its box is not a <a>fragment box</a>.)
dbaron@15115 600 Every <a>fragment box</a> is a fragmentation container,
dbaron@6491 601 and any overflow
dbaron@6491 602 that would cause that fragmentation container to fragment
dbaron@15115 603 causes another <a>fragment box</a> created as a next sibling
dbaron@6470 604 of the previous one.
dbaron@6470 605 <span class="issue">Or is it as though it's a next sibling of
dbaron@6470 606 the element? Need to figure out exactly how this interacts with
dbaron@6470 607 other box-level fixup.</span>
dbaron@15115 608 Additionally, if the <a>fragment box</a> is also
dbaron@6492 609 a multi-column box (as defined in [[!CSS3COL]]
dbaron@6492 610 <span class="issue">though it defines <i>multi-column element</i></span>)
dbaron@15115 611 any content that would lead to the creation of <a>overflow columns</a> [[!CSS3COL]]
dbaron@6492 612 instead is flown into an additional fragment box.
dbaron@6491 613 However, fragment boxes may themselves be broken
dbaron@6491 614 (due to fragmentation in a fragmentation context outside of them,
dbaron@6491 615 such as pages, columns, or other fragment boxes);
dbaron@6491 616 such breaking leads to fragments of the same fragment box
dbaron@6491 617 rather than multiple fragment boxes.
dbaron@6491 618 (This matters because fragment boxes may be styled by their index;
dbaron@6491 619 such breaking leads to multiple fragments of a fragment box
dbaron@6491 620 with a single index.
dbaron@6491 621 This design choice is so that
dbaron@6491 622 breaking a fragment box across pages does not break
dbaron@6491 623 the association of indices to particular pieces of content.)
dbaron@6491 624 <span class="issue">Should a forced break that breaks to
dbaron@6491 625 an outer fragmentation context cause a new fragment of a single
dbaron@6491 626 fragment box or a new fragment box?</span>
dbaron@6491 627 <span class="issue">Should we find a term other than
dbaron@15115 628 <a>fragment box</a> here to make this a little less confusing?</span>
dbaron@6470 629 </p>
dbaron@6470 630
dbaron@6470 631 <p class="issue">
dbaron@6491 632 What if we want to be able to style the pieces of an element
dbaron@6491 633 split within another type of fragmentation context?
dbaron@6491 634 These rules prevent ever using ''::nth-fragment()'' for that,
dbaron@6491 635 despite that the name seems the most logical name for such a feature.
dbaron@6470 636 </p>
dbaron@6470 637
dbaron@6475 638 <div class="example">
dbaron@6477 639 <table class="source-demo-pair"><tr><td><pre>&lt;!DOCTYPE HTML&gt;
dbaron@6475 640 &lt;title&gt;Breaking content into
dbaron@6475 641 equal-sized cards&lt;/title&gt;
dbaron@6475 642 &lt;style&gt;
dbaron@6475 643 .in-cards {
dbaron@6484 644 overflow: fragments;
dbaron@6475 645
dbaron@6475 646 width: 13em;
dbaron@6475 647 height: 8em;
dbaron@6475 648
dbaron@6475 649 padding: 4px;
dbaron@6475 650 border: medium solid blue;
dbaron@6475 651 margin: 6px;
dbaron@6475 652
dbaron@6475 653 font: medium/1.3 Times New
dbaron@6475 654 Roman, Times, serif;
dbaron@6475 655 }
dbaron@6475 656 &lt;/style&gt;
dbaron@6475 657 &lt;div class="in-cards"&gt;
dbaron@6475 658 In this example, the text in the div
dbaron@6475 659 is broken into a series of cards.
dbaron@6475 660 These cards all have the same style.
dbaron@6475 661 The presence of enough content to
dbaron@6475 662 overflow one of the cards causes
dbaron@6475 663 another one to be created. The second
dbaron@6475 664 card is created just like it's the
dbaron@6475 665 next sibling of the first.
dbaron@6477 666 &lt;/div&gt;</pre></td><td>
dbaron@6475 667 <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>
dbaron@6475 668 <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>
dbaron@6475 669 </td></tr></table>
dbaron@6475 670 </div>
dbaron@6475 671
dbaron@6487 672 <p class="issue">
dbaron@6487 673 We should specify that ''overflow: fragments'' does not apply
dbaron@6487 674 to at least some table parts,
dbaron@6487 675 and perhaps other elements as well.
dbaron@6487 676 We need to determine exactly which ones.
dbaron@6487 677 </p>
dbaron@6487 678
dbaron@6488 679 <p class="issue">
dbaron@6488 680 This specification needs to say which type of
dbaron@6488 681 fragmentation context is created
dbaron@15113 682 so that it's clear which values of the 'break-*' properties
dbaron@6488 683 cause breaks within this context.
dbaron@15113 684 We probably want ''break-*: region'' to apply.
dbaron@6488 685 </p>
dbaron@6488 686
dbaron@6494 687 <p class="issue">
dbaron@6494 688 This specification needs a processing model
dbaron@6494 689 that will apply in cases where the layout containing the
dbaron@6494 690 fragments has characteristics that use the intrinsic size of the fragments
dbaron@6494 691 to change the amount of space available for them,
dbaron@6494 692 such as [[CSS3-GRID-LAYOUT]].
dbaron@6494 693 There has already been some work on such a processing model
dbaron@6494 694 in [[CSS3-REGIONS]],
dbaron@6494 695 and the work done on a model there,
dbaron@6494 696 and the editors of that specification,
dbaron@6494 697 should inform what happens in this specification.
dbaron@6494 698 </p>
dbaron@6494 699
dbaron@6484 700 <h3 id="fragment-styling">Fragment styling</h3>
dbaron@6470 701
dbaron@6484 702 <h4 id="fragment-pseudo-element">The ::nth-fragment() pseudo-element</h4>
dbaron@6470 703
dbaron@6470 704 <p>
dbaron@6484 705 The ::nth-fragment() pseudo-element is a pseudo-element
dbaron@15115 706 that describes some of the <a>fragment box</a>es generated by an element.
dbaron@6470 707 The argument to the pseudo-element takes the same syntax
dbaron@6470 708 as the argument to the :nth-child() pseudo-class
dbaron@6470 709 defined in [[!SELECT]], and has the same meaning
dbaron@6470 710 except that the number is relative to
dbaron@15115 711 <a>fragment box</a>es generated by the element
dbaron@6470 712 instead of siblings of the element.
dbaron@6470 713 </p>
dbaron@6470 714
dbaron@6470 715 <p class="note">
dbaron@6484 716 Selectors that allow addressing fragments
dbaron@6470 717 by counting from the end rather than the start
dbaron@6470 718 are intentionally not provided.
dbaron@6470 719 Such selectors would interfere with determining
dbaron@6484 720 the number of fragments.
dbaron@6470 721 </p>
dbaron@6470 722
dbaron@6489 723 <p class="issue">
dbaron@6489 724 Depending on future discussions,
dbaron@6489 725 this ''::nth-fragment(<var>an+b</var>)'' syntax
dbaron@6489 726 may be replaced with
dbaron@6489 727 the new ''::fragment:nth(<var>an+b</var>)'' syntax.
dbaron@6489 728 </p>
dbaron@6489 729
dbaron@6484 730 <h4 id="style-of-fragments">Styling of fragments</h4>
dbaron@6470 731
dbaron@6470 732 <p class="issue">
dbaron@6484 733 Should this apply to fragment overflow only,
dbaron@6470 734 or also to paginated overflow?
dbaron@6470 735 (If it applies,
dbaron@6470 736 then stricter property restrictions would be needed
dbaron@6470 737 for paginated overflow.)
dbaron@6470 738 </p>
dbaron@6470 739
dbaron@6470 740 <p>
dbaron@6484 741 In the absence of rules with ''::nth-fragment()'' pseudo-elements,
dbaron@15115 742 the computed style for each <a>fragment box</a>
dbaron@6470 743 is the computed style for the element
dbaron@15115 744 for which the <a>fragment box</a> was created.
dbaron@15115 745 However, the style for a <a>fragment box</a> is also influenced
dbaron@15115 746 by rules whose selector's <a>subject</a> [[!SELECT]]
dbaron@6484 747 has an ''::nth-fragment()'' pseudo-element,
dbaron@15115 748 if the 1-based number of the <a>fragment box</a> matches
dbaron@6484 749 that ''::nth-fragment()'' pseudo-element
dbaron@6484 750 and the selector (excluding the ''::nth-fragment()'' pseudo-element)
dbaron@6484 751 matches the element generating the fragments.
dbaron@6470 752 </p>
dbaron@6470 753
dbaron@6486 754 <p>
dbaron@15115 755 When determining the style of the <a>fragment box</a>,
dbaron@6486 756 these rules that match the fragment pseudo-element
dbaron@6486 757 cascade together with the rules that match the element,
dbaron@6486 758 with the fragment pseudo-element adding the specificity
dbaron@6486 759 of a pseudo-class to the specificity calculation.
dbaron@6486 760 <span class="issue">Does this need to be specified in
dbaron@6486 761 the cascading module as well?</span>
dbaron@6486 762 </p>
dbaron@6486 763
dbaron@6477 764 <div class="example">
dbaron@6477 765 <table class="source-demo-pair"><tr><td><pre>&lt;!DOCTYPE HTML&gt;
dbaron@6477 766 &lt;style&gt;
dbaron@6477 767 .bouncy-columns {
dbaron@6484 768 overflow: fragments;
dbaron@6477 769 width: 6em;
dbaron@6477 770 height: 10em;
dbaron@6477 771 float: left;
dbaron@6477 772 margin: 1em;
dbaron@6477 773 font: medium/1.25 Times New
dbaron@6477 774 Roman, Times, serif;
dbaron@6477 775 }
dbaron@6484 776 .bouncy-columns::nth-fragment(1) {
dbaron@6477 777 background: aqua; color: black;
dbaron@6477 778 transform: rotate(-3deg);
dbaron@6477 779 }
dbaron@6484 780 .bouncy-columns::nth-fragment(2) {
dbaron@6477 781 background: yellow; color: black;
dbaron@6477 782 transform: rotate(3deg);
dbaron@6477 783 }
dbaron@6477 784 &lt;/style&gt;
dbaron@6477 785 &lt;div class="bouncy-columns"&gt;
dbaron@6477 786 <i>...</i>
dbaron@6477 787 &lt;/div&gt;</pre></td><td>
dbaron@6477 788 <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>
dbaron@6477 789 <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>
dbaron@6484 790 <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>
dbaron@6477 791 </td></tr></table>
dbaron@6477 792 </div>
dbaron@6477 793
dbaron@6470 794 <p>
dbaron@6484 795 Styling an ''::nth-fragment()'' pseudo-element with the 'overflow'
dbaron@6490 796 property does take effect;
dbaron@15115 797 if a <a>fragment box</a> has a
dbaron@6490 798 computed value of 'overflow' other than ''fragments''
dbaron@6490 799 then that fragment box is the last fragment.
dbaron@15114 800 However, overriding 'overflow' on the first fragment
dbaron@15115 801 does not cause the <a>fragment box</a> not to exist;
dbaron@6490 802 whether there are fragment boxes at all is determined by
dbaron@6490 803 the computed value of overflow for the element.
dbaron@7813 804 <span class="issue">Need to reword this to refer to the
dbaron@15114 805 appropriate choice of 'overflow-x' or 'overflow-y',
dbaron@7813 806 and then point to rule about the handling of the other one
dbaron@15114 807 of 'overflow-x' or 'overflow-y'.</span>
dbaron@6470 808 </p>
dbaron@6470 809
dbaron@6470 810 <p>
dbaron@6485 811 Styling an ''::nth-fragment()'' pseudo-element with the 'content'
dbaron@6485 812 property has no effect;
dbaron@6485 813 the computed value of 'content' for the fragment box
dbaron@6485 814 remains the same as the computed value of content for the element.
dbaron@6485 815 </p>
dbaron@6485 816
dbaron@6485 817 <p>
dbaron@15115 818 Specifying ''display: none'' for a <a>fragment box</a> causes
dbaron@6484 819 the fragment box with that index not to be generated.
dbaron@6470 820 However, in terms of the indices
dbaron@6484 821 used for matching ''::nth-fragment()'' pseudo-elements
dbaron@6484 822 of later fragment boxes,
dbaron@6470 823 it still counts as though it was generated.
dbaron@6470 824 However, since it is not generated, it does not contain any content.
dbaron@6470 825 </p>
dbaron@6470 826
dbaron@7813 827 <p>
dbaron@7813 828 Specifying other values of 'display', 'position',
dbaron@7813 829 or 'float' is permitted, but is not allowed to change
dbaron@7813 830 the computed value of 'display-inside'.
dbaron@7813 831 (Since 'overflow', 'overflow-x', and 'overflow-y' only
dbaron@7819 832 apply to block containers, flex containers, and grid containers
dbaron@7813 833 the computed value of 'display-inside' is always
dbaron@15115 834 ''display-inside/block'', ''display-inside/flex'', or
dbaron@15115 835 ''display-inside/grid''.
dbaron@7813 836 <span class="issue">Need to specify exactly how this works,
dbaron@7813 837 but it depends on
dbaron@7813 838 having 'display-inside' and 'display-outside' specified.</span>
dbaron@6470 839 </p>
dbaron@6470 840
dbaron@6470 841 <p>
dbaron@6470 842 To match the model for other pseudo-elements
dbaron@6470 843 where the pseudo-elements live inside their corresponding element,
dbaron@6484 844 declarations in ''::nth-fragment()'' pseudo-elements override
dbaron@6470 845 declarations in rules without the pseudo-element.
dbaron@6470 846 The relative priority within such declarations is determined
dbaron@6470 847 by normal cascading order (see [[!CSS21]]).
dbaron@6470 848 </p>
dbaron@6470 849
dbaron@6470 850 <p>
dbaron@6484 851 Styles specified on ''::nth-fragment()'' pseudo-elements
dbaron@15115 852 do affect inheritance to content within the <a>fragment box</a>.
dbaron@15115 853 In other words, the content within the <a>fragment box</a> must
dbaron@6484 854 inherit from the fragment box's style (i.e., the pseudo-element style)
dbaron@6470 855 rather than directly from the element.
dbaron@6484 856 This means that elements split between fragment boxes may
dbaron@6470 857 have different styles for different parts of the element.
dbaron@6470 858 </p>
dbaron@6470 859
dbaron@6472 860 <p class="issue">
dbaron@6472 861 This inheritance rule allows specifying styles indirectly
dbaron@6472 862 (by using explicit ''inherit'' or using default inheritance
dbaron@6472 863 on properties that don't apply to '':first-letter'')
dbaron@6472 864 that can't be specified directly
dbaron@6472 865 (based on the rules in the next section).
dbaron@6472 866 This is a problem.
dbaron@6484 867 The restrictions that apply to styling inside fragments
dbaron@6484 868 should also apply to inheritance from fragments.
dbaron@6472 869 </p>
dbaron@6472 870
dbaron@6480 871 <div class="example">
dbaron@6480 872 <table class="source-demo-pair"><tr><td><pre>&lt;!DOCTYPE HTML&gt;
dbaron@6480 873 &lt;style&gt;
dbaron@6480 874 .article {
dbaron@6484 875 overflow: fragments;
dbaron@6480 876 }
dbaron@6484 877 .article::nth-fragment(1) {
dbaron@6480 878 font-size: 1.5em;
dbaron@6480 879 margin-bottom: 1em;
dbaron@6480 880 height: 4em;
dbaron@6480 881 }
dbaron@6491 882 .article::nth-fragment(2) {
dbaron@6480 883 margin-left: 5em;
dbaron@6480 884 margin-right: 2em;
dbaron@6480 885 }
dbaron@6480 886 &lt;/style&gt;
dbaron@6480 887 &lt;div class="article"&gt;
dbaron@6480 888 The &lt;code&gt;font-size&lt;/code&gt; property<i>...</i>
dbaron@6480 889 &lt;/div&gt;</pre></td><td>
dbaron@6484 890 <div class="article-font-inherit-demo one">The <code>font-size</code> property<br>specified on the fragment<br>is inherited into the</div>
dbaron@6484 891 <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>
dbaron@6480 892 </td></tr></table>
dbaron@6480 893 </div>
dbaron@6478 894
dbaron@6484 895 <h4 id="style-in-fragments">Styling inside fragments</h4>
dbaron@6470 896
dbaron@6470 897 <p class="issue">
dbaron@6484 898 Should this apply to fragment overflow only,
dbaron@6470 899 or also to paginated overflow,
dbaron@6470 900 or even to pagination across pages?
dbaron@6470 901 </p>
dbaron@6470 902
dbaron@6470 903 <p>
dbaron@6484 904 The ''::nth-fragment()'' pseudo-element
dbaron@6470 905 can also be used to style
dbaron@15115 906 content inside of a <a>fragment box</a>.
dbaron@6470 907 Unlike the ''::first-line'' and ''::first-letter'' pseudo-elements,
dbaron@6484 908 the ''::nth-fragment()'' pseudo-element can be applied
dbaron@6470 909 to parts of the selector other than the subject:
dbaron@6470 910 in particular, it can match ancestors of the subject.
dbaron@6470 911 However, the only CSS properties applied
dbaron@6470 912 by rules with such selectors
dbaron@6470 913 are those that apply
dbaron@6470 914 to the ''::first-letter'' pseudo-element.
dbaron@6470 915 </p>
dbaron@6470 916
dbaron@6470 917 <p>
dbaron@6470 918 To be more precise,
dbaron@6484 919 when a rule's selector has ''::nth-fragment()'' pseudo-elements
dbaron@6470 920 attached to parts of the selector other than the subject,
dbaron@6470 921 the declarations in that rule apply to
dbaron@6470 922 a fragment (or pseudo-element thereof) when:
dbaron@6470 923 </p>
dbaron@6470 924 <ol>
dbaron@6470 925 <li>
dbaron@6470 926 the declarations are for properties that apply to the
dbaron@6470 927 ''::first-letter'' pseudo-element,
dbaron@6470 928 </li>
dbaron@6470 929 <li>
dbaron@6470 930 the declarations would apply to
dbaron@6470 931 that fragment (or pseudo-element thereof)
dbaron@6484 932 had those ''::nth-fragment()'' pseudo-elements been removed,
dbaron@6470 933 with a particular association between
dbaron@6470 934 each sequence of simple selectors and the element it matched,
dbaron@6470 935 and
dbaron@6470 936 </li>
dbaron@6470 937 <li>
dbaron@6484 938 for each removed ''::nth-fragment()'' pseudo-element,
dbaron@15115 939 the fragment lives within a <a>fragment box</a>
dbaron@6470 940 of the element associated in that association
dbaron@6470 941 with the selector that the pseudo-element was attached to,
dbaron@6470 942 and whose index matches the pseudo-element.
dbaron@6470 943 </li>
dbaron@6470 944 </ol>
dbaron@6470 945
dbaron@6481 946 <div class="example">
dbaron@6481 947 <table class="source-demo-pair"><tr><td><pre>&lt;!DOCTYPE HTML&gt;
dbaron@6481 948 &lt;style&gt;
dbaron@6481 949 .dark-columns {
dbaron@6484 950 overflow: fragments;
dbaron@6481 951 width: 6em;
dbaron@6481 952 height: 10em;
dbaron@6481 953 float: left;
dbaron@6481 954 margin-right: 1em;
dbaron@6481 955 font: medium/1.25 Times New
dbaron@6481 956 Roman, Times, serif;
dbaron@6481 957 }
dbaron@6484 958 .dark-columns::nth-fragment(1) {
dbaron@6481 959 background: aqua; color: black;
dbaron@6481 960 }
dbaron@6484 961 .dark-columns::nth-fragment(1) :link {
dbaron@6481 962 color: blue;
dbaron@6481 963 }
dbaron@6484 964 .dark-columns::nth-fragment(1) :visited {
dbaron@6481 965 color: purple;
dbaron@6481 966 }
dbaron@6484 967 .dark-columns::nth-fragment(2) {
dbaron@6481 968 background: navy; color: white;
dbaron@6481 969 }
dbaron@6484 970 .dark-columns::nth-fragment(2) :link {
dbaron@6481 971 color: aqua;
dbaron@6481 972 }
dbaron@6484 973 .dark-columns::nth-fragment(2) :visited {
dbaron@6481 974 color: fuchsia;
dbaron@6481 975 }
dbaron@6481 976 &lt;/style&gt;
dbaron@6481 977 &lt;div class="dark-columns"&gt;
dbaron@6481 978 <i>...</i>
dbaron@6481 979 &lt;/div&gt;</pre></td><td>
dbaron@6484 980 <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>
dbaron@6484 981 <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>
dbaron@6481 982 </td></tr></table>
dbaron@6481 983 </div>
dbaron@6481 984
dbaron@6478 985
dbaron@6470 986 <h3 id="max-lines">The 'max-lines' property</h3>
dbaron@6470 987
dbaron@6470 988 <p>
dbaron@6470 989 Authors may wish to style the opening lines of an element
dbaron@6470 990 with different styles
dbaron@6484 991 by putting those opening lines in a separate fragment.
dbaron@6470 992 However, since it may be difficult to predict the exact height
dbaron@6470 993 occupied by those lines
dbaron@6484 994 in order to restrict the first fragment to that height,
dbaron@6470 995 this specification introduces a 'max-lines' property
dbaron@6484 996 that forces a fragment to break
dbaron@6470 997 after a specified number of lines.
dbaron@6470 998 This forces a break after the given number of lines
dbaron@6470 999 contained within the element or its descendants,
dbaron@6470 1000 as long as those lines are in the same block formatting context.
dbaron@6470 1001 </p>
dbaron@6470 1002
dbaron@6470 1003 <table class=propdef>
dbaron@6470 1004 <tr>
dbaron@6470 1005 <th>Name:
dbaron@6470 1006 <td><dfn>max-lines</dfn>
dbaron@6470 1007 <tr>
dbaron@15115 1008 <th>Value:
dbaron@6470 1009 <td>none | &lt;integer&gt;
dbaron@6470 1010 <tr>
dbaron@6470 1011 <th>Initial:
dbaron@6470 1012 <td>none
dbaron@6470 1013 <tr>
dbaron@6470 1014 <th>Applies to:
dbaron@6484 1015 <td>fragment boxes
dbaron@6470 1016 <tr>
dbaron@6470 1017 <th>Inherited:
dbaron@6470 1018 <td>no
dbaron@6470 1019 <tr>
dbaron@6482 1020 <th>Animatable:
dbaron@6482 1021 <td>as <a href="http://www.w3.org/TR/css3-transitions/#animatable-types">integer</a>
dbaron@6482 1022 <tr>
dbaron@6470 1023 <th>Percentages:
dbaron@6470 1024 <td>N/A
dbaron@6470 1025 <tr>
dbaron@6470 1026 <th>Media:
dbaron@6470 1027 <td>visual
dbaron@6470 1028 <tr>
dbaron@6470 1029 <th>Computed&nbsp;value:
dbaron@6470 1030 <td>specified value
dbaron@6470 1031 <tr>
dbaron@6470 1032 <th>Canonical order:
dbaron@6470 1033 <td><abbr title="follows order of property value definition">per grammar</abbr>
dbaron@6470 1034 </table>
dbaron@6470 1035
dbaron@15115 1036 <dl dfn-for="max-lines" dfn-type="value">
dbaron@15115 1037 <dt><dfn>none</dfn>
dbaron@6470 1038 <dd>
dbaron@6470 1039 <p>
dbaron@6470 1040 Breaks occur only as specified elsewhere.
dbaron@6470 1041 </p>
dbaron@6470 1042 </dd>
dbaron@6470 1043
dbaron@15115 1044 <dt><dfn>&lt;integer&gt;</dfn>
dbaron@6470 1045 <dd>
dbaron@6470 1046 <p>
dbaron@6470 1047 In addition to any breaks specified elsewhere,
dbaron@6470 1048 a break is forced before any line that would exceed
dbaron@6470 1049 the given number of lines
dbaron@6470 1050 being placed inside the element
dbaron@6470 1051 (excluding lines that are in
dbaron@6470 1052 a different block formatting context from
dbaron@6470 1053 the block formatting context to which
dbaron@6470 1054 an unstyled child of the element would belong).
dbaron@6470 1055 </p>
dbaron@6470 1056
dbaron@6470 1057 <p class="issue">
dbaron@6470 1058 If there are multiple boundaries between this line
dbaron@6470 1059 and the previous, where exactly (in terms of element
dbaron@6470 1060 boundaries) is the break forced?
dbaron@6470 1061 </p>
dbaron@6470 1062
dbaron@6470 1063 <p>
dbaron@6470 1064 Only positive integers are accepted.
dbaron@6470 1065 Zero or negative integers are a parse error.
dbaron@6470 1066 </p>
dbaron@6470 1067 </dd>
dbaron@6470 1068 </dl>
dbaron@6470 1069
dbaron@6484 1070 <p class="issue">Should this apply to fragment overflow only, or also
dbaron@6470 1071 to pagination?</p>
dbaron@6470 1072
dbaron@6479 1073 <div class="example">
dbaron@6479 1074 <table class="source-demo-pair"><tr><td><pre>&lt;!DOCTYPE HTML&gt;
dbaron@6479 1075 &lt;style&gt;
dbaron@6479 1076 .article {
dbaron@6484 1077 overflow: fragments;
dbaron@6479 1078 }
dbaron@6479 1079 .article::first-letter {
dbaron@6479 1080 font-size: 2em;
dbaron@6479 1081 line-height: 0.9;
dbaron@6479 1082 }
dbaron@6484 1083 .article::nth-fragment(1) {
dbaron@6479 1084 font-size: 1.5em;
dbaron@6479 1085 max-lines: 3;
dbaron@6479 1086 }
dbaron@6491 1087 .article::nth-fragment(2) {
dbaron@6479 1088 column-count: 2;
dbaron@6479 1089 }
dbaron@6479 1090 &lt;/style&gt;
dbaron@6479 1091 &lt;div class="article"&gt;
dbaron@6479 1092 <i>...</i>
dbaron@6479 1093 &lt;/div&gt;</pre></td><td>
dbaron@6479 1094 <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>
dbaron@6479 1095 <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>
dbaron@6479 1096 <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>
dbaron@6479 1097 </td></tr></table>
dbaron@6479 1098 </div>
dbaron@6478 1099
dbaron@6493 1100 <h2 id="static-media">Overflow in static media</h2>
dbaron@6493 1101
dbaron@6493 1102 <p class="issue">
dbaron@6493 1103 This specification should define useful behavior
dbaron@6493 1104 for all values of 'overflow'
dbaron@6493 1105 in static media (such as print).
dbaron@6493 1106 Current implementation behavior is quite poor and
dbaron@6493 1107 produces unexpected results when authors have not considered
dbaron@6493 1108 what will happen when
dbaron@6493 1109 the content they produce for interactive media
dbaron@6493 1110 is printed.
dbaron@6493 1111 </p>
dbaron@6493 1112
dbaron@6470 1113 <h2 class=no-num id="acknowledgments">
dbaron@6470 1114 Acknowledgments</h2>
dbaron@6470 1115
dbaron@6470 1116 <p>
dbaron@6470 1117 Thanks especially to the feedback from
dbaron@6496 1118 Rossen Atanassov,
dbaron@6496 1119 Bert Bos,
dbaron@6496 1120 Tantek Çelik,
dbaron@6496 1121 John Daggett,
dbaron@6496 1122 fantasai,
dbaron@6496 1123 Daniel Glazman,
dbaron@6496 1124 Vincent Hardy,
dbaron@6470 1125 H&aring;kon Wium Lie,
dbaron@6496 1126 Peter Linss,
dbaron@7815 1127 Robert O'Callahan,
dbaron@6470 1128 Florian Rivoal,
dbaron@6473 1129 Alan Stearns,
dbaron@6496 1130 Steve Zilles,
dbaron@6470 1131 and all the rest of the
dbaron@6470 1132 <a href="http://lists.w3.org/Archives/Public/www-style/">www-style</a> community.
dbaron@6470 1133 </p>

mercurial