css-overflow/Overview.bs

Sun, 15 Jan 2017 22:18:42 +0900

author
Florian Rivoal <[email protected]>
date
Sun, 15 Jan 2017 22:18:42 +0900
changeset 18680
078265332f8e
parent 18674
dc1f0ffba654
child 19333
f237c1a2c6aa
permissions
-rw-r--r--

[css-overflow] Define scrollbar-gutter

Closes #92

     1 <h1>CSS Overflow Module Level 4</h1>
     2 <pre class="metadata">
     3 Status: ED
     4 Work Status: Exploring
     5 ED: https://drafts.csswg.org/css-overflow-4/
     6 Shortname: css-overflow
     7 Group: csswg
     8 Level: 4
     9 TR: https://www.w3.org/TR/css-overflow-4/
    10 Previous version: https://www.w3.org/TR/css-overflow-3/
    11 Editor: L. David Baron, Mozilla https://www.mozilla.org/, https://dbaron.org/
    12 Editor: Florian Rivoal, On behalf of Bloomberg, http://florian.rivoal.net/
    13 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.
    14 !Change Log: <a href="https://hg.csswg.org/drafts/log/tip/css-overflow/Overview.bs">from 27 January 2015 to the present</a>
    15 !Change Log: <a href="https://hg.csswg.org/drafts/log/tip/css-overflow/Overview.src.html">from 28 March 2013 to 27 January 2015</a>
    16 !Change Log: <a href="https://hg.csswg.org/drafts/log/tip/css3-overflow/Overview.src.html">from 31 July 2012 to 27 March 2013</a>
    17 Ignored Terms: display-inside, display-outside
    18 </pre>
    19 <!-- FIXME: Regressions from bikeshed conversion: -->
    20 <!-- - Value lines in propdef tables no longer link to #values. -->
    21 <!-- - no longer says "Test suite: none yet" -->
    22 <!-- - Abstract has the most introductory sentence last -->
    23 <!-- FIXME: other bikeshed issues -->
    24 <pre class="link-defaults">
    25 spec:css-transforms-1; type:property; text:transform-style
    26 type: dfn; spec:css-multicol-1; text:overflow column
    27 </pre>
    28 <!-- FIXME: the break-* link doesn't actually work! -->
    29 <pre class="anchors">
    30 url: https://www.w3.org/TR/2008/CR-css3-marquee-20081205/#the-overflow-style; type: property; text: overflow-style;
    31 url: https://drafts.csswg.org/selectors-3/#subject; type: dfn; text: subject;
    32 </pre>
    33 	<style>
    34 		table.source-demo-pair {
    35 			width: 100%;
    36 		}
    38 		.in-cards-demo {
    39 			width: 13em;
    40 			height: 8em;
    42 			padding: 4px;
    43 			border: medium solid blue;
    44 			margin: 6px;
    46 			font: medium/1.3 Times New Roman, Times, serif;
    47 			white-space: nowrap;
    48 		}
    50 		.bouncy-columns-demo {
    51 			width: 6em;
    52 			height: 10em;
    53 			float: left;
    54 			margin: 1em;
    55 			font: medium/1.25 Times New Roman, Times, serif;
    56 			white-space: nowrap;
    57 		}
    58 		.bouncy-columns-demo.one {
    59 			background: aqua; color: black;
    60 			transform: rotate(-3deg);
    61 		}
    62 		.bouncy-columns-demo.two {
    63 			background: yellow; color: black;
    64 			transform: rotate(3deg);
    65 		}
    67 		.article-font-inherit-demo {
    68 			font: 1em/1.25 Times New Roman, Times, serif;
    69 			white-space: nowrap;
    70 		}
    71 		.article-font-inherit-demo.one {
    72 			width: 12em;
    73 			font-size: 1.5em;
    74 			margin-bottom: 1em;
    75 			height: 4em;
    76 		}
    77 		.article-font-inherit-demo.two {
    78 			width: 11em;
    79 			margin-left: 5em;
    80 			margin-right: 2em;
    81 		}
    83 		.dark-columns-demo {
    84 			width: 6em;
    85 			height: 10em;
    86 			float: left;
    87 			margin-right: 1em;
    88 			font: medium/1.25 Times New Roman, Times, serif;
    89 			white-space: nowrap;
    90 		}
    91 		.dark-columns-demo.one {
    92 			background: aqua; color: black;
    93 		}
    94 		.dark-columns-demo.one :link {
    95 			color: blue;
    96 		}
    97 		.dark-columns-demo.one :visited {
    98 			color: purple;
    99 		}
   100 		.dark-columns-demo.two {
   101 			background: navy; color: white;
   102 		}
   103 		.dark-columns-demo.two :link {
   104 			color: aqua;
   105 		}
   106 		.dark-columns-demo.two :visited {
   107 			color: fuchsia;
   108 		}
   110 		.article-max-lines-demo {
   111 			font: 1em/1.25 Times New Roman, Times, serif;
   112 			white-space: nowrap;
   113 		}
   114 		.article-max-lines-demo.one::first-letter {
   115 			font-size: 2em;
   116 			line-height: 0.9;
   117 		}
   118 		.article-max-lines-demo.one {
   119 			font-size: 1.5em;
   120 			width: 16em;
   121 		}
   122 		.article-max-lines-demo.two {
   123 			width: 11.5em;
   124 			float: left; margin-right: 1em;
   125 		}
   126 		.article-max-lines-demo.three {
   127 			width: 11.5em;
   128 			float: left;
   129 		}
   130 	</style>
   132 	<p>
   133 	</p>
   135 <h2 id="intro">
   136 Introduction</h2>
   138 	<p>
   139 		In CSS Level 1 [[CSS1]], placing more content than would fit
   140 		inside an element with a specified size
   141 		was generally an authoring error.
   142 		Doing so caused the content to extend
   143 		outside the bounds of the element,
   144 		which would likely cause
   145 		that content to overlap with other elements.
   146 	</p>
   148 	<p>
   149 		CSS Level 2 [[CSS21]] introduced the 'overflow' property,
   150 		which allows authors to have overflow be handled by scrolling,
   151 		which means it is no longer an authoring error.
   152 		It also allows authors to specify
   153 		that overflow is handled by clipping,
   154 		which makes sense when the author's intent
   155 		is that the content not be shown.
   156 	</p>
   158 	<p>
   159 		However, scrolling is not the only way
   160 		to present large amounts of content,
   161 		and may even not be the optimal way.
   162 		After all, the codex replaced the scroll
   163 		as the common format for large written works
   164 		because of its advantages.
   165 	</p>
   167 	<p>
   168 		This specification introduces
   169 		a mechanism for Web pages to specify
   170 		that an element of a page should handle overflow
   171 		through pagination rather than through scrolling.
   172 	</p>
   174 	<p>
   175 		This specification also extends the concept of overflow
   176 		in another direction.
   177 		Instead of requiring that authors specify a single area
   178 		into which the content of an element must flow,
   179 		this specification allows authors to specify multiple fragments,
   180 		each with their own dimensions and styles,
   181 		so that the content of the element can flow from one to the next,
   182 		using as many as needed to place the content without overflowing.
   183 	</p>
   185 	<p>
   186 		In both of these cases, implementations must
   187 		break the content in the block-progression dimension.
   188 		Implementations must do this is described
   189 		in the CSS Fragmentation Module [[!CSS3-BREAK]].
   190 	</p>
   192 <h2 id="overflow-concepts">Types of overflow</h2>
   194 	<p>
   195 		CSS uses the term <dfn>overflow</dfn> to describe
   196 		the contents of a box
   197 		that extend outside that one of that box's edges
   198 		(i.e., its <i>content edge</i>, <i>padding edge</i>,
   199 		<i>border edge</i>, or <i>margin edge</i>).
   200 		The overflow might be described as the elements or features
   201 		that cause this overflow,
   202 		the non-rectangular region occupied by these features,
   203 		or, more commonly,
   204 		as the minimal rectangle that bounds that region.
   205 		A box's overflow is computed based on the boxes and styles
   206 		of the box and of all its descendants whose containing block chain
   207 		<span class="issue">undefined term?</span>
   208 		includes the box.
   209 	</p>
   211 	<p>
   212 		In most cases, any of these types of overflow
   213 		can be computed for any box
   214 		from the bounds and properties of that box,
   215 		and from the overflow (of that type)
   216 		of each of its children.
   217 		However, this is not always the case; for example,
   218 		when ''transform-style: preserve-3d'' [[CSS3-TRANSFORMS]] is used on
   219 		some of the children, their descendants with
   220 		''transform-style: preserve-3d'' must also be examined.
   221 	</p>
   223 <h3 id="ink-overflow">Ink overflow</h3>
   225 	<p>
   226 		The <dfn id="ink-overflow0">ink overflow</dfn> of a box
   227 		is the part of that box and its contents that
   228 		creates a visual effect outside of
   229 		the box's border box.
   230 	</p>
   232 	<p>
   233 		Since some effects in CSS (for example, the blurs in
   234 		'text-shadow' [[CSS3TEXT]] and 'box-shadow' [[CSS3BG]])
   235 		do not define what visual extent they cover, the extent
   236 		of the <a>ink overflow</a> is undefined.
   237 	</p>
   239 	<p class="issue">
   240 		Should we try to define it at all and just leave pieces undefined?
   241 	</p>
   243 	<p>
   244 		The <dfn>ink overflow region</dfn> is the non-rectangular region
   245 		occupied by the <a>ink overflow</a>, and the
   246 		<dfn>ink overflow rectangle</dfn> is
   247 		the minimal rectangle whose axis is aligned to the box's axes
   248 		and contains the <a>ink overflow region</a>.
   249 		Note that the <a>ink overflow rectangle</a> is a rectangle
   250 		in the box's coordinate system, but might be non-rectangular
   251 		in other coordinate systems due to transforms [[CSS3-TRANSFORMS]].
   252 	</p>
   254 <h3 id="scrollable-overflow">Scrollable overflow</h3>
   256 	<p>
   257 		The <dfn id="scrollable-overflow0">scrollable overflow</dfn> of a box is the
   258 		set of things extending outside of that box's padding edge
   259 		for which a scrolling mechanism needs to be provided.
   260 	</p>
   262 	<p class="issue">
   263 		The following definition should be rewritten to use
   264 		the concept of <a href="https://drafts.csswg.org/css-transforms/#3d-rendering-context">3D rendering context</a> [[!CSS3-TRANSFORMS]]
   265 		and related terms,
   266 		particularly once those concepts stabilize following changes
   267 		proposed in the CSS WG meeting on the morning of 2014-01-28.
   268 	</p>
   270 	<p>
   271 		Given the following definitions
   272 		<span class="issue">which belong in [[CSS3-TRANSFORMS]]</span>:
   273 	</p>
   275 	<dl>
   276 		<dt><dfn>3d-preserving child</dfn></dt>
   277 		<dd>
   278 			A child box B of a containing block C is a 3d-preserving
   279 			child if it has ''transform-style: preserve-3d''
   280 			and the user-agent is not required to flatten it
   281 			based on the <a href="https://www.w3.org/TR/css3-transforms/#transform-style-property">requirements</a> in [[!CSS3-TRANSFORMS]].
   282 		</dt>
   283 		<dt><dfn>non-3d-preserving child</dfn></dt>
   284 		<dd>
   285 			A child C of a box P is a non-3d-preserving-child if
   286 			it is not a <a>3d-preserving child</a>.
   287 		</dd>
   288 		<dt><dfn>3d-preserving descendant</dfn></dt>
   289 		<dd>
   290 			Box D is a 3d-preserving descendant of box A if A is
   291 			an ancestor of D, and D and all of the boxes (if any)
   292 			in the containing block chain from D to A
   293 			are <a>3d-preserving child</a> boxes.
   294 		</dd>
   295 	</dl>
   297 	<p>The scrollable overflow of a box is the union of the following things,
   298 	all adjusted for transforms <span class="issue">undefined concept!</span> into the box's coordinate space:</p>
   300 	<ul>
   301 		<li>
   302 			for the box and all of its <a>3d-preserving descendant</a> boxes:
   303 			<ul>
   304 				<li>the box's own padding edge (for the box itself) or border edge (for <a>3d-preserving descendant</a> boxes)</li>
   305 				<li>the bounds <span class="issue">undefined term!</span> of any text directly in the box</li>
   306 				<li><span class="issue">MORE HERE!</span>
   307 			</ul>
   308 		<li>
   309 			for all the <a>non-3d-preserving child</a> boxes of the
   310 			box and its <a>3d-preserving descendant</a> boxes,
   311 			the scrollable overflow of the box
   312 		</li>
   313 	</ul>
   315 	<p class="issue">
   316 		I wrote this definition off the top of my head,
   317 		so it can't possibly be right.
   318 		It's missing tons of pieces!
   319 	</p>
   321 	<p class="issue">
   322 		The handling of preserve-3d subtrees here is probably wrong;
   323 		the elements should probably count
   324 		only towards the overflow of the element that flattens them.
   325 	</p>
   327 	<p>
   328 		The <dfn>scrollable overflow region</dfn> is the non-rectangular region
   329 		occupied by the <a>scrollable overflow</a>, and the
   330 		<dfn>scrollable overflow rectangle</dfn> is
   331 		the minimal rectangle whose axis is aligned to the box's axes
   332 		and contains the <a>scrollable overflow region</a>.
   333 		Note that the <a>scrollable overflow rectangle</a> is a rectangle
   334 		in the box's coordinate system, but might be non-rectangular
   335 		in other coordinate systems due to transforms [[CSS3-TRANSFORMS]].
   336 	</p>
   338 <h2 id="overflow-properties">Overflow properties</h2>
   340 	<p>
   341 		The 'overflow-x' property specifies
   342 		the handling of overflow in the horizontal direction
   343 		(i.e., overflow from the left and right sides of the box),
   344 		and the 'overflow-y' property specifies the handling
   345 		of overflow in the vertical direction
   346 		(i.e., overflow from the top and bottom sides of the box)
   347 	</p>
   349 	<pre class=propdef>
   350 		Name: overflow-x, overflow-y
   351 		Value: ''visible'' | ''hidden'' | ''clip'' | ''scroll'' | ''auto''
   352 		Initial: ''visible''
   353 		Applies to: block containers [[!CSS21]], flex containers [[!CSS3-FLEXBOX]], and grid containers [[!CSS3-GRID-LAYOUT]]
   354 		Inherited: no
   355 		Percentages: N/A
   356 		Media: visual
   357 		Computed value: see below
   358 		Animatable: no
   359 		Canonical order: <abbr title="follows order of property value definition">per grammar</abbr>
   360 	</pre>
   362 	<p>
   363 		The 'overflow' property is a shorthand property
   364 		that sets the specified values of both 'overflow-x' and 'overflow-y'
   365 		to the value specified for 'overflow'.
   366 	</p>
   368 	<pre class=propdef>
   369 		Name: overflow
   370 		Value: ''visible'' | ''hidden'' | ''clip'' | ''scroll'' | ''auto''
   371 		Initial: see individual properties
   372 		Applies to: block containers [[!CSS21]], flex containers [[!CSS3-FLEXBOX]], and grid containers [[!CSS3-GRID-LAYOUT]]
   373 		Inherited: no
   374 		Percentages: N/A
   375 		Media: visual
   376 		Computed value: see individual properties
   377 		Animatable: no
   378 		Canonical order: <abbr title="follows order of property value definition">per grammar</abbr>
   379 	</pre>
   381 	<div id="overflow-computed-values">
   382 		<p>The computed values of 'overflow-x' and 'overflow-y'
   383 		are determined from the cascaded values [[!CSS3CASCADE]]
   384 		based on the following rules:</p>
   386 		<ol>
   387 			<li>
   388 				If one cascaded values is ''overflow/visible''
   389 				and the other is not,
   390 				then computed values are the cascaded values
   391 				with ''overflow/visible'' changed to ''overflow/auto''.
   392 			</li>
   393 			<li>
   394 				Otherwise, the computed values are as specified.
   395 			</li>
   396 		</ol>
   397 	</div>
   399 	<p>The values of these properties are:</p>
   401 	<dl dfn-for="overflow, overflow-x, overflow-y" dfn-type="value">
   402 		<dt><dfn>visible</dfn>
   403 		<dd>
   404 			There is no special handling of overflow, that is, it
   405 			may be rendered outside the block container.
   406 		</dd>
   407 		<dt><dfn>hidden</dfn>
   408 		<dd>
   409 			This value indicates that
   410 			the box’s content is clipped to its padding box
   411 			and that the UA must not provide any scrolling user interface
   412 			to view the content outside the clipping region,
   413 			nor allow scrolling by direct intervention of the user,
   414 			such as dragging on a touch screen
   415 			or using the scrolling wheel on a mouse.
   416 			However, the content must still be scrollable programatically,
   417 			for example using the mechanisms defined in [[CSSOM-VIEW]],
   418 			and the box is therefore still a <a>scroll container</a>.
   420 		<dt><dfn>clip</dfn>
   421 		<dd>Like ''hidden'',
   422 		this value indicates that
   423 		the content is clipped
   424 		and that no scrolling user interface should be provided by the UA
   425 		to view the content outside the clipping region.
   426 		In addition, unlike ''overflow: hidden''
   427 		which still allows programmatic scrolling,
   428 		''overflow: clip'' forbids scrolling entirely,
   429 		through any mechanism.
   431 		Issue: Mozilla implements -moz-hidden-unscrollable,
   432 		which is similar to ''clip'',
   433 		except that it does not cause the element to establish a BFC.
   434 		Should we match that?
   435 		<dt><dfn>scroll</dfn>
   436 		<dd>This value indicates that the content is clipped
   437 		and that if the user agent uses a scrolling mechanism
   438 		that is visible on the screen (such as a scroll bar or a panner),
   439 		that mechanism should be displayed for a box
   440 		whether or not any of its content is clipped.
   441 		This avoids any problem with scrollbars appearing
   442 		and disappearing in a dynamic environment.
   443 		When this value is specified and the target medium is ''print'',
   444 		overflowing content may be printed.
   445 		<dt><dfn>auto</dfn>
   446 		<dd>The behavior of the ''overflow/auto'' value is user agent-dependent,
   447 		but should cause a scrolling mechanism to be provided for overflowing boxes.
   448 	</dl>
   450 	Even if 'overflow' is set to ''overflow/visible'',
   451 	content may be clipped to a UA's document window by the native operating environment.
   453 	If the computed value of 'overflow' is not ''overflow/visible'',
   454 	the element creates a block formatting context.
   456 	UAs must apply the 'overflow' property
   457 	set on the root element to the viewport.
   458 	HTML UAs must instead apply the ‘overflow’ property
   459 	from the <{body}> element to the viewport
   460 	if the value on the root element is ''visible''.
   461 	The ''visible'' value when used for the viewport
   462 	must be interpreted as ''overflow/auto''.
   463 	The element from which the value is propagated
   464 	must have a used value for 'overflow' of ''visible''.
   466 	In the case of a scrollbar being placed on an edge of the element's box,
   467 	it should be inserted between the inner border edge
   468 	and the outer padding edge.
   469 	Any space taken up by the scrollbars should be
   470 	taken out of (subtracted from the dimensions of)
   471 	the containing block formed by the element with the scrollbars.
   473 	Issue: import examples from [[CSS3-BOX]].
   475 	<p class="issue">
   476 		Explain which directions allow scrolling and which don't,
   477 		as a function of 'direction'
   478 		(including propagation of 'direction' to the ICB).
   479 	</p>
   481 <h2 id="scollbar-gutter-property">
   482 Reserving space for the scrollbar: the 'scrollbar-gutter' property</h2>
   484 The space between the inner border edge and the outer padding edge
   485 which user agents may reserve to display the scrollbar
   486 is called the <dfn>scrollbar gutter</dfn>.
   488 The 'scrollbar-gutter' property gives control to the author
   489 over the presence of <a>scrollbar gutters</a>
   490 separately from the ability to control the presence of scrollbars
   491 provided by the 'overflow' property.
   493 <pre class="propdef">
   494 Name: scrollbar-gutter
   495 Value: ''auto'' | [ ''stable'' | ''always'' ] && ''both''? && ''force''?
   496 Initial: auto
   497 Inherited: yes
   498 Computed value: specified value
   499 </pre>
   501 This property affects the presence of <a>scrollbar gutters</a>
   502 placed at the <a>inline start</a> edge or <a>inline end</a> edge of the box.
   504 The presence of a <a>scrollbar gutter</a>
   505 at the <a>block start</a> edge and <a>block end</a> edge of the box
   506 cannot be controlled in this level,
   507 and is determined the same way as the presence of <a>scrollbar gutters</a>
   508 placed at the <a>inline start</a> edge or <a>inline end</a> edge of the box
   509 when 'scrollbar-gutter' is ''scrollbar-gutter/auto''.
   511 Scrollbars which by default are placed over the content box
   512 and do not cause <a>scrollbar gutters</a> to be created
   513 are called <dfn>overlay scrollbars</dfn>.
   514 Such scrollbars are usually partially transparent, revealing the content behind them if any.
   515 Their appearance and size may vary
   516 based on whether and how the user is interacting with them.
   518 Scrollbars which are always placed in a <a>scrollbar gutter</a>,
   519 consuming space when present,
   520 are called <dfn>classic scrollbars</dfn>.
   521 Such scrollbars are usually opaque.
   523 Whether <a>classic scrollbars</a> or <a>overlay scrollbars</a> are used is UA defined.
   525 The appearance and size of the scrollbar is UA defined.
   527 Whether scrollbars appear on the start or end edge of the box is UA defined.
   529 For <a>classic scrollbars</a>,
   530 the width of the <a>scrollbar gutter</a> is the same as the width of the scrollbar.
   531 For <a>overlay scrollbars</a>,
   532 the width of the <a>scrollbar gutter</a> is UA defined.
   533 However, it must not be 0,
   534 and it must not change based on user interactions with the page or the scrollbar
   535 even if the scrollbar itself changes.
   536 Also, it must be the same for all elements in the page.
   538 The values of this property have the following meaning:
   540 <dl dfn-for="scrollbar-gutter">
   541 	<dt><dfn>''scrollbar-gutter/auto''</dfn>
   542 	<dd><a>Classic scrollbars</a> consume space by creating a <a>scrollbar gutter</a>
   543 	when 'overflow' is ''overflow/scroll',
   544 	or when 'overflow' is ''overflow/auto'' and the box is overflowing.
   545 	<a>Overlay scrollbars</a> do not consume space.
   547 	<dt><dfn>''stable''</dfn>
   548 	<dd>The <a>scrollbar gutter</a> is present when
   549 	'overflow' is ''overflow/scroll'' or ''overflow/auto''
   550 	and the scrollbar is a <a>classic scrollbar</a>
   551 	even if the box is not overflowing,
   552 	but not when the scrollbar is an <a>overlay scrollbar</a>.
   554 	<dt><dfn>''always''</dfn>
   555 	<dd>The <a>scrollbar gutter</a> is always present when
   556 	'overflow' is ''overflow/scroll'' or ''overflow/auto'',
   557 	regardless of the type of scrollbar or
   558 	of whether the box is overflowing.
   560 	<dt><dfn>''both''</dfn>
   561 	<dd>If a <a>scrollbar gutter</a> would be present
   562 	on one of the inline start edge or the inline end edge of the box,
   563 	another <a>scrollbar gutter</a> must be present on the opposite edge as well.
   565 	<dt><dfn>''force''</dfn>
   566 	<dd>When the ''scrollbar-gutter/force'' keyword is present
   567 	''scrollbar-gutter/stable'' and ''scrollbar-gutter/always'' take effect
   568 	when 'overflow' is ''overflow/visible'', ''overflow/hidden'' or ''overflow/clip''
   569 	in addition ''overflow/auto'' or ''overflow/scroll''.
   570 	This does not cause a scrollbar to be displayed, only a <a>scrollbar gutter</a>.
   571 </dl>
   573 When the <a>scrollbar gutter</a> is present but the scrollbar is not,
   574 or the scrollbar is transparent or otherwise does not fully obscure the <a>scrollbar gutter</a>,
   575 the background of the <a>scrollbar gutter</a> must be painted as an extension of the padding.
   577 <div class=note>
   578 Note: The following table summarises the interaction of 'overflow' and 'scrollbar-gutter',
   579 showing in which case space is reserved for the <a>scrollbar gutter</a>.
   580 In this table, “G” represents cases where space is reserved for the <a>scrollbar gutter</a>,
   581 “f?” cases where space is reserved for the <a>scrollbar gutter</a>
   582 if ''scrollbar-gutter/force'' was specified,
   583 and empty cells cases where the no space is reserved.
   585 <table class=data>
   586 	<thead>
   587 	<tr>
   588 		<td>
   589 		<td>
   590 		<th colspan=2>Classic scrollbars
   591 		<th colspan=2>Overlay scrollbars
   592 	<tr>
   593 		<th>'overflow'
   594 		<th>'scrollbar-gutter'
   595 		<th>Overflowing
   596 		<th>Not overflowing
   597 		<th>Overflowing
   598 		<th>Not overflowing
   599 	</thead>
   600 	<tr>
   601 		<th rowspan=3>'overflow/scroll'
   602 		<th>''scrollbar-gutter/auto''
   603 		<td>G
   604 		<td>G
   605 		<td>
   606 		<td>
   607 	<tr>
   608 		<th>''scrollbar-gutter/stable''
   609 		<td>G
   610 		<td>G
   611 		<td>
   612 		<td>
   613 	<tr>
   614 		<th>''scrollbar-gutter/always''
   615 		<td>G
   616 		<td>G
   617 		<td>G
   618 		<td>G
   619 	<tr>
   620 		<th rowspan=3>''overflow/auto''
   621 		<th>''scrollbar-gutter/auto''
   622 		<td>G
   623 		<td>
   624 		<td>
   625 		<td>
   626 	<tr>
   627 		<th>''scrollbar-gutter/stable''
   628 		<td>G
   629 		<td>G
   630 		<td>
   631 		<td>
   632 	<tr>
   633 		<th>''scrollbar-gutter/always''
   634 		<td>G
   635 		<td>G
   636 		<td>G
   637 		<td>G
   638 	<tr>
   639 		<th rowspan=3>''overflow/visible'', ''overflow/hidden'', ''overflow/clip''
   640 		<th>''scrollbar-gutter/auto''
   641 		<td>
   642 		<td>
   643 		<td>
   644 		<td>
   645 	<tr>
   646 		<th>''scrollbar-gutter/stable''
   647 		<td>f?
   648 		<td>f?
   649 		<td>
   650 		<td>
   651 	<tr>
   652 		<th>''scrollbar-gutter/always''
   653 		<td>f?
   654 		<td>f?
   655 		<td>f?
   656 		<td>f?
   657 </table>
   658 </div>
   660 <h2 id="fragmentation">Fragmentation of overflow</h2>
   662 The 'continue' property gives authors the ability
   663 to request that content that does not fit inside an element
   664 be fragmented (in the sense of [[!CSS3-BREAK]]),
   665 and provides alternatives
   666 for where the remaining content should continue.
   668 Notably, this property explains traditional pagination,
   669 and extends it further.
   671 	<pre class=propdef>
   672 		Name: continue
   673 		Value: ''auto'' | ''overflow'' | ''paginate'' | ''fragments'' | ''discard''
   674 		Initial: auto
   675 		Applies to: block containers [[!CSS21]], flex containers [[!CSS3-FLEXBOX]], and grid containers [[!CSS3-GRID-LAYOUT]]
   676 		Inherited: no
   677 		Percentages: N/A
   678 		Media: visual
   679 		Computed value: see below
   680 		Animatable: no
   681 		Canonical order: <abbr title="follows order of property value definition">per grammar</abbr>
   682 	</pre>
   684 Issue: The naming of this property and its values is preliminary.
   685 This was initially proposed as
   686 "fragmentation: auto | none | break | clone | page"
   687 in <a href="https://lists.w3.org/Archives/Public/www-style/2015Jan/0357.html">https://lists.w3.org/Archives/Public/www-style/2015Jan/0357.html</a>,
   688 and there is not yet wide agreement as to which naming is better.
   690 Issue: This property is meant to generalize and replace 'region-fragment'.
   691 Once it is sufficiently stable in this specification,
   692 'region-fragment' should be removed from the regions specification in favor of this.
   694 Note: ''continue: fragments'' replaces "overflow:fragments"
   695 from earlier versions of this specification,
   696 while ''continue: paginate'' replaces "overflow: paged-x | paged-y | paged-x-controls | paged-y-controls"
   698 	<dl dfn-for="continue" dfn-type="value">
   699 		<dt><dfn>auto</dfn>
   700 		<dd>''continue/auto'' may only occur as a computed value
   701 		if the element is a <a spec="css-regions">CSS Region</a>
   702 		other than the last one in a <a spec="css-regions">region chain</a>.
   703 		Content that doesn't fit is pushed to the next region of the chain.
   705 		In all other cases, ''continue/auto'' computes to one of the other values.
   707 		<dt><dfn>overflow</dfn>
   708 		<dd>Content that doesn't fit overflows, according to the 'overflow' property
   710 		<dt><dfn>discard</dfn>
   711 		<dd>Content that doesn't fit is discarded at a fragmentation break
   713 		Note: generalized from region-fragment: break; on the last region of a region chain
   715 		Issue: When the element isn't a <a spec="css-break">fragmentation container</a> already,
   716 		should this work by turning it directly into one,
   717 		or by creating a <a>fragment box</a> inside it like ''continue/fragments'' does?
   719 		<dt><dfn>paginate</dfn>
   720 		<dd>Content that doesn't fit paginates.
   721 		This creates a paginated view inside the element
   722 		similar to the way that 'overflow: scroll' creates a scrollable view.
   724 		See <a href="#paginated-overflow">paginated overflow</a>
   726 		Note: Print is effectively "continue: paginate" on the root.
   727 		<dt><dfn>fragments</dfn>
   728 		<dd>content that doesn't fit causes the element to copy itself and continue laying out.
   730 		See <a href="#fragment-overflow">fragment overflow</a>.
   731 	</dl>
   733 The computed value of the 'continue' for a given element or pseudo element is determined as follow:
   734 <ol>
   735 	<li>If the specified value is ''continue/auto''
   736 	<ol>
   737 		<li>On a <a spec="css-regions">CSS Region</a> other than the last one in a <a spec="css-regions">region chain</a>,
   738 		the computed value is ''continue/auto''
   739 		<li>On a page
   740 		the computed value is ''continue/paginate''
   741 		<li>On a <a>fragment box</a>
   742 		the computed value is ''continue/fragments''
   743 		<li>Otherwise, the computed value is ''continue/overflow''
   744 	</ol>
   745 	<li>If the specified value is ''continue/framgents''
   746 	<ol>
   747 		<li>On a page
   748 		the computed value is ''continue/paginate''
   749 		<li>Otherwise, the computed value is the specified value
   750 	</ol>
   751 	<li>In all other cases, the computed value is the specified value
   752 </ol>
   754 Issue: If we introduce a pseudo element that can select columns in a multicol,
   755 we would need to specify that auto computes to auto on it,
   756 or introduce a new value and have auto compute to that
   757 (but what would that value compute to on things that aren't columns?).
   759 Note: For background discussions leading to this property, see these threads:
   760 <a href="http://lists.w3.org/Archives/Public/www-style/2012May/1197.html">discussion of overflow, overflow-x, overflow-y and overflow-style</a> and
   761 <a href="https://lists.w3.org/Archives/Public/www-style/2015Jan/0357.html">proposal for a fragmentation property</a>
   763 <h2 id="paginated-overflow">Paginated overflow</h2>
   765 This section introduces and defines the meaning of the ''continue/paginate'' value of the 'continue' property.
   767 Issue: Write this section
   769 Issue: Pages should be possible to style with @page rules. How does that work for nested pages?
   771 <div class="issue">
   772 Should traditional pagination (e.g. when printing)
   773 be expressed through some magic in the computed value of ''continue/auto'',
   774 or by inserting this in the UA stylesheet:
   775 <pre><code class="lang-css">
   776 @media (overflow-block: paged), (overflow-block: optional-paged) {
   777 	:root {
   778 		continue: paginate;
   779 	}
   780 }
   781 </code></pre>
   782 </div>
   784 Issue: Traditional pagination (e.g. when printing) assumes that
   785 :root is contained in the page box,
   786 rather than having the page box be a pseudo element child of :root.
   787 Can we work around that using something similar to fragment boxes?
   788 Or maybe by having a fragment box (reproducing :root) inside a page box inside :root?
   790 Issue: How does the page box model work when it is a child of a regular css box?
   792 Issue: The initial proposal in [[CSS3GCPM]] and implemantation from Opera
   793 used 4 values instead of ''continue/paginate'':
   794 "paged-x | paged-y | paged-x-controls | paged-y-controls".
   795 Should this property also include these values,
   796 or are they better handled as separate properties?
   797 (e.g.: "pagination-layout: auto | horizontal | vertical", "pagination-controls: auto | none")
   799 Issue: Ability to display N pages at once
   800 rather than just one page at once?
   801 Could this be a value of "pagination-layout", such as:
   802 "pagination-layout: horizontal 2;"
   804 Issue: Brad Kemper has proposed a model for combining pagination and
   805 fragment overflow, which also deals with displaying multiple pages.
   806 <a href="http://www.w3.org/mid/[email protected]">http://www.w3.org/mid/[email protected]</a>
   808 	<p class="issue">
   809 		The current implementation of paginated overflow uses
   810 		the 'overflow'/'overflow-x'/'overflow-y' properties
   811 		rather than the 'overflow-style' property as proposed
   812 		in the [[CSS3GCPM]] draft
   813 		(which also matches the [[CSS3-MARQUEE]] proposal).
   814 		or the 'continue' property as described here.
   815 	</p>
   817 <h2 id="fragment-overflow">Fragment overflow</h2>
   819 This section introduces and defines the meaning of
   820 the ''continue/fragments'' value of the 'continue' property.
   822 	<p>
   823 		When the computed value of 'continue' for an element is ''continue/fragments'',
   824 		and implementations would otherwise have created a box for the element,
   825 		then implementations must create a sequence of <dfn>fragment box</dfn>es
   826 		for that element.
   827 		(It is possible for an element with ''continue: fragments''
   828 		to generate only one <a>fragment box</a>.
   829 		However, if an element's computed 'continue' is not ''continue/fragments'',
   830 		then its box is not a <a>fragment box</a>.)
   831 		Every <a>fragment box</a> is a fragmentation container,
   832 		and any overflow
   833 		that would cause that fragmentation container to fragment
   834 		causes another <a>fragment box</a> created as a next sibling
   835 		of the previous one.
   836 		<span class="issue">Or is it as though it's a next sibling of
   837 		the element?  Need to figure out exactly how this interacts with
   838 		other box-level fixup.</span>
   839 		Additionally, if the <a>fragment box</a> is also
   840 		a multi-column box (as defined in [[!CSS3COL]]
   841 		<span class="issue">though it defines <i>multi-column element</i></span>)
   842 		any content that would lead to the creation of <a>overflow columns</a> [[!CSS3COL]]
   843 		instead is flown into an additional fragment box.
   844 		However, fragment boxes may themselves be broken
   845 		(due to fragmentation in a fragmentation context outside of them,
   846 		such as pages, columns, or other fragment boxes);
   847 		such breaking leads to fragments of the same fragment box
   848 		rather than multiple fragment boxes.
   849 		(This matters because fragment boxes may be styled by their index;
   850 		such breaking leads to multiple fragments of a fragment box
   851 		with a single index.
   852 		This design choice is so that
   853 		breaking a fragment box across pages does not break
   854 		the association of indices to particular pieces of content.)
   855 		<span class="issue">Should a forced break that breaks to
   856 		an outer fragmentation context cause a new fragment of a single
   857 		fragment box or a new fragment box?</span>
   858 		<span class="issue">Should we find a term other than
   859 		<a>fragment box</a> here to make this a little less confusing?</span>
   860 	</p>
   862 	<p class="issue">
   863 		What if we want to be able to style the pieces of an element
   864 		split within another type of fragmentation context?
   865 		These rules prevent ever using ''::nth-fragment()'' for that,
   866 		despite that the name seems the most logical name for such a feature.
   867 	</p>
   869 	<div class="example">
   870 		<table class="source-demo-pair"><tr><td><pre>&lt;!DOCTYPE HTML&gt;
   871 &lt;title&gt;Breaking content into
   872   equal-sized cards&lt;/title&gt;
   873 &lt;style&gt;
   874   .in-cards {
   875     continue: fragments;
   877     width: 13em;
   878     height: 8em;
   880     padding: 4px;
   881     border: medium solid blue;
   882     margin: 6px;
   884     font: medium/1.3 Times New
   885       Roman, Times, serif;
   886   }
   887 &lt;/style&gt;
   888 &lt;div class="in-cards"&gt;
   889   In this example, the text in the div
   890   is broken into a series of cards.
   891   These cards all have the same style.
   892   The presence of enough content to
   893   overflow one of the cards causes
   894   another one to be created.  The second
   895   card is created just like it's the
   896   next sibling of the first.
   897 &lt;/div&gt;</pre></td><td>
   898 			<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>
   899 			<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>
   900 		</td></tr></table>
   901 	</div>
   903 	<p class="issue">
   904 		We should specify that ''continue: fragments'' does not apply
   905 		to at least some table parts,
   906 		and perhaps other elements as well.
   907 		We need to determine exactly which ones.
   908 	</p>
   910 	<p class="issue">
   911 		This specification needs to say which type of
   912 		fragmentation context is created
   913 		so that it's clear which values of the 'break-*' properties
   914 		cause breaks within this context.
   915 		We probably want ''break-*: region'' to apply.
   916 	</p>
   918 	<p class="issue">
   919 		This specification needs a processing model
   920 		that will apply in cases where the layout containing the
   921 		fragments has characteristics that use the intrinsic size of the fragments
   922 		to change the amount of space available for them,
   923 		such as [[CSS3-GRID-LAYOUT]].
   924 		There has already been some work on such a processing model
   925 		in [[CSS3-REGIONS]],
   926 		and the work done on a model there,
   927 		and the editors of that specification,
   928 		should inform what happens in this specification.
   929 	</p>
   931 <h3 id="fragment-styling">Fragment styling</h3>
   933 <h4 id="fragment-pseudo-element">The ::nth-fragment() pseudo-element</h4>
   935 	<p>
   936 		The <dfn selector>::nth-fragment()</dfn> pseudo-element
   937 		is a pseudo-element
   938 		that describes some of the <a>fragment box</a>es generated by an element.
   939 		The argument to the pseudo-element takes the same syntax
   940 		as the argument to the :nth-child() pseudo-class
   941 		defined in [[!SELECT]], and has the same meaning
   942 		except that the number is relative to
   943 		<a>fragment box</a>es generated by the element
   944 		instead of siblings of the element.
   945 	</p>
   947 	<p class="note">
   948 		Selectors that allow addressing fragments
   949 		by counting from the end rather than the start
   950 		are intentionally not provided.
   951 		Such selectors would interfere with determining
   952 		the number of fragments.
   953 	</p>
   955 	<p class="issue">
   956 		Depending on future discussions,
   957 		this ''::nth-fragment(<var>an+b</var>)'' syntax
   958 		may be replaced with
   959 		the new ''::fragment:nth(<var>an+b</var>)'' syntax.
   960 	</p>
   962 <h4 id="style-of-fragments">Styling of fragments</h4>
   964 	<p class="issue">
   965 		Should this apply to continue:fragments only,
   966 		or also to continue:paginate?
   967 		(If it applies,
   968 		then stricter property restrictions would be needed
   969 		for continue:paginate.)
   970 	</p>
   972 	<p>
   973 		In the absence of rules with ''::nth-fragment()'' pseudo-elements,
   974 		the computed style for each <a>fragment box</a>
   975 		is the computed style for the element
   976 		for which the <a>fragment box</a> was created.
   977 		However, the style for a <a>fragment box</a> is also influenced
   978 		by rules whose selector's <a>subject</a> [[!SELECT]]
   979 		has an ''::nth-fragment()'' pseudo-element,
   980 		if the 1-based number of the <a>fragment box</a> matches
   981 		that ''::nth-fragment()'' pseudo-element
   982 		and the selector (excluding the ''::nth-fragment()'' pseudo-element)
   983 		matches the element generating the fragments.
   984 	</p>
   986 	<p>
   987 		When determining the style of the <a>fragment box</a>,
   988 		these rules that match the fragment pseudo-element
   989 		cascade together with the rules that match the element,
   990 		with the fragment pseudo-element adding the specificity
   991 		of a pseudo-class to the specificity calculation.
   992 		<span class="issue">Does this need to be specified in
   993 		the cascading module as well?</span>
   994 	</p>
   996 	<div class="example">
   997 		<table class="source-demo-pair"><tr><td><pre>&lt;!DOCTYPE HTML&gt;
   998 &lt;style&gt;
   999   .bouncy-columns {
  1000     continue: fragments;
  1001     width: 6em;
  1002     height: 10em;
  1003     float: left;
  1004     margin: 1em;
  1005     font: medium/1.25 Times New
  1006       Roman, Times, serif;
  1008   .bouncy-columns::nth-fragment(1) {
  1009     background: aqua; color: black;
  1010     transform: rotate(-3deg);
  1012   .bouncy-columns::nth-fragment(2) {
  1013     background: yellow; color: black;
  1014     transform: rotate(3deg);
  1016 &lt;/style&gt;
  1017 &lt;div class="bouncy-columns"&gt;
  1018   <i>...</i>
  1019 &lt;/div&gt;</pre></td><td>
  1020 			<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>
  1021 			<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>
  1022 			<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>
  1023 		</td></tr></table>
  1024 	</div>
  1026 	<p>
  1027 		Styling an ''::nth-fragment()'' pseudo-element with the 'continue'
  1028 		property does take effect;
  1029 		if a <a>fragment box</a> has a
  1030 		computed value of 'continue' other than ''fragments''
  1031 		then that fragment box is the last fragment.
  1032 		However, overriding 'continue' on the first fragment
  1033 		does not cause the <a>fragment box</a> not to exist;
  1034 		whether there are fragment boxes at all is determined by
  1035 		the computed value of overflow for the element.
  1036 	</p>
  1038 	<p>
  1039 		Styling an ''::nth-fragment()'' pseudo-element with the 'content'
  1040 		property has no effect;
  1041 		the computed value of 'content' for the fragment box
  1042 		remains the same as the computed value of content for the element.
  1043 	</p>
  1045 	<p>
  1046 		Specifying ''display: none'' for a <a>fragment box</a> causes
  1047 		the fragment box with that index not to be generated.
  1048 		However, in terms of the indices
  1049 		used for matching ''::nth-fragment()'' pseudo-elements
  1050 		of later fragment boxes,
  1051 		it still counts as though it was generated.
  1052 		However, since it is not generated, it does not contain any content.
  1053 	</p>
  1055 	<p>
  1056 		Specifying other values of 'display', 'position',
  1057 		or 'float' is permitted, but is not allowed to change
  1058 		the computed value of 'display-inside'.
  1059 		(Since 'continue' only
  1060 		applies to block containers, flex containers, and grid containers
  1061 		the computed value of 'display-inside' is always
  1062 		''display-inside/block'', ''display-inside/flex'', or
  1063 		''display-inside/grid''.
  1064 		<span class="issue">Need to specify exactly how this works,
  1065 		but it depends on
  1066 		having 'display-inside' and 'display-outside' specified.</span>
  1067 	</p>
  1069 	<p>
  1070 		To match the model for other pseudo-elements
  1071 		where the pseudo-elements live inside their corresponding element,
  1072 		declarations in ''::nth-fragment()'' pseudo-elements override
  1073 		declarations in rules without the pseudo-element.
  1074 		The relative priority within such declarations is determined
  1075 		by normal cascading order (see [[!CSS21]]).
  1076 	</p>
  1078 	<p>
  1079 		Styles specified on ''::nth-fragment()'' pseudo-elements
  1080 		do affect inheritance to content within the <a>fragment box</a>.
  1081 		In other words, the content within the <a>fragment box</a> must
  1082 		inherit from the fragment box's style (i.e., the pseudo-element style)
  1083 		rather than directly from the element.
  1084 		This means that elements split between fragment boxes may
  1085 		have different styles for different parts of the element.
  1086 	</p>
  1088 	<p class="issue">
  1089 		This inheritance rule allows specifying styles indirectly
  1090 		(by using explicit ''inherit'' or using default inheritance
  1091 		on properties that don't apply to ''::first-letter'')
  1092 		that can't be specified directly
  1093 		(based on the rules in the next section).
  1094 		This is a problem.
  1095 		The restrictions that apply to styling inside fragments
  1096 		should also apply to inheritance from fragments.
  1097 	</p>
  1099 	<div class="example">
  1100 		<table class="source-demo-pair"><tr><td><pre>&lt;!DOCTYPE HTML&gt;
  1101 &lt;style&gt;
  1102   .article {
  1103     continue: fragments;
  1105   .article::nth-fragment(1) {
  1106     font-size: 1.5em;
  1107     margin-bottom: 1em;
  1108     height: 4em;
  1110   .article::nth-fragment(2) {
  1111     margin-left: 5em;
  1112     margin-right: 2em;
  1114 &lt;/style&gt;
  1115 &lt;div class="article"&gt;
  1116   The &lt;code&gt;font-size&lt;/code&gt; property<i>...</i>
  1117 &lt;/div&gt;</pre></td><td>
  1118 			<div class="article-font-inherit-demo one">The <code>font-size</code> property<br>specified on the fragment<br>is inherited into the</div>
  1119 			<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>
  1120 		</td></tr></table>
  1121 	</div>
  1123 <h4 id="style-in-fragments">Styling inside fragments</h4>
  1125 	<p class="issue">
  1126 		Should this apply to continue:fragments only,
  1127 		or also to continue:paginate?
  1128 	</p>
  1130 	<p>
  1131 		The ''::nth-fragment()'' pseudo-element
  1132 		can also be used to style
  1133 		content inside of a <a>fragment box</a>.
  1134 		Unlike the ''::first-line'' and ''::first-letter'' pseudo-elements,
  1135 		the ''::nth-fragment()'' pseudo-element can be applied
  1136 		to parts of the selector other than the subject:
  1137 		in particular, it can match ancestors of the subject.
  1138 		However, the only CSS properties applied
  1139 		by rules with such selectors
  1140 		are those that apply
  1141 		to the ''::first-letter'' pseudo-element.
  1142 	</p>
  1144 	<p>
  1145 		To be more precise,
  1146 		when a rule's selector has ''::nth-fragment()'' pseudo-elements
  1147 		attached to parts of the selector other than the subject,
  1148 		the declarations in that rule apply to
  1149 		a fragment (or pseudo-element thereof) when:
  1150 	</p>
  1151 	<ol>
  1152 		<li>
  1153 			the declarations are for properties that apply to the
  1154 			''::first-letter'' pseudo-element,
  1155 		</li>
  1156 		<li>
  1157 			the declarations would apply to
  1158 			that fragment (or pseudo-element thereof)
  1159 			had those ''::nth-fragment()'' pseudo-elements been removed,
  1160 			with a particular association between
  1161 			each sequence of simple selectors and the element it matched,
  1162 			and
  1163 		</li>
  1164 		<li>
  1165 			for each removed ''::nth-fragment()'' pseudo-element,
  1166 			the fragment lives within a <a>fragment box</a>
  1167 			of the element associated in that association
  1168 			with the selector that the pseudo-element was attached to,
  1169 			and whose index matches the pseudo-element.
  1170 		</li>
  1171 	</ol>
  1173 	<div class="example">
  1174 		<table class="source-demo-pair"><tr><td><pre>&lt;!DOCTYPE HTML&gt;
  1175 &lt;style&gt;
  1176   .dark-columns {
  1177     continue: fragments;
  1178     width: 6em;
  1179     height: 10em;
  1180     float: left;
  1181     margin-right: 1em;
  1182     font: medium/1.25 Times New
  1183       Roman, Times, serif;
  1185   .dark-columns::nth-fragment(1) {
  1186     background: aqua; color: black;
  1188   .dark-columns::nth-fragment(1) :link {
  1189     color: blue;
  1191   .dark-columns::nth-fragment(1) :visited {
  1192     color: purple;
  1194   .dark-columns::nth-fragment(2) {
  1195     background: navy; color: white;
  1197   .dark-columns::nth-fragment(2) :link {
  1198     color: aqua;
  1200   .dark-columns::nth-fragment(2) :visited {
  1201     color: fuchsia;
  1203 &lt;/style&gt;
  1204 &lt;div class="dark-columns"&gt;
  1205   <i>...</i>
  1206 &lt;/div&gt;</pre></td><td>
  1207 			<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>
  1208 			<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>
  1209 		</td></tr></table>
  1210 	</div>
  1213 <h3 id="max-lines">The 'max-lines' property</h3>
  1215 	<p>
  1216 		Authors may wish to style the opening lines of an element
  1217 		with different styles
  1218 		by putting those opening lines in a separate fragment.
  1219 		However, since it may be difficult to predict the exact height
  1220 		occupied by those lines
  1221 		in order to restrict the first fragment to that height,
  1222 		this specification introduces a 'max-lines' property
  1223 		that forces a fragment to break
  1224 		after a specified number of lines.
  1225 		This forces a break after the given number of lines
  1226 		contained within the element or its descendants,
  1227 		as long as those lines are in the same block formatting context.
  1228 	</p>
  1230 	<pre class=propdef>
  1231 		Name: max-lines
  1232 		Value: ''none'' | ''&lt;integer>''
  1233 		Initial: ''none''
  1234 		Applies to: fragment boxes
  1235 		Inherited: no
  1236 		Animatable: as <a href="https://www.w3.org/TR/css3-transitions/#animatable-types">integer</a>
  1237 		Percentages: N/A
  1238 		Media: visual
  1239 		Computed value: specified value
  1240 		Canonical order: <abbr title="follows order of property value definition">per grammar</abbr>
  1241 	</pre>
  1243 	<dl dfn-for="max-lines" dfn-type="value">
  1244 		<dt><dfn>none</dfn>
  1245 		<dd>
  1246 			<p>
  1247 				Breaks occur only as specified elsewhere.
  1248 			</p>
  1249 		</dd>
  1251 		<dt><dfn><<integer>></dfn>
  1252 		<dd>
  1253 			<p>
  1254 				In addition to any breaks specified elsewhere,
  1255 				a break is forced before any line that would exceed
  1256 				the given number of lines
  1257 				being placed inside the element
  1258 				(excluding lines that are in
  1259 				a different block formatting context from
  1260 				the block formatting context to which
  1261 				an unstyled child of the element would belong).
  1262 			</p>
  1264 			<p class="issue">
  1265 				If there are multiple boundaries between this line
  1266 				and the previous, where exactly (in terms of element
  1267 				boundaries) is the break forced?
  1268 			</p>
  1270 			<p>
  1271 				Only positive integers are accepted.
  1272 				Zero or negative integers are a parse error.
  1273 			</p>
  1274 		</dd>
  1275 	</dl>
  1277 <p class="issue">Should this apply to fragment overflow only, or also
  1278 to pagination?
  1279 Given what we're doing with the continue property,
  1280 it should actually apply to any fragmentainer.</p>
  1282 Issue: having max-lines do nothing on regular elements is not ideal.
  1283 When applied to non fragmentainers,
  1284 it should probably cause 'continue' to compute to ''continue/discard''
  1285 so that you only need to reach for one property rather than 2 to get
  1286 that effect.
  1288 	<div class="example">
  1289 		<table class="source-demo-pair"><tr><td><pre>&lt;!DOCTYPE HTML&gt;
  1290 &lt;style&gt;
  1291   .article {
  1292     continue: fragments;
  1294   .article::first-letter {
  1295     font-size: 2em;
  1296     line-height: 0.9;
  1298   .article::nth-fragment(1) {
  1299     font-size: 1.5em;
  1300     max-lines: 3;
  1302   .article::nth-fragment(2) {
  1303     column-count: 2;
  1305 &lt;/style&gt;
  1306 &lt;div class="article"&gt;
  1307   <i>...</i>
  1308 &lt;/div&gt;</pre></td><td>
  1309 			<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>
  1310 			<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>
  1311 			<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>
  1312 		</td></tr></table>
  1313 	</div>
  1315 <h2 id="static-media">Overflow in static media</h2>
  1317 	<p class="issue">
  1318 		This specification should define useful behavior
  1319 		for all values of 'overflow' and 'continue'
  1320 		in static media (such as print).
  1321 		Current implementation behavior is quite poor and
  1322 		produces unexpected results when authors have not considered
  1323 		what will happen when
  1324 		the content they produce for interactive media
  1325 		is printed.
  1326 	</p>
  1328 <h2 class=no-num id="acknowledgments">
  1329 Acknowledgments</h2>
  1331 	<p>
  1332 		Thanks especially to the feedback from
  1333 		Rossen Atanassov,
  1334 		Bert Bos,
  1335 		Tantek Çelik,
  1336 		John Daggett,
  1337 		fantasai,
  1338 		Daniel Glazman,
  1339 		Vincent Hardy,
  1340 		H&aring;kon Wium Lie,
  1341 		Peter Linss,
  1342 		Robert O'Callahan,
  1343 		Florian Rivoal,
  1344 		Alan Stearns,
  1345 		Steve Zilles,
  1346 		and all the rest of the
  1347 		<a href="http://lists.w3.org/Archives/Public/www-style/">www-style</a> community.
  1348 	</p>

mercurial