css3-overflow/Overview.src.html

Mon, 06 Aug 2012 18:06:02 -0700

author
L. David Baron <[email protected]>
date
Mon, 06 Aug 2012 18:06:02 -0700
changeset 6477
8eac1d199163
parent 6476
abfd019f595b
child 6478
94d91d8d42e2
permissions
-rw-r--r--

Add another example.

dbaron@6470 1 <!DOCTYPE html>
dbaron@6470 2 <html lang="en">
dbaron@6470 3 <head>
dbaron@6470 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
dbaron@6474 5 <title>CSS Region Styling Module Level 3</title>
dbaron@6470 6 <link rel=contents href="#contents">
dbaron@6470 7 <link rel=index href="#index">
dbaron@6470 8 <link rel="stylesheet" type="text/css" href="../default.css">
dbaron@6470 9 <link rel="stylesheet" type="text/css"
dbaron@6470 10 href="http://www.w3.org/StyleSheets/TR/W3C-[STATUS].css">
dbaron@6475 11 <style>
dbaron@6477 12 table.source-demo-pair {
dbaron@6477 13 width: 100%;
dbaron@6477 14 }
dbaron@6475 15 .in-cards-demo {
dbaron@6475 16 width: 13em;
dbaron@6475 17 height: 8em;
dbaron@6475 18
dbaron@6475 19 padding: 4px;
dbaron@6475 20 border: medium solid blue;
dbaron@6475 21 margin: 6px;
dbaron@6475 22
dbaron@6475 23 font: medium/1.3 Times New Roman, Times, serif;
dbaron@6475 24 white-space: nowrap;
dbaron@6475 25 }
dbaron@6477 26 .bouncy-columns-demo {
dbaron@6477 27 width: 6em;
dbaron@6477 28 height: 10em;
dbaron@6477 29 float: left;
dbaron@6477 30 margin: 1em;
dbaron@6477 31 font: medium/1.25 Times New Roman, Times, serif;
dbaron@6477 32 white-space: nowrap;
dbaron@6477 33 }
dbaron@6477 34 .bouncy-columns-demo.one {
dbaron@6477 35 background: aqua; color: black;
dbaron@6477 36 transform: rotate(-3deg);
dbaron@6477 37 }
dbaron@6477 38 .bouncy-columns-demo.two {
dbaron@6477 39 background: yellow; color: black;
dbaron@6477 40 transform: rotate(3deg);
dbaron@6477 41 }
dbaron@6475 42 </style>
dbaron@6470 43 </head>
dbaron@6470 44
dbaron@6470 45 <div class="head">
dbaron@6470 46 <!--logo-->
dbaron@6470 47
dbaron@6474 48 <h1>CSS Region Styling Module Level 3</h1>
dbaron@6470 49
dbaron@6470 50 <h2 class="no-num no-toc">[LONGSTATUS] [DATE]</h2>
dbaron@6470 51 <dl>
dbaron@6470 52 <dt>This version:
dbaron@6474 53 <dd><a href="[VERSION]">http://www.w3.org/TR/[YEAR]/ED-css3-region-styling-[CDATE]/</a>
dbaron@6470 54
dbaron@6470 55 <dt>Latest version:
dbaron@6470 56 <dd><a href="http://www.w3.org/TR/[SHORTNAME]/">http://www.w3.org/TR/[SHORTNAME]/</a>
dbaron@6470 57
dbaron@6470 58 <dt>Editor's draft:
dbaron@6470 59 <dd><a href="http://dev.w3.org/csswg/[SHORTNAME]/">http://dev.w3.org/csswg/[SHORTNAME]/</a>
dbaron@6470 60
dbaron@6470 61 <!--
dbaron@6470 62 <dt>Previous version:
dbaron@6470 63 <dd><a href="http://www.w3.org/PreviousVersionURI">
dbaron@6470 64 http://www.w3.org/PreviousVersionURI</a>
dbaron@6470 65 -->
dbaron@6470 66
dbaron@6470 67 <dt>Issue Tracking:</dt>
dbaron@6470 68 <dd>Maintained in document (only editor's draft is current)
dbaron@6470 69
dbaron@6470 70 <dt>Feedback:</dt>
dbaron@6470 71 <dd><a href="http://lists.w3.org/Archives/Public/www-style/">[email protected]</a> with subject line &ldquo;<kbd>[[SHORTNAME]] <var>&hellip; message topic &hellip;</var></kbd>&rdquo;
dbaron@6470 72
dbaron@6470 73 <dt>Editors:
dbaron@6470 74 <dd class="h-card vcard">
dbaron@6470 75 <a class="p-name fn u-url url" rel="author"
dbaron@6470 76 href="http://dbaron.org/">L. David Baron</a>,
dbaron@6470 77 <a class="p-org org" href="http://www.mozilla.org/">Mozilla</a>
dbaron@6470 78 </dl>
dbaron@6470 79
dbaron@6470 80 <!--copyright-->
dbaron@6470 81
dbaron@6470 82 <hr title="Separator for header">
dbaron@6470 83 </div>
dbaron@6470 84
dbaron@6470 85 <h2 class="no-num no-toc" id="abstract">Abstract</h2>
dbaron@6470 86
dbaron@6470 87 <p>
dbaron@6470 88 <a href="http://www.w3.org/TR/CSS/">CSS</a> is
dbaron@6470 89 a language for describing
dbaron@6470 90 the rendering of structured documents (such as HTML and XML)
dbaron@6470 91 on screen, on paper, in speech, etc.
dbaron@6470 92 This module contains the features of CSS
dbaron@6470 93 relating to new mechanisms of overflow handling in visual media (e.g., screen or paper).
dbaron@6470 94 In interactive media,
dbaron@6470 95 it describes features that allow the overflow
dbaron@6470 96 from a fixed size container
dbaron@6470 97 to be handled by pagination (displaying one page at a time).
dbaron@6470 98 It also describes features, applying to all visual media,
dbaron@6470 99 that allow the contents of an element
dbaron@6470 100 to be spread across multiple containers,
dbaron@6470 101 allowing the contents to flow across multiple regions of a page
dbaron@6470 102 or to have different styles for different parts.
dbaron@6470 103 </p>
dbaron@6470 104
dbaron@6470 105 <h2 class="no-num no-toc" id="status">Status of this document</h2>
dbaron@6470 106
dbaron@6470 107 <!--status-->
dbaron@6470 108
dbaron@6470 109 <p>The following features are at risk: &hellip;
dbaron@6470 110
dbaron@6470 111 <h2 class="no-num no-toc" id="contents">
dbaron@6470 112 Table of contents</h2>
dbaron@6470 113
dbaron@6470 114 <!--toc-->
dbaron@6470 115
dbaron@6470 116 <h2 id="intro">
dbaron@6470 117 Introduction</h2>
dbaron@6470 118
dbaron@6470 119 <p>
dbaron@6470 120 In CSS Level 1 [[CSS1]], placing more content than would fit
dbaron@6470 121 inside an element with a specified size
dbaron@6470 122 was generally an authoring error.
dbaron@6470 123 Doing so caused the content to extend
dbaron@6470 124 outside the bounds of the element,
dbaron@6470 125 which would likely cause
dbaron@6470 126 that content to overlap with other elements.
dbaron@6470 127 </p>
dbaron@6470 128
dbaron@6470 129 <p>
dbaron@6470 130 CSS Level 2 [[CSS21]] introduced the 'overflow' property,
dbaron@6470 131 which allows authors to have overflow be handled by scrolling,
dbaron@6470 132 which means it is no longer an authoring error.
dbaron@6470 133 It also allows authors to specify
dbaron@6470 134 that overflow is handled by clipping,
dbaron@6470 135 which makes sense when the author's intent
dbaron@6470 136 is that the content not be shown.
dbaron@6470 137 </p>
dbaron@6470 138
dbaron@6470 139 <p>
dbaron@6470 140 However, scrolling is not the only way
dbaron@6470 141 to present large amounts of content,
dbaron@6470 142 and may even not be the optimal way.
dbaron@6470 143 After all, the codex replaced the scroll
dbaron@6470 144 as the common format for large written works
dbaron@6470 145 because of its advantages.
dbaron@6470 146 </p>
dbaron@6470 147
dbaron@6470 148 <p>
dbaron@6470 149 This specification introduces
dbaron@6470 150 a mechanism for Web pages to specify
dbaron@6470 151 that a region of a page should handle overflow
dbaron@6470 152 through pagination rather than through scrolling.
dbaron@6470 153 </p>
dbaron@6470 154
dbaron@6470 155 <p>
dbaron@6470 156 This specification also extends the concept of overflow
dbaron@6470 157 in another direction.
dbaron@6470 158 Instead of requiring that authors specify a single region
dbaron@6470 159 into which the content of an element must flow,
dbaron@6470 160 this specification allows authors to specify multiple regions,
dbaron@6470 161 each with their own dimensions and styles,
dbaron@6470 162 so that the content of the element can flow from one to the next,
dbaron@6470 163 using as many as needed to place the content without overflowing.
dbaron@6470 164 </p>
dbaron@6470 165
dbaron@6470 166 <p>
dbaron@6470 167 In both of these cases, implementations must
dbaron@6470 168 break the content in the block-progression dimension.
dbaron@6470 169 Implementations must do this is described
dbaron@6470 170 in the CSS Fragmentation Module [[!CSS3-BREAK]].
dbaron@6470 171 </p>
dbaron@6470 172
dbaron@6470 173
dbaron@6470 174 <h2 id="paginated-overflow">Paginated overflow</h2>
dbaron@6470 175
dbaron@6470 176 <p class="issue">overflow:paginate or overflow:pages (or paged-x, paged-y, paged-x-controls, paged-y-controls as css3-gcpm has?)</p>
dbaron@6470 177
dbaron@6470 178 <p class="issue">Ability to display N pages at once
dbaron@6470 179 rather than just one page at once?</p>
dbaron@6470 180
dbaron@6470 181 <h2 id="region-overflow">Region overflow</h2>
dbaron@6470 182
dbaron@6470 183 <p>
dbaron@6470 184 This section introduces and defines the meaning of
dbaron@6470 185 the new ''regions'' (<span class="issue">or ''repeat''?</span>)
dbaron@6470 186 value of the 'overflow' property.
dbaron@6470 187 </p>
dbaron@6470 188
dbaron@6470 189 <p>
dbaron@6470 190 When the computed value of 'overflow' for an element is ''regions'',
dbaron@6470 191 and implementations would otherwise have created a box for the element,
dbaron@6470 192 then implementations must create at least one box for that element.
dbaron@6470 193 Each box created for the element is called a <dfn>region box</dfn>
dbaron@6470 194 for that element.
dbaron@6470 195 (If an element with ''overflow: regions'' generates only one box,
dbaron@6470 196 that box is a <i>region box</i>.
dbaron@6470 197 However, if an element's computed 'overflow' is not ''regions'',
dbaron@6470 198 then its box is not a <i>region box</i>.)
dbaron@6470 199 Every <i>region box</i> is a fragmentation container,
dbaron@6471 200 and for each <i>region box</i> which ends with a fragmentation break,
dbaron@6471 201 (which could happen
dbaron@6471 202 because breakable content overflows in the block dimension
dbaron@6471 203 or because of a forced break),
dbaron@6470 204 there must be another <i>region box</i> created as a next sibling
dbaron@6470 205 of the previous one.
dbaron@6470 206 <span class="issue">Or is it as though it's a next sibling of
dbaron@6470 207 the element? Need to figure out exactly how this interacts with
dbaron@6470 208 other box-level fixup.</span>
dbaron@6470 209 (Breakable content might overflow in the box dimension either
dbaron@6470 210 because of a specified size on the region box
dbaron@6470 211 or because the region box is within a fragmentation context
dbaron@6470 212 in which it is being broken.
dbaron@6470 213 In other words, a single region box is never broken
dbaron@6470 214 across columns or pages;
dbaron@6470 215 the pieces that are in separate columns or pages
dbaron@6470 216 are always distinct region boxes.)
dbaron@6470 217 </p>
dbaron@6470 218
dbaron@6470 219 <p class="issue">
dbaron@6476 220 We also want ''::nth-region()'' pseudo-elements
dbaron@6470 221 to be able to apply to the pieces of an element
dbaron@6470 222 split within a fragmentation context.
dbaron@6470 223 Should we require that authors who want to use
dbaron@6476 224 ''::nth-region()'' in this way specify ''overflow:regions''
dbaron@6470 225 (even if they don't specify a constrained height),
dbaron@6470 226 or should it work automatically for all elements
dbaron@6470 227 even if they don't have ''overflow: regions''?
dbaron@6470 228 </p>
dbaron@6470 229
dbaron@6475 230 <div class="example">
dbaron@6477 231 <table class="source-demo-pair"><tr><td><pre>&lt;!DOCTYPE HTML&gt;
dbaron@6475 232 &lt;title&gt;Breaking content into
dbaron@6475 233 equal-sized cards&lt;/title&gt;
dbaron@6475 234 &lt;style&gt;
dbaron@6475 235 .in-cards {
dbaron@6475 236 overflow: regions;
dbaron@6475 237
dbaron@6475 238 width: 13em;
dbaron@6475 239 height: 8em;
dbaron@6475 240
dbaron@6475 241 padding: 4px;
dbaron@6475 242 border: medium solid blue;
dbaron@6475 243 margin: 6px;
dbaron@6475 244
dbaron@6475 245 font: medium/1.3 Times New
dbaron@6475 246 Roman, Times, serif;
dbaron@6475 247 }
dbaron@6475 248 &lt;/style&gt;
dbaron@6475 249 &lt;div class="in-cards"&gt;
dbaron@6475 250 In this example, the text in the div
dbaron@6475 251 is broken into a series of cards.
dbaron@6475 252 These cards all have the same style.
dbaron@6475 253 The presence of enough content to
dbaron@6475 254 overflow one of the cards causes
dbaron@6475 255 another one to be created. The second
dbaron@6475 256 card is created just like it's the
dbaron@6475 257 next sibling of the first.
dbaron@6477 258 &lt;/div&gt;</pre></td><td>
dbaron@6475 259 <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 260 <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 261 </td></tr></table>
dbaron@6475 262 </div>
dbaron@6475 263
dbaron@6470 264 <h3 id="region-styling">Region styling</h3>
dbaron@6470 265
dbaron@6470 266 <h4 id="region-pseudo-element">The ::nth-region() pseudo-element</h4>
dbaron@6470 267
dbaron@6470 268 <p>
dbaron@6470 269 The ::nth-region() pseudo-element is a pseudo-element
dbaron@6470 270 that describes some of the region boxes generated by an element.
dbaron@6470 271 The argument to the pseudo-element takes the same syntax
dbaron@6470 272 as the argument to the :nth-child() pseudo-class
dbaron@6470 273 defined in [[!SELECT]], and has the same meaning
dbaron@6470 274 except that the number is relative to
dbaron@6470 275 <i>region boxes</i> generated by the element
dbaron@6470 276 instead of siblings of the element.
dbaron@6470 277 </p>
dbaron@6470 278
dbaron@6470 279 <p class="issue">
dbaron@6470 280 If we go with a name for the 'overflow' value other than
dbaron@6470 281 ''overflow: regions'',
dbaron@6470 282 then we should probably rename this pseudo-element,
dbaron@6470 283 perhaps to ::nth-piece(), ::nth-part(), or ::nth-instance().
dbaron@6470 284 </p>
dbaron@6470 285
dbaron@6470 286 <p class="note">
dbaron@6470 287 Selectors that allow addressing regions
dbaron@6470 288 by counting from the end rather than the start
dbaron@6470 289 are intentionally not provided.
dbaron@6470 290 Such selectors would interfere with determining
dbaron@6470 291 the number of regions.
dbaron@6470 292 </p>
dbaron@6470 293
dbaron@6470 294 <h4 id="style-of-regions">Styling of regions</h4>
dbaron@6470 295
dbaron@6470 296 <p class="issue">
dbaron@6470 297 Should this apply to region overflow only,
dbaron@6470 298 or also to paginated overflow?
dbaron@6470 299 (If it applies,
dbaron@6470 300 then stricter property restrictions would be needed
dbaron@6470 301 for paginated overflow.)
dbaron@6470 302 </p>
dbaron@6470 303
dbaron@6470 304 <p>
dbaron@6470 305 In the absence of rules with ''::nth-region()'' pseudo-elements,
dbaron@6470 306 the computed style for each <i>region box</i>
dbaron@6470 307 is the computed style for the element
dbaron@6470 308 for which the <i>region box</i> was created.
dbaron@6470 309 However, the style for a <i>region box</i> is also influenced
dbaron@6470 310 by rules whose selector's <i>subject</i> [[!SELECT]]
dbaron@6470 311 has an ''::nth-region()'' pseudo-element,
dbaron@6470 312 if the 1-based number of the region box matches
dbaron@6470 313 that ''::nth-region()'' pseudo-element
dbaron@6470 314 and the selector (excluding the ''::nth-region()'' pseudo-element)
dbaron@6470 315 matches the element generating the regions.
dbaron@6470 316 </p>
dbaron@6470 317
dbaron@6477 318 <div class="example">
dbaron@6477 319 <table class="source-demo-pair"><tr><td><pre>&lt;!DOCTYPE HTML&gt;
dbaron@6477 320 &lt;style&gt;
dbaron@6477 321 .bouncy-columns {
dbaron@6477 322 overflow: regions;
dbaron@6477 323 width: 6em;
dbaron@6477 324 height: 10em;
dbaron@6477 325 float: left;
dbaron@6477 326 margin: 1em;
dbaron@6477 327 font: medium/1.25 Times New
dbaron@6477 328 Roman, Times, serif;
dbaron@6477 329 }
dbaron@6477 330 .bouncy-columns::nth-region(1) {
dbaron@6477 331 background: aqua; color: black;
dbaron@6477 332 transform: rotate(-3deg);
dbaron@6477 333 }
dbaron@6477 334 .bouncy-columns::nth-region(2) {
dbaron@6477 335 background: yellow; color: black;
dbaron@6477 336 transform: rotate(3deg);
dbaron@6477 337 }
dbaron@6477 338 &lt;/style&gt;
dbaron@6477 339 &lt;div class="bouncy-columns"&gt;
dbaron@6477 340 <i>...</i>
dbaron@6477 341 &lt;/div&gt;</pre></td><td>
dbaron@6477 342 <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 343 <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@6477 344 <div class="bouncy-columns-demo">just doesn't<br>have any<br>region-specific<br>styling because<br>the author<br>didn't give it<br>any.</div>
dbaron@6477 345 </td></tr></table>
dbaron@6477 346 </div>
dbaron@6477 347
dbaron@6470 348 <p>
dbaron@6476 349 Styling an ''::nth-region()'' pseudo-element with the 'overflow'
dbaron@6470 350 property has no effect;
dbaron@6470 351 the computed value of 'overflow' for the region box
dbaron@6470 352 remains the same as the computed value of overflow for the element.
dbaron@6470 353 </p>
dbaron@6470 354
dbaron@6470 355 <p>
dbaron@6470 356 Specifying ''display: none'' for a region box causes
dbaron@6470 357 the region box with that index not to be generated.
dbaron@6470 358 However, in terms of the indices
dbaron@6476 359 used for matching ''::nth-region()'' pseudo-elements
dbaron@6470 360 of later region boxes,
dbaron@6470 361 it still counts as though it was generated.
dbaron@6470 362 However, since it is not generated, it does not contain any content.
dbaron@6470 363 </p>
dbaron@6470 364
dbaron@6470 365 <p class="issue">
dbaron@6470 366 Would it make more sense to forbid ''display:none''?
dbaron@6470 367 Or perhaps to forbid 'display', 'position', 'float',
dbaron@6470 368 and similar (in addition to 'overflow')?
dbaron@6470 369 </p>
dbaron@6470 370
dbaron@6470 371 <p>
dbaron@6470 372 To match the model for other pseudo-elements
dbaron@6470 373 where the pseudo-elements live inside their corresponding element,
dbaron@6470 374 declarations in ''::nth-region()'' pseudo-elements override
dbaron@6470 375 declarations in rules without the pseudo-element.
dbaron@6470 376 The relative priority within such declarations is determined
dbaron@6470 377 by normal cascading order (see [[!CSS21]]).
dbaron@6470 378 </p>
dbaron@6470 379
dbaron@6470 380 <p>
dbaron@6470 381 Styles specified on ''::nth-region()'' pseudo-elements
dbaron@6470 382 do affect inheritance to content within the <i>region box</i>.
dbaron@6470 383 In other words, the content within the <i>region box</i> must
dbaron@6470 384 inherit from the region box's style (i.e., the pseudo-element style)
dbaron@6470 385 rather than directly from the element.
dbaron@6470 386 This means that elements split between region boxes may
dbaron@6470 387 have different styles for different parts of the element.
dbaron@6470 388 </p>
dbaron@6470 389
dbaron@6472 390 <p class="issue">
dbaron@6472 391 This inheritance rule allows specifying styles indirectly
dbaron@6472 392 (by using explicit ''inherit'' or using default inheritance
dbaron@6472 393 on properties that don't apply to '':first-letter'')
dbaron@6472 394 that can't be specified directly
dbaron@6472 395 (based on the rules in the next section).
dbaron@6472 396 This is a problem.
dbaron@6472 397 The restrictions that apply to styling inside regions
dbaron@6472 398 should also apply to inheritance from regions.
dbaron@6472 399 </p>
dbaron@6472 400
dbaron@6470 401 <h4 id="style-in-regions">Styling inside regions</h4>
dbaron@6470 402
dbaron@6470 403 <p class="issue">
dbaron@6470 404 Should this apply to region overflow only,
dbaron@6470 405 or also to paginated overflow,
dbaron@6470 406 or even to pagination across pages?
dbaron@6470 407 </p>
dbaron@6470 408
dbaron@6470 409 <p>
dbaron@6476 410 The ''::nth-region()'' pseudo-element
dbaron@6470 411 can also be used to style
dbaron@6470 412 content inside of a <i>region box</i>.
dbaron@6470 413 Unlike the ''::first-line'' and ''::first-letter'' pseudo-elements,
dbaron@6476 414 the ''::nth-region()'' pseudo-element can be applied
dbaron@6470 415 to parts of the selector other than the subject:
dbaron@6470 416 in particular, it can match ancestors of the subject.
dbaron@6470 417 However, the only CSS properties applied
dbaron@6470 418 by rules with such selectors
dbaron@6470 419 are those that apply
dbaron@6470 420 to the ''::first-letter'' pseudo-element.
dbaron@6470 421 </p>
dbaron@6470 422
dbaron@6470 423 <p>
dbaron@6470 424 To be more precise,
dbaron@6470 425 when a rule's selector has ''::nth-region()'' pseudo-elements
dbaron@6470 426 attached to parts of the selector other than the subject,
dbaron@6470 427 the declarations in that rule apply to
dbaron@6470 428 a fragment (or pseudo-element thereof) when:
dbaron@6470 429 </p>
dbaron@6470 430 <ol>
dbaron@6470 431 <li>
dbaron@6470 432 the declarations are for properties that apply to the
dbaron@6470 433 ''::first-letter'' pseudo-element,
dbaron@6470 434 </li>
dbaron@6470 435 <li>
dbaron@6470 436 the declarations would apply to
dbaron@6470 437 that fragment (or pseudo-element thereof)
dbaron@6470 438 had those ''::nth-region()'' pseudo-elements been removed,
dbaron@6470 439 with a particular association between
dbaron@6470 440 each sequence of simple selectors and the element it matched,
dbaron@6470 441 and
dbaron@6470 442 </li>
dbaron@6470 443 <li>
dbaron@6470 444 for each removed ''::nth-region()'' pseudo-element,
dbaron@6470 445 the fragment lives within a <i>region box</i>
dbaron@6470 446 of the element associated in that association
dbaron@6470 447 with the selector that the pseudo-element was attached to,
dbaron@6470 448 and whose index matches the pseudo-element.
dbaron@6470 449 </li>
dbaron@6470 450 </ol>
dbaron@6470 451
dbaron@6470 452 <h3 id="max-lines">The 'max-lines' property</h3>
dbaron@6470 453
dbaron@6470 454 <p>
dbaron@6470 455 Authors may wish to style the opening lines of an element
dbaron@6470 456 with different styles
dbaron@6470 457 by putting those opening lines in a separate region.
dbaron@6470 458 However, since it may be difficult to predict the exact height
dbaron@6470 459 occupied by those lines
dbaron@6470 460 in order to restrict the first region to that height,
dbaron@6470 461 this specification introduces a 'max-lines' property
dbaron@6470 462 that forces a region to break
dbaron@6470 463 after a specified number of lines.
dbaron@6470 464 This forces a break after the given number of lines
dbaron@6470 465 contained within the element or its descendants,
dbaron@6470 466 as long as those lines are in the same block formatting context.
dbaron@6470 467 </p>
dbaron@6470 468
dbaron@6470 469 <table class=propdef>
dbaron@6470 470 <tr>
dbaron@6470 471 <th>Name:
dbaron@6470 472 <td><dfn>max-lines</dfn>
dbaron@6470 473 <tr>
dbaron@6470 474 <th><a href="#values">Value</a>:
dbaron@6470 475 <td>none | &lt;integer&gt;
dbaron@6470 476 <tr>
dbaron@6470 477 <th>Initial:
dbaron@6470 478 <td>none
dbaron@6470 479 <tr>
dbaron@6470 480 <th>Applies to:
dbaron@6470 481 <td>region boxes
dbaron@6470 482 <tr>
dbaron@6470 483 <th>Inherited:
dbaron@6470 484 <td>no
dbaron@6470 485 <tr>
dbaron@6470 486 <th>Percentages:
dbaron@6470 487 <td>N/A
dbaron@6470 488 <tr>
dbaron@6470 489 <th>Media:
dbaron@6470 490 <td>visual
dbaron@6470 491 <tr>
dbaron@6470 492 <th>Computed&nbsp;value:
dbaron@6470 493 <td>specified value
dbaron@6470 494 <tr>
dbaron@6470 495 <th>Animatable:
dbaron@6470 496 <td>as <a href="http://www.w3.org/TR/css3-transitions/#animatable-types">integer</a>
dbaron@6470 497 <tr>
dbaron@6470 498 <th>Canonical order:
dbaron@6470 499 <td><abbr title="follows order of property value definition">per grammar</abbr>
dbaron@6470 500 </table>
dbaron@6470 501
dbaron@6470 502 <dl>
dbaron@6470 503 <dt>none
dbaron@6470 504 <dd>
dbaron@6470 505 <p>
dbaron@6470 506 Breaks occur only as specified elsewhere.
dbaron@6470 507 </p>
dbaron@6470 508 </dd>
dbaron@6470 509
dbaron@6470 510 <dt>&lt;integer&gt;
dbaron@6470 511 <dd>
dbaron@6470 512 <p>
dbaron@6470 513 In addition to any breaks specified elsewhere,
dbaron@6470 514 a break is forced before any line that would exceed
dbaron@6470 515 the given number of lines
dbaron@6470 516 being placed inside the element
dbaron@6470 517 (excluding lines that are in
dbaron@6470 518 a different block formatting context from
dbaron@6470 519 the block formatting context to which
dbaron@6470 520 an unstyled child of the element would belong).
dbaron@6470 521 </p>
dbaron@6470 522
dbaron@6470 523 <p class="issue">
dbaron@6470 524 If there are multiple boundaries between this line
dbaron@6470 525 and the previous, where exactly (in terms of element
dbaron@6470 526 boundaries) is the break forced?
dbaron@6470 527 </p>
dbaron@6470 528
dbaron@6470 529 <p>
dbaron@6470 530 Only positive integers are accepted.
dbaron@6470 531 Zero or negative integers are a parse error.
dbaron@6470 532 </p>
dbaron@6470 533 </dd>
dbaron@6470 534 </dl>
dbaron@6470 535
dbaron@6470 536 <p class="issue">Should this apply to regions overflow only, or also
dbaron@6470 537 to pagination?</p>
dbaron@6470 538
dbaron@6470 539 <h2 id="conformance">
dbaron@6470 540 Conformance</h2>
dbaron@6470 541
dbaron@6470 542 <h3 id="placement">
dbaron@6470 543 Module interactions</h3>
dbaron@6470 544
dbaron@6470 545 <p>This module extends the 'overflow'
dbaron@6470 546 feature defined in [[CSS21]] section 11.1.1. It defines additional
dbaron@6470 547 overflow handling mechanisms that implementations must implement as
dbaron@6470 548 described in this module in order to conform to this module.</p>
dbaron@6470 549
dbaron@6470 550 <p>No properties in this module apply to the <code>::first-line</code> or
dbaron@6470 551 <code>::first-letter</code> pseudo-elements.</p>
dbaron@6470 552
dbaron@6470 553 <h3 id="values">
dbaron@6470 554 Values</h3>
dbaron@6470 555
dbaron@6470 556 <p>This specification follows the
dbaron@6470 557 <a href="http://www.w3.org/TR/CSS21/about.html#property-defs">CSS property
dbaron@6470 558 definition conventions</a> from [[!CSS21]]. Value types not defined in
dbaron@6470 559 this specification are defined in CSS Level 2 Revision 1 [[!CSS21]].
dbaron@6470 560 Other CSS modules may expand the definitions of these value types: for
dbaron@6470 561 example [[CSS3COLOR]], when combined with this module, expands the
dbaron@6470 562 definition of the &lt;color&gt; value type as used in this specification.</p>
dbaron@6470 563
dbaron@6470 564 <p>In addition to the property-specific values listed in their definitions,
dbaron@6470 565 all properties defined in this specification also accept the
dbaron@6470 566 <a href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit">inherit</a>
dbaron@6470 567 keyword as their property value. For readability it has not been repeated
dbaron@6470 568 explicitly.
dbaron@6470 569
dbaron@6470 570
dbaron@6470 571 <h3 id="conventions">
dbaron@6470 572 Document conventions</h3>
dbaron@6470 573
dbaron@6470 574 <p>Conformance requirements are expressed with a combination of
dbaron@6470 575 descriptive assertions and RFC 2119 terminology. The key words “MUST”,
dbaron@6470 576 “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
dbaron@6470 577 “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
dbaron@6470 578 document are to be interpreted as described in RFC 2119.
dbaron@6470 579 However, for readability, these words do not appear in all uppercase
dbaron@6470 580 letters in this specification.
dbaron@6470 581
dbaron@6470 582 <p>All of the text of this specification is normative except sections
dbaron@6470 583 explicitly marked as non-normative, examples, and notes. [[!RFC2119]]</p>
dbaron@6470 584
dbaron@6470 585 <p>Examples in this specification are introduced with the words “for example”
dbaron@6470 586 or are set apart from the normative text with <code>class="example"</code>,
dbaron@6470 587 like this:
dbaron@6470 588
dbaron@6470 589 <div class="example">
dbaron@6470 590 <p>This is an example of an informative example.</p>
dbaron@6470 591 </div>
dbaron@6470 592
dbaron@6470 593 <p>Informative notes begin with the word “Note” and are set apart from the
dbaron@6470 594 normative text with <code>class="note"</code>, like this:
dbaron@6470 595
dbaron@6470 596 <p class="note">Note, this is an informative note.</p>
dbaron@6470 597
dbaron@6470 598 <h3 id="conformance-classes">
dbaron@6470 599 Conformance classes</h3>
dbaron@6470 600
dbaron@6474 601 <p>Conformance to CSS Region Styling Module Level 3
dbaron@6470 602 is defined for three conformance classes:
dbaron@6470 603 <dl>
dbaron@6470 604 <dt><dfn title="style sheet!!as conformance class">style sheet</dfn>
dbaron@6470 605 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
dbaron@6470 606 style sheet</a>.
dbaron@6470 607 <dt><dfn>renderer</dfn></dt>
dbaron@6470 608 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
dbaron@6470 609 that interprets the semantics of a style sheet and renders
dbaron@6470 610 documents that use them.
dbaron@6470 611 <dt><dfn id="authoring-tool">authoring tool</dfn></dt>
dbaron@6470 612 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
dbaron@6470 613 that writes a style sheet.
dbaron@6470 614 </dl>
dbaron@6470 615
dbaron@6474 616 <p>A style sheet is conformant to CSS Region Styling Module Level 3
dbaron@6470 617 if all of its statements that use syntax defined in this module are valid
dbaron@6470 618 according to the generic CSS grammar and the individual grammars of each
dbaron@6470 619 feature defined in this module.
dbaron@6470 620
dbaron@6474 621 <p>A renderer is conformant to CSS Region Styling Module Level 3
dbaron@6470 622 if, in addition to interpreting the style sheet as defined by the
dbaron@6470 623 appropriate specifications, it supports all the features defined
dbaron@6474 624 by CSS Region Styling Module Level 3 by parsing them correctly
dbaron@6470 625 and rendering the document accordingly. However, the inability of a
dbaron@6470 626 UA to correctly render a document due to limitations of the device
dbaron@6470 627 does not make the UA non-conformant. (For example, a UA is not
dbaron@6470 628 required to render color on a monochrome monitor.)
dbaron@6470 629
dbaron@6474 630 <p>An authoring tool is conformant to CSS Region Styling Module Level 3
dbaron@6470 631 if it writes style sheets that are syntactically correct according to the
dbaron@6470 632 generic CSS grammar and the individual grammars of each feature in
dbaron@6470 633 this module, and meet all other conformance requirements of style sheets
dbaron@6470 634 as described in this module.
dbaron@6470 635
dbaron@6470 636 <h3 id="partial">
dbaron@6470 637 Partial implementations</h3>
dbaron@6470 638
dbaron@6470 639 <p>So that authors can exploit the forward-compatible parsing rules to
dbaron@6470 640 assign fallback values, CSS renderers <strong>must</strong>
dbaron@6470 641 treat as invalid (and <a href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore
dbaron@6470 642 as appropriate</a>) any at-rules, properties, property values, keywords,
dbaron@6470 643 and other syntactic constructs for which they have no usable level of
dbaron@6470 644 support. In particular, user agents <strong>must not</strong> selectively
dbaron@6470 645 ignore unsupported component values and honor supported values in a single
dbaron@6470 646 multi-value property declaration: if any value is considered invalid
dbaron@6470 647 (as unsupported values must be), CSS requires that the entire declaration
dbaron@6470 648 be ignored.</p>
dbaron@6470 649
dbaron@6470 650 <h3 id="experimental">
dbaron@6470 651 Experimental implementations</h3>
dbaron@6470 652
dbaron@6470 653 <p>To avoid clashes with future CSS features, the CSS2.1 specification
dbaron@6470 654 reserves a <a href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords">prefixed
dbaron@6470 655 syntax</a> for proprietary and experimental extensions to CSS.
dbaron@6470 656
dbaron@6470 657 <p>Prior to a specification reaching the Candidate Recommendation stage
dbaron@6470 658 in the W3C process, all implementations of a CSS feature are considered
dbaron@6470 659 experimental. The CSS Working Group recommends that implementations
dbaron@6470 660 use a vendor-prefixed syntax for such features, including those in
dbaron@6470 661 W3C Working Drafts. This avoids incompatibilities with future changes
dbaron@6470 662 in the draft.
dbaron@6470 663 </p>
dbaron@6470 664
dbaron@6470 665 <h3 id="testing">
dbaron@6470 666 Non-experimental implementations</h3>
dbaron@6470 667
dbaron@6470 668 <p>Once a specification reaches the Candidate Recommendation stage,
dbaron@6470 669 non-experimental implementations are possible, and implementors should
dbaron@6470 670 release an unprefixed implementation of any CR-level feature they
dbaron@6470 671 can demonstrate to be correctly implemented according to spec.
dbaron@6470 672
dbaron@6470 673 <p>To establish and maintain the interoperability of CSS across
dbaron@6470 674 implementations, the CSS Working Group requests that non-experimental
dbaron@6470 675 CSS renderers submit an implementation report (and, if necessary, the
dbaron@6470 676 testcases used for that implementation report) to the W3C before
dbaron@6470 677 releasing an unprefixed implementation of any CSS features. Testcases
dbaron@6470 678 submitted to W3C are subject to review and correction by the CSS
dbaron@6470 679 Working Group.
dbaron@6470 680
dbaron@6470 681 <p>Further information on submitting testcases and implementation reports
dbaron@6470 682 can be found from on the CSS Working Group's website at
dbaron@6470 683 <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
dbaron@6470 684 Questions should be directed to the
dbaron@6470 685 <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">[email protected]</a>
dbaron@6470 686 mailing list.
dbaron@6470 687
dbaron@6470 688 <h3 id="cr-exit-criteria">
dbaron@6470 689 CR exit criteria</h3>
dbaron@6470 690
dbaron@6470 691 <p class=issue>[Change or remove the following CR exit criteria if
dbaron@6470 692 the spec is not a module, but, e.g., a Note or a profile. This text was <a
dbaron@6470 693 href="http://www.w3.org/Style/CSS/Tracker/actions/44"> decided on 2008-06-04.</a>]</p>
dbaron@6470 694
dbaron@6470 695 <p>
dbaron@6470 696 For this specification to be advanced to Proposed Recommendation,
dbaron@6470 697 there must be at least two independent, interoperable implementations
dbaron@6470 698 of each feature. Each feature may be implemented by a different set of
dbaron@6470 699 products, there is no requirement that all features be implemented by
dbaron@6470 700 a single product. For the purposes of this criterion, we define the
dbaron@6470 701 following terms:
dbaron@6470 702
dbaron@6470 703 <dl>
dbaron@6470 704 <dt>independent <dd>each implementation must be developed by a
dbaron@6470 705 different party and cannot share, reuse, or derive from code
dbaron@6470 706 used by another qualifying implementation. Sections of code that
dbaron@6470 707 have no bearing on the implementation of this specification are
dbaron@6470 708 exempt from this requirement.
dbaron@6470 709
dbaron@6470 710 <dt>interoperable <dd>passing the respective test case(s) in the
dbaron@6470 711 official CSS test suite, or, if the implementation is not a Web
dbaron@6470 712 browser, an equivalent test. Every relevant test in the test
dbaron@6470 713 suite should have an equivalent test created if such a user
dbaron@6470 714 agent (UA) is to be used to claim interoperability. In addition
dbaron@6470 715 if such a UA is to be used to claim interoperability, then there
dbaron@6470 716 must one or more additional UAs which can also pass those
dbaron@6470 717 equivalent tests in the same way for the purpose of
dbaron@6470 718 interoperability. The equivalent tests must be made publicly
dbaron@6470 719 available for the purposes of peer review.
dbaron@6470 720
dbaron@6470 721 <dt>implementation <dd>a user agent which:
dbaron@6470 722
dbaron@6470 723 <ol class=inline>
dbaron@6470 724 <li>implements the specification.
dbaron@6470 725
dbaron@6470 726 <li>is available to the general public. The implementation may
dbaron@6470 727 be a shipping product or other publicly available version
dbaron@6470 728 (i.e., beta version, preview release, or “nightly build”).
dbaron@6470 729 Non-shipping product releases must have implemented the
dbaron@6470 730 feature(s) for a period of at least one month in order to
dbaron@6470 731 demonstrate stability.
dbaron@6470 732
dbaron@6470 733 <li>is not experimental (i.e., a version specifically designed
dbaron@6470 734 to pass the test suite and is not intended for normal usage
dbaron@6470 735 going forward).
dbaron@6470 736 </ol>
dbaron@6470 737 </dl>
dbaron@6470 738
dbaron@6470 739 <p>The specification will remain Candidate Recommendation for at least
dbaron@6470 740 six months.
dbaron@6470 741
dbaron@6470 742 <h2 class=no-num id="acknowledgments">
dbaron@6470 743 Acknowledgments</h2>
dbaron@6470 744
dbaron@6470 745 <p>
dbaron@6470 746 Thanks especially to the feedback from
dbaron@6470 747 H&aring;kon Wium Lie,
dbaron@6470 748 Florian Rivoal,
dbaron@6473 749 Alan Stearns,
dbaron@6470 750 and all the rest of the
dbaron@6470 751 <a href="http://lists.w3.org/Archives/Public/www-style/">www-style</a> community.
dbaron@6470 752 </p>
dbaron@6470 753
dbaron@6470 754 <h2 class=no-num id="references">
dbaron@6470 755 References</h2>
dbaron@6470 756
dbaron@6470 757 <h3 class="no-num" id="normative-references">
dbaron@6470 758 Normative references</h3>
dbaron@6470 759 <!--normative-->
dbaron@6470 760
dbaron@6470 761 <h3 class="no-num" id="other-references">
dbaron@6470 762 Other references</h3>
dbaron@6470 763 <!--informative-->
dbaron@6470 764
dbaron@6470 765 <h2 class="no-num" id="index">
dbaron@6470 766 Index</h2>
dbaron@6470 767 <!--index-->
dbaron@6470 768
dbaron@6470 769 <h2 class="no-num" id="property-index">
dbaron@6470 770 Property index</h2>
dbaron@6470 771 <!-- properties -->
dbaron@6470 772
dbaron@6470 773 </body>
dbaron@6470 774 </html>
dbaron@6470 775 <!-- Keep this comment at the end of the file
dbaron@6470 776 Local variables:
dbaron@6470 777 mode: sgml
dbaron@6470 778 sgml-declaration:"~/SGML/HTML4.decl"
dbaron@6470 779 sgml-default-doctype-name:"html"
dbaron@6470 780 sgml-minimize-attributes:t
dbaron@6470 781 sgml-nofill-elements:("pre" "style" "br")
dbaron@6470 782 sgml-live-element-indicator:t
dbaron@6470 783 sgml-omittag:nil
dbaron@6470 784 sgml-shorttag:nil
dbaron@6470 785 sgml-namecase-general:t
dbaron@6470 786 sgml-general-insert-case:lower
dbaron@6470 787 sgml-always-quote-attributes:t
dbaron@6470 788 sgml-indent-step:nil
dbaron@6470 789 sgml-indent-data:t
dbaron@6470 790 sgml-parent-document:nil
dbaron@6470 791 sgml-exposed-tags:nil
dbaron@6470 792 sgml-local-catalogs:nil
dbaron@6470 793 sgml-local-ecat-files:nil
dbaron@6470 794 End:
dbaron@6470 795 -->
dbaron@6470 796

mercurial